Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

snmp alerts

What is a good way to configure SNMP alerts/traps on a cisco switch to send a trap to a Syslog server is a utilization on a port exceeeds a threshold for a certain amount of time?  Example over 85% for longer than 5 min?

1 REPLY
Cisco Employee

Re: snmp alerts

You can do this with the Embedded Event Manager.  These applet policies should work with just about any modern IOS.  This will watch GigabitEthernet0/0 to see if its utilization goes over 85% and stays there for five minutes.  If it does, an EEM trap will be sent.

event manager environment q "

!

event manager applet watch-interface

event tag e1 interface name GigabitEthernet0/0 parameter txload entry-op ge entry-val 204 entry-type value exit-op le exit-val 204 exit-type value poll-interval 10

event tag e2 interface name GigabitEthernet0/0 parameter rxload entry-op ge entry-val 204 entry-type value exit-op le exit-val 204 exit-type value poll-interval 10

trigger

  correlate event e1 or event e2

action 01 cli command "enable"

action 02 cli command "config t"

action 03 cli command "event manager applet notify-interface"

action 04 cli command "event timer countdown time 300"

action 05 cli command "action 1.0 snmp-trap strdata $q Interface GigabitEthernet0/0 has been above 85% utilization for five minutes$q"

action 06 cli command "end"

!

event manager applet reset-int-watch

event tag e1 interface name GigabitEthernet0/0 parameter txload entry-op le entry-val 204 entry-type value exit-op ge exit-val 204 exit-type value poll-interval 10

event tag e2 interface name GigabitEthernet0/0 parameter rxload entry-op le entry-val 204 entry-type value exit-op ge exit-val 204 exit-type value poll-interval 10

trigger

  correlate event e1 or event e2

action 1.0 cli command "enable"

action 2.0 cli command "config t"

action 3.0 cli command "no event manager applet notify-interface"

action 4.0 cli command "end"

464
Views
0
Helpful
1
Replies
CreatePlease to create content