12-04-2012 01:48 PM
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 .1.3.6.1.2.1.14.10.1.6. However, the OID isn't enough.
For example
event manager applet snmptest
event snmp oid 1.3.6.1.2.1.14.10.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?
Cheers
Carlton
Solved! Go to Solution.
12-04-2012 04:05 PM
Ah, so this is a dynamic neighbor. In that case, you might be better matching on syslog messages versus polling.
12-04-2012 01:53 PM
I think the problem is the actual OID for ospfNbrState for the router.... but I'm not sure
12-04-2012 02:03 PM
I answered this for you on a previous thread:
https://supportforums.cisco.com/thread/2185121?tstart=0
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.
12-04-2012 02:16 PM
Hi Joseph,
Going to read the previous answer in more detail and try it again now. Thanks for responding.
12-04-2012 02:20 PM
Joseph,
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?
Cheers
12-04-2012 02:25 PM
Do an SNMP Walk of the ospfNbrTable (1.3.6.1.2.1.14.10) and you will see the OIDs with the instances. You must use one of those instances to use a get-type of exact.
12-04-2012 02:31 PM
Joseph,
I changed the even applet as follows:
event manager applet test1 trap
event snmp oid 1.3.6.1.2.1.14.10.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.
12-04-2012 02:34 PM
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.
12-04-2012 02:37 PM
Joseph,
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?
Cheers
12-04-2012 02:40 PM
You need to do that SNMP Walk to see what instances you have. The instances should correspond to the IP address of the peer.
12-04-2012 02:44 PM
12-04-2012 02:49 PM
That's up to you. You see your two peers. Which one do you want to trigger on? Use that instance in your applet.
12-04-2012 02:53 PM
If I wanted to trigger on the first peer 10.0.0.13, then would my oid be 1.3.6.1.2.1.14.10.1.6.10.0.0.13.0 ?
Cheers
12-04-2012 02:59 PM
Yes.
12-04-2012 03:02 PM
OK, going to try that now....
Cheers
Carlton
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