Hello Cisco Community
Can someone please provide some guidance on how to create an EEM Applet to monitor an SNMP OID? In particular I would like to know how to monitor ospf neighbor state.
The top level mib of ospfNbrState is .22.214.171.124.126.96.36.199.1.6. However, the OID isn't enough.
event manager applet snmptest
event snmp oid 188.8.131.52.184.108.40.206.1.6 poll_interval 2 get_type exact entry_type value entry_op ge entry_val 1 exit_comb or exit_time 300 maxrun 20
action syslog msg "snmp test"
The above action won't be generated when there is an ospf state change.
Can someone please provide some guidance?
Solved! Go to Solution.
I answered this for you on a previous thread:
You're still trying to use an OID without an instance and a get-type of exact. That will not work. Either switch to a get-type of next or add the specific instance of this OID.
Can you explain what you mean when you say..
For one, you cannot use a leading '.'. Two, you have not put an instance here
And can you give me an example of an instance?
Do an SNMP Walk of the ospfNbrTable (220.127.116.11.18.104.22.168) and you will see the OIDs with the instances. You must use one of those instances to use a get-type of exact.
I changed the even applet as follows:
event manager applet test1 trap
event snmp oid 22.214.171.124.126.96.36.199.1.6 get-type next entry-op eq entry-val 1 poll-interval 2
action 1.0 syslog msg "ospf stat message"
I then shut down an interface to test the eem but it didn't work.
Then you have more than one peer/network and the one that went down was not the first instance. You will then need to find the exact instance you want.
Thanks again for responding. You're correct, I have one other ospf neighbor. However, can you tell me how to establish the instances that current?
You need to do that SNMP Walk to see what instances you have. The instances should correspond to the IP address of the peer.