Shut and No Shut Router Interface at Midnight

Answered Question
Apr 19th, 2010

I have a need to shutdown, wait 30 seconds and issue a no shutdown on a router interface daily at 12am. Is there something that I can automate using Cisco IOS. Please keep in mind that I have no programing or scripting experience. Thanks in advance.

conf t

!

interface s6/1/1

shutdown (wait 30 seconds)

no shutdown

!

Correct Answer by Lei Tian about 6 years 10 months ago

Hi,

If your IOS support, you can use EEM to do that.

An example of shutdown interface fa0/0 @ 12:00 and bring it back @ 12:01

event manager applet TEST
event timer cron name TEST cron-entry "0 12 * * *"
action 1 cli command "enable"
action 2 cli command "configure terminal"
action 3 cli command "interface fa0/0"
action 4 cli command "shutdown"
event manager applet TEST1
event timer cron name TEST1 cron-entry "1 12 * * *"
action 1 cli command "enable"
action 2 cli command "configure terminal"
action 3 cli command "interface fa0/0"
action 4 cli command "no shutdown"

HTH,

Lei Tian

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
Loading.
Correct Answer
Lei Tian Tue, 04/20/2010 - 09:13

Hi,

If your IOS support, you can use EEM to do that.

An example of shutdown interface fa0/0 @ 12:00 and bring it back @ 12:01

event manager applet TEST
event timer cron name TEST cron-entry "0 12 * * *"
action 1 cli command "enable"
action 2 cli command "configure terminal"
action 3 cli command "interface fa0/0"
action 4 cli command "shutdown"
event manager applet TEST1
event timer cron name TEST1 cron-entry "1 12 * * *"
action 1 cli command "enable"
action 2 cli command "configure terminal"
action 3 cli command "interface fa0/0"
action 4 cli command "no shutdown"

HTH,

Lei Tian

davidhuynh5 Tue, 04/20/2010 - 14:28

Lei,

Thank you. That was very helpful. I have two questions:

1. I'm trying to interpet this line "event timer cron name TEST cron-entry "0 12 * * *" but I don't understand how you got it?

2. Is there a "Dummies Guide to EEM" that you can point me in the right direction? I want to learn how to fish.

Lei Tian Tue, 04/20/2010 - 16:29

Hi,

Cron is the UNIX scheduler, just search on google you will find the syntax and many examples.

For EEM configuration examples, you can search on cisco.com .  Here is one of the configuration example:

    

     http://www.cisco.com/en/US/prod/collateral/iosswrel/ps6537/ps6555/ps6815/config_guide_eem_configuration_for_cisco_integrated_services_router_platforms.html

HTH,

Lei Tian

muhsinamol Wed, 03/09/2016 - 11:32

Dear Lei,

I need your support for this below line  

 event timer cron name TEST1 cron-entry "1 12 * * *"

I need to shutdown my interface  APRIL 01-2016  10.1 AM  how we can write the script 

Regards

Raf

Actions

This Discussion