cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1141
Views
0
Helpful
3
Replies

EEM event routing + snmp-trap strdata

phil_carter
Level 1
Level 1

Hello,

 

I've written a small EEM script to send an snmp-trap when a specific route is removed from the BGP routing table:

 

event manager applet EEM_TEST_DOWN
 event routing network x.x.x.x/32 type remove protocol bgp
 action 1.0 snmp-trap strdata "<notification msg to send in the trap>"

 

Is there a way to send this single trap created to a particular SNMP host within the EEM script (that is not the same one used globally for all device traps using the snmp-server host command)?

 

If not,  anyone know of a way to filter what traps can be sent (i.e.: just the trap OID the EEM script creates) to the single SNMP host (via the snmp-server host x.x.x.x command)?

 

thanks

Phil

3 Replies 3

Dan Frey
Cisco Employee
Cisco Employee

snmp notification can be sent to a specific server in the command line.   

 

lab-csr1(config)#snmp-server manager 
lab-csr1(config)#exit
lab-csr1#snmp inform v2c 192.168.0.28 public trap-oid cbgpPeer2EstablishedNotification oid cbgpPeer2LastError.172.28.1.62 string "my snmp trap"

phil_carter
Level 1
Level 1

Hello,

Thanks for the reply - unfortunately that isn't an available command (snmp inform...) I can see on my router (3925, c3900-universalk9-mz.SPA.154-3.M8.bin) to test with. Is that also a CLI manual input command used as a one off? Preferably looking for an automatic response to a single prefix removal from the BGP table within the EEM script if possible.

Thanks

Phil

EEM sends trap in the "event-manager" category so you could have a single server provisioned with just this category and all the other snmp-servers configured with all traps except "event-manager"

 

C819#sh run | inc snmp-server host 
snmp-server host 192.168.0.141 public  event-manager
snmp-server host 192.168.0.28 public  bgp envmon pim