05-23-2018 07:09 AM - edited 03-05-2019 10:29 AM
I am trying to figure out a script or SLA configuration which applies the Shut/No Shut command if an interface goes down on a cisco switch, 3750
Can anyone guide me on this issue ?
Below is what I have for the SLA Config, however, the interface is an access vlan and I do not have an IP as far as tracking by IP. Is it possible to track by Status/Protocol state ?
track 1 ip sla 10 reachability
delay down 10 up 10
!
ip sla 10
icmp-echo ?????? source-interface Fastethernet 1/0/12
frequency 30
ip sla schedule 10 life forever start-time now
!
event manager applet Link-Down
event track 1 state down
action 1.0 syslog msg "Reply timed out; Link is down"
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "interface Fastethernet 1/0/12"
action 1.4 cli command "shut"
action 1.5 cli command "end"
action 1.6 syslog msg "interface Fastethernet 1/0/12 shutdown"
event manager applet Link-Up
event track 1 state up
action 1.0 syslog msg "Ping received; Link is up"
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "interface Fastethernet 1/0/12"
action 1.4 cli command "no shut"
action 1.5 cli command "end"
action 1.6 syslog msg "interface Fastethernet 1/0/12 up"
Solved! Go to Solution.
05-23-2018 07:57 AM - edited 05-23-2018 07:58 AM
Hi,
Below is the configuration that can be used:
track 1 interface GigabitEthernet1/0/14 line-protocol
!
event manager applet TEST authorization bypass
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "config terminal"
action 3.0 cli command "int GigabitEthernet1/0/14 "
action 4.0 cli command "shutdown"
!
But then how do you bring it back up? There has to be a condition set on the switch that would trigger the EEM to run the script to "no shut" the interface. You can use something in the syslog to trigger that. But I am not sure what exactly you are trying to solve with this script.
05-23-2018 08:05 AM
Then you would just need to add this line in the script I provided:
action 5.0 cli command "no shutdown"
05-23-2018 08:11 AM
You can test both.
05-23-2018 07:28 AM
Hi,
Is it possible to track by Status/Protocol state ? Yes, it is. As long as the feature is supported with the code you are using.
Did you try the script and is it not working?
05-23-2018 07:33 AM - edited 05-23-2018 07:36 AM
This script needs an IP address to track ping, however, ping is disabled and I just want to track the state/protocol and reset.
icmp-echo ?????? source-interface Fastethernet 1/0/12
05-23-2018 07:57 AM - edited 05-23-2018 07:58 AM
Hi,
Below is the configuration that can be used:
track 1 interface GigabitEthernet1/0/14 line-protocol
!
event manager applet TEST authorization bypass
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "config terminal"
action 3.0 cli command "int GigabitEthernet1/0/14 "
action 4.0 cli command "shutdown"
!
But then how do you bring it back up? There has to be a condition set on the switch that would trigger the EEM to run the script to "no shut" the interface. You can use something in the syslog to trigger that. But I am not sure what exactly you are trying to solve with this script.
05-23-2018 07:59 AM
We have cell phone extenders that periodically go down. Resetting the interface fixes the issue.
I just wanted a shut/no shut process if the state is down.
05-23-2018 08:05 AM
Then you would just need to add this line in the script I provided:
action 5.0 cli command "no shutdown"
05-23-2018 08:09 AM
I think this might work ?
track 1 interface Fastethernet 1/0/12 line-protocol
!
event manager applet Link-Down
event track 1 state down
action 1.0 syslog msg "Interface went down"
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "interface Fastethernet 1/0/12"
action 1.4 cli command "shut"
action 1.5 syslog msg "interface Fastethernet 1/0/12 shutdown"
action 1.6 cli command "no shut"
action 1.7 cli command "end"
action 1.8 syslog msg "interface Fastethernet 1/0/12 up"
!
05-23-2018 08:11 AM
You can test both.
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