04-21-2021 08:28 AM
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
04-21-2021 03:47 PM
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"
04-22-2021 06:58 AM
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
04-22-2021 08:13 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide