From: Scott B. <ba...@ca...> - 2011-03-14 21:23:15
|
I've setup our router to send an SNMP trap when there are BGP changes. Now I'm trying to setup snmptrapd to capture those and alert accordingly. Looking at the syslog after it catches the trap I see: Mar 14 13:23:11 green snmptrapd[11839]: 2011-03-14 13:23:11 halfrack [UDP: [65.182.224.1]:56142]:#012DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1114262776) 128 days, 23:10:27.76#011SNMPv2-MIB::snmpTrapOID.0 = OID: CISCO-SMI::ciscoMgmt.187.0.1#011BGP4-MIB::bgpPeerLastError.198.32.195.27 = Hex-STRING: 06 05 #011BGP4-MIB::bgpPeerState.198.32.195.27 = INTEGER: established(6)#011CISCO-SMI::ciscoMgmt.187.1.2.1.1.7.198.32.195.27 = STRING: "cease"#011CISCO-SMI::ciscoMgmt.187.1.2.1.1.8.198.32.195.27 = INTEGER: 5 >From what I can tell it's sending six OIDs in that trap? Can I catch any of them, or does it have to be a specific one (first/last?). I have my snmptrapd.conf configured as follows: traphandle BGP4-MIB::bgpPeerState /tmp/handler.pl The problem with the BGP transitions is that Cisco sends the IP address of the peer IN the OID. The state of the BGP sessions is: BGP4-MIB::bgpPeerState.W.X.Y.Z where W.X.Y.Z is the IP address of the peer. Can I capture ANY trap that's sent that starts with BGP4-MIB::bgpPeerState to be handled by my perl script handler? -- Scott Baker - Canby Telcom System Administrator - RHCE - 503.266.8253 |