07-20-2016 06:09 AM
Dears,
I am new in EEM scripting so appreciate your help
I have a business need that require to shut down interface based on other interface in other routes
for example I we have R1 and R2 , if the interface fa 0/0 in R1 goes down generate a snmp trap from R1 directed to R2 and therefore R2 will un shutdown its loopback interface Lo0 accordingly.
I made this sample script at R1 to send snmp trap one fa 0/0 goes down
event manager applet fa0/0down
event syslog pattern "Interface FastEthernet0/0, changed state to down"
action 1.0 snmp-trap strdata "SNMP_HI_THERE_FA0/0_IS_DOWN"
and tried to match this trap in R2 by event manger with action to unshut the loop0 with no luck
07-21-2016 12:10 AM
How is R2 configured with respect to SNMP and EEM?
07-21-2016 01:00 AM
hello Joe,
I made R2 act as snmp manager to recieve R1 traps but I cant match this custom trap from R1
07-21-2016 01:38 AM
You need to post your SNMP and EEM config for me to be able to help you.
07-21-2016 06:38 AM
Hello Joe,
R2
snmp-server group cisco v3 auth match exact
snmp-server group cisco v3 priv match exact read testview write testview
snmp-server view testview iso included
snmp-server manager session-timeout 1000
snmp-server manager
event manager applet unshut
event snmp
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "int loo 0"
action 4.0 cli command "no shut"
I can see snmp traps received at R2 from R1 but how I can match "SNMP_HI_THERE_FA0/0_IS_DOWN"in the R2 eem
07-21-2016 09:10 AM
07-24-2016 05:15 AM
thanks Joe it is working fine but can we send words like I used above instead of numbers in your example
07-24-2016 05:48 AM
It's much easier and more reliable to match on numbers. Why do you want to match on text?
07-24-2016 07:39 AM
no specific words , may be interface X is down
-If I use action 1.0 snmp-trap strdata can we match it in the other side with the same way like your example
07-24-2016 08:01 AM
There's no advantage gained from that approach. Just choose numbers to stand for those events. For example, interface X being down is 1001 whereas interface Y being down is 1002. This will be easier to match and more reliable.
One would still be able to determine the purpose of the applet from the actions within it.
07-24-2016 08:29 AM
thanks joe for your great support , I appreciate that
can I match other traps from cisco routers (snmp manger) that generated from 3rd party devices (snmp clients) with the same way.
07-24-2016 09:56 AM
Yes, this same technique works with all kinds of traps including those from third-party devices.
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