cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
674
Views
5
Helpful
8
Replies
Highlighted
Beginner

EEM Script

Hi,

 

We have an eem script to monitor the uplink interface between two switches. When the uplink interface is up first switch will be  active and second switch will be backup, vice versa.

When only the uplink interface goes down script is working perfectly. But the problem is when the complete power goes off in second switch location, first switch site is also going down as per the script. (script is to shutdown the ports of first switch, to overcome loop )

Now my requirement is i want these script to work only when uplink interface goes down but not when the complete switch goes down.

 

@Joe Clarke....Appreciate you assistance in above.

 

Regards,

Faizan.

 

 

Everyone's tags (1)
8 REPLIES 8
Highlighted
Hall of Fame Cisco Employee

Re: EEM Script

You did not post your current script.

Highlighted
Beginner

Re: EEM Script

Please find below, 

 

First Site:

 

event manager applet KOCM_DOWN
event syslog pattern "%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1/1, changed state to down"
action 1.0 cli command "enable"
action 1.5 cli command "conf t"
action 2.0 cli command "int range gi1/0/1-8"
action 2.5 cli command "shut"
action 3.0 cli command "exit"
event manager applet KOCM_UP
event syslog pattern "%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet1/1/1, changed state to up"
 action 1.0 cli command "enable"
action 1.5 cli command "conf t"
action 2.0 cli command "int range gi1/0/1-8"
action 2.5 cli command "no shut"
action 3.0 cli command "exit"

 

Second Site: 

 

event manager applet KOCM_UP
event syslog pattern "%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/25, changed state to up"
action 1.0 cli command "enable"
action 1.5 cli command "conf t"
action 2.0 cli command "int range gi0/1-8"
action 2.5 cli command "shut"
event manager applet KOCM_DOWN
event syslog pattern "%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/25, changed state to down"
action 1.0 cli command "enable"
action 1.5 cli command "conf t"
action 2.0 cli command "int range gi0/1-8"
action 2.5 cli command "no shut"

Highlighted
Hall of Fame Cisco Employee

Re: EEM Script

I don't follow your logic.  I don't see how the sites are aware of each other if you're just monitoring local syslog messages.  Are they directly connected to each other via gi1/1/1 and gi0/25 and interface status is passed on this circuit?

Highlighted
Beginner

Re: EEM Script

Both sites are connected via dark fiber.

Highlighted
Hall of Fame Cisco Employee

Re: EEM Script

I'm not sure how'd you'd accomplish what you want.  There's no way to distinguish between a link going down due to, say, a fiber cut vs. the site's power going out.  You'd have to be able to determine overall site reachability via another way.  Maybe you know how to do this because you asked about IP SLA.  But without knowing how you can verify site reachability, I can't offer any other advice.

Highlighted
Beginner

Re: EEM Script

Thanks for the support Joseph.

I have laptop connected over the second site for which i will use sla to track.

And follow boolean AND to track interface and sla status. 

Much appreciated.

Highlighted
Beginner

Re: EEM Script

Or, you can help me out to track two events in a single applet.

IP SLA and interface state. I want to have a script to work only when these two events changes at same time.

Highlighted
Hall of Fame Cisco Employee

Re: EEM Script

You can combine multiple elements in a single track using a boolean list.  If track 1 is looking at interface status, and track 2 is looking at IP SLA, then:

track 3 list boolean or

 object 1

 object 2

 

This will require both tracks 1 and 2 to be down for 3 to go down (which I think is what you want).  You can then monitor object 3 via EEM.

Content for Community-Ad
This widget could not be displayed.