08-06-2012 10:56 AM
Good day -
I want to check an interface every minute for line status. If line status is down, then wait 30 minutes and reload. If on reload, still down, reload every 30 minutes and check status of track 1 until it comes up. Here is what I have.track 1 interface Cellular0/0/0 line-protocol
!
event manager applet watch_4_interface_changes event timer cron name EVERY_MINUTE_CHECK cron-entry "0-59/1 * * * *" action 1.0 cli command "enable" action 2.0 cli command "event manager run track_interface" ! event manager applet track_interface event track 1 state down action 1.0 cli command "enable" action 2.0 cli command "event manager run tracked_action" ! event manager applet tracked_action event none maxrun 1860 action 1.0 cli command "enable" action 2.0 cli command "reload in 30" pattern "yes" action 2.5 cli command "n" pattern "confirm" action 3.0 cli command "y" action 4.0 cli command ""
!
I have looked at it too long and am lost in the weeds. Anyone have some ideas?
Solved! Go to Solution.
08-06-2012 11:28 AM
Why not simply track the interface state. IF it goes down, start the 30 minute timer. If it is allowed to hit 0, then reload. If not, delete the applet. For example:
event manager applet track_interface_down
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "event manager applet reload_count"
action 4.0 cli command "event timer countdown time 1800"
action 5.0 cli command "action 1.0 reload"
action 6.0 cli command "end"
!
event manager applet track_interface_up
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "no event manager applet reload_count"
action 4.0 cli command "end"
!
event manager applet on_reload
event syslog pattern "SYS-5-RESTART"
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "event manager applet reload_count"
action 4.0 cli command "event timer countdown 1800"
action 5.0 cli command "action 1.0 reload"
action 6.0 cli command "end"
08-06-2012 11:28 AM
Why not simply track the interface state. IF it goes down, start the 30 minute timer. If it is allowed to hit 0, then reload. If not, delete the applet. For example:
event manager applet track_interface_down
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "event manager applet reload_count"
action 4.0 cli command "event timer countdown time 1800"
action 5.0 cli command "action 1.0 reload"
action 6.0 cli command "end"
!
event manager applet track_interface_up
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "no event manager applet reload_count"
action 4.0 cli command "end"
!
event manager applet on_reload
event syslog pattern "SYS-5-RESTART"
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "event manager applet reload_count"
action 4.0 cli command "event timer countdown 1800"
action 5.0 cli command "action 1.0 reload"
action 6.0 cli command "end"
08-06-2012 01:14 PM
Thank you Joseph - That worked perfectly for what we needed.
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