I've been playing with EEM to turn a LED on/off based on the RSSI of a 3G radio. Currently I'm polling the snmp value for the radios RSSI and if it's worst then -91dBm then I toggle DTR off and turn off the LED, is the RSSI is better then -91dBm then I toggle DTR on and turn the LED on. The LED is connected to pins 2 and 4 of the aux port. Here is the EEM config:
event manager applet RSSI_Good
description SNMP Get RSSI to trigger
event snmp oid 1.3.6.1.4.1.9.9.661.1.3.4.1.1.1.14 get-type exact entry-op gt entry-val "-91" poll-interval 10
action 1.0 syslog msg "RSSI GOOD"
action 2.0 cli command "enable"
action 2.1 cli command "conf t"
action 2.2 cli command "line aux 0"
action 2.3 cli command "modem printer"
event manager applet RSSI_Bad
description SNMP Get RSSI to trigger
event snmp oid 1.3.6.1.4.1.9.9.661.1.3.4.1.1.1.14 get-type exact entry-op lt entry-val "-91" poll-interval 10
action 1.0 syslog msg "RSSI Bad"
action 2.0 cli command "enable"
action 2.1 cli command "conf t"
action 2.2 cli command "line aux 0"
action 2.3 cli command "modem host"
So this all works but I think it can be optimised not to run the commands every 10 seconds. What I would like to do is only trigger the LED change on rising or falling past the -91dBm value.
Does anyone have any ideas of a better way of doing the EEM config?