04-03-2019 03:43 PM
Hi All
I have a reoccuring issue in that the UCSE IP address on the management port goes down for some reason and my SNMP traps fail.
What I would like to do, is use a TCL script or something to ping this ip address (192.168.0.8) and if it fails, execute a shut/no shut on interface UCS2/0
TCL, Network ManagementDoing this 3-4 times per day would be useful
Does anyone have a sample configuration?
Thank you!
04-03-2019 05:33 PM
I believe you can achieve this with EEM Script
here is example (not sure what is the code of your IOS)
track 1 ip sla 10 reachability
delay down 10 up 10
ip sla 10
icmp-echo 192.168.0.8
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 2.0 cli command "enable"
action 3.0 cli command "conf t"
action 4.0 cli command "interface e0/0" <-- change to your interface
action 5.0 cli command "shut"
action 6.0 cli command "no shut"
action 7.0 cli command "end"
action 8.0 syslog msg "Interface Ethernet 0/0 shutdown"
!
Manually test and advise.
04-03-2019 05:54 PM
Wow thank you for the fast reply!
IP SLA , nice solution. I will test adn advise
04-03-2019 06:01 PM
Ive modified the frequency timer to every 30minutes, will test and advise. May take some days as it doesnt always fail.
04-03-2019 06:05 PM
sure, if you have console access, you can manually shutdown and see if that script works
04-03-2019 07:09 PM - edited 04-03-2019 07:12 PM
It works :)
Is there any issue in terms of load by having a frequency of say every 1 minute? Its a Cisco 3945
Do these scripts have the ability to do HTTP POST? It would be VERY useful to use some script to HTTP post an ON command to webserver when things go up or down based on PING response etc.
04-04-2019 01:38 AM - edited 04-04-2019 01:39 AM
It works :)
Good to hear all work as expected.
ISR 3945 is good box, it should be ok, until you have many EEM Running in the Kit.
Do these scripts have the ability to do HTTP POST? It would be VERY useful to use some script to HTTP post an ON command to webserver when things go up or down based on PING response etc.
If i understand correctly you looking to send some output post to http server.
if this correct, you can send email (if you have setup smtp relay setup on your smtp service correctly)
you can also redirect the logs to syslog. and make own reports (out of the box)
make sense ? if this resolved mark as resolved so it will be useful for other community users.
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