Bug in EEM SNMP event detector
Jared Valentine found an interesting bug in the EEM’s SNMP event detector: if you’re triggering your EEM applet when the increment of an SNMP variable exceeds the threshold, you cannot re-arm the applet; the exit-type increment does not work. He fixed the problem with a somewhat more convoluted approach:
- The first EEM applet reads the SNMP variable, waits a second, does a second read and stores the difference in a counter.
- The second EEM applet is triggered based on the counter values.
I’m collecting tips like this one in the Embedded Event Manager (EEM) workshop. You can attend an online version of the workshop; we can also organize a dedicated event for your networking team.
Here’s the source code for the first applet (he had to execute CLI show commands to work around the CB-QoS MIB limitations).
event manager applet AATQoS
event timer watchdog time 1
action 100 cli command "enable"
action 110 cli command "show policy-map int dialer0"
action 200 info type snmp oid cbQosCMPrePolicyByte.368.13007857 →
get-type exact community public
action 210 set value1 "$_info_snmp_value"
action 220 wait 1
action 300 cli command "show policy-map int dialer0"
action 310 info type snmp oid cbQosCMPrePolicyByte.368.13007857 →
get-type exact community public
action 320 set value2 "$_info_snmp_value"
action 400 subtract $value2 $value1
action 410 counter name "qos_delta" op set value $_result
I tried the same config on both 4500 and 3560 switches. Same problem. :(