Re: SNMP v2c TRAP CASE

From: Lindsay Hill <lindsay.k.hill_at_gmail.com>
Date: Sun, 9 Sep 2012 18:18:51 +1200

Is this for a specific lab you're working on, or are you trying to test out NMS functionality, in a rack that only has routers/switches?

Because Cisco routers really aren't set up for acting as NMS managers. Yes, there is some support in there for it, but you're better off using a proper NMS for SNMP polling and trap reception/processing.

There's no specific trap that will tell an NMS to retrieve the contact and location values. This is done by the NMS polling the system, not through the use of traps/informs. You could get them yourself using "snmp get"

I suppose if you were feeling really keen, you could configure EEM to process the incoming traps. Something roughly like:

snmp-server manager
event manager applet SNMPTRAP
 event snmp-notification dest-ip-address 1.1.1.1 oid X.X.X op eq oid-val
  action 1.0 syslog msg "Interface on R2 is down"
  action 2.0 cli command "enable"
  action 3.0 cli command "snmp get v2 10.1.1.1 public retry 2 timeout 30 oid sysLocation.0"
 action 4.0 syslog msg "$_cli_result"

Obviously that is completely untested, and you'd need to sort out the OID values above yourself. But really it's not worth it. Use an NMS.

On 9/09/2012, at 2:17 AM, ccie.butcher <ccie.butcher_at_gmail.com> wrote:

> I configured three routers R1<--->R2<---->R3
>
> What i wanted was that whenever the R2's interface connecting R3 goes down,
> i wanted to send trap to R1 which i configured it as snmp manager
> (10.1.1.1).
> From the below debug output (debug snmp packets), i am able to send the
> trap
> messages to manager, but i also wanted following things to happen, which is
> not
> happening :
>
> 1. A log msg appear at console of R1 that R2's interface connecting R3 is
> down.
> 2. Also i want another log msg on R1 that display the contact, location
> configured
> on R2.
>
> Kindly help.....
>
> R2(config-if)#
> *Mar 1 01:30:20.451: SNMP: Queuing packet to 10.1.1.1
> *Mar 1 01:30:20.451: SNMP: V2 Trap, reqid 31, errstat 0, erridx 0
> sysUpTime.0 = 542044
> snmpTrapOID.0 = snmpTraps.4
> ifIndex.2 = 2
> ifDescr.2 = FastEthernet0/1
> ifType.2 = 6
> lifEntry.20.2 = up
> *Mar 1 01:30:20.703: SNMP: *Packet sent via UDP to 10.1.1.1*
>
>
>
> *Mar 1 01:29:40.087: SNMP: *Packet received via UDP from 10.1.1.2 on
> FastEthernet0/0
> **Mar 1 01:29:40.091: SNMP: V2 Trap, reqid 30, errstat 0, erridx 0
> sysUpTime.0 = 541946
> snmpTrapOID.0 = ciscoSyslogMIB.2.0.1
> clogHistoryEntry.2.13 = LINK
> clogHistoryEntry.3.13 = 4
> clogHistoryEntry.4.13 = UPDOWN
> clogHistoryEntry.5.13 = Interface FastEthernet0/1, changed state to up
> clogHistoryEntry.6.13 = 541944
> *Mar 1 01:29:41.071: SNMP: Packet received via UDP from 10.1.1.2 on
> FastEthernet0/0
> *Mar 1 01:29:41.075: SNMP: V2 Trap, reqid 31, errstat 0, erridx 0
> sysUpTime.0 = 542044
> snmpTrapOID.0 = snmpTraps.4
> ifIndex.2 = 2
> ifDescr.2 = *FastEthernet0/1 // R2's
> interface connecting R3 which i shut down to generate trap
> * ifType.2 = 6
>
>
> R2's configuration (SNMP AGENT) :
>
> logging trap debugging
> logging 10.1.1.1
> snmp-server community cisco RW
> snmp-server location SAN JOSE US
> snmp-server contact AT&T Global Services, 1800 180 3333
> snmp-server chassis-id 0x800
> snmp-server enable traps
> snmp-server host 10.1.1.1 version 2c cisco
>
> R1's configuration (SNMP MANAGER) :
>
> snmp-server community cisco RW
> snmp-server host 10.1.1.2 inform version 2c cisco
> snmp-server manager session-timeout 500
> snmp-server manager
>
>
> *Also, What should i do if i want to send informs from my manager to
> retrieve the
> contact and location information from my snmp-agent.*
>
>
> Blogs and organic groups at http://www.ccie.net
>
> _______________________________________________________________________
> Subscription information may be found at:
> http://www.groupstudy.com/list/CCIELab.html

Blogs and organic groups at http://www.ccie.net
Received on Sun Sep 09 2012 - 18:18:51 ART

This archive was generated by hypermail 2.2.0 : Mon Oct 01 2012 - 06:40:29 ART