10-30-2018 02:00 AM - edited 03-08-2019 04:30 PM
Hi, I'm trying to shutdown an interface on a 3850,
Ive followed the guides on this link https://learningnetwork.cisco.com/docs/DOC-24145 but they don't appear to be working?
Am I missing something?
I want to shut down GigabitEthernet2/0/20 at 04:00 and bring it up at 21:50
I set the time on the switch.
This is the first method I tried.
event manager applet shut
event timer cron name shut cron-entry "0 4 * * *"
action 1 cli command "configure terminal"
action 2 cli command "interface GigabitEthernet2/0/20"
action 3 cli command "shutdown"
event manager applet noshut
event timer cron name noshut cron-entry "50 21 * * *"
action 1 cli command "configure terminal"
action 2 cli command "interface GigabitEthernet2/0/20"
action 3 cli command "no shutdown"
This didn't seem to work, so I tried method 2 on the document:
Creating the files on the flash but replacing the line interface FastEthernet 0/0 with interface GigabitEthernet2/0/20
Example:
configure terminal
interface FastEthernet 0/0
shutdown
kron policy-list noshut
cli tclsh noshut
kron occurrence noshut at 21:50 recurring
policy-list noshut
!
kron occurrence shut at 4:30 recurring
policy-list shut
!
kron policy-list noshut
cli tclsh noshut
!
kron policy-list shut
cli tclsh shut
The Schedule is set as follows:
Core3850#sh kron schedule
Kron Occurrence Schedule
noshut inactive, will run again in 0 days 12:53:54 at 21:50 on
shut inactive, will run again in 0 days 19:33:54 at 4 :30 on
This didn't work either can anyone help me debug why?
Many Thanks in advance!
Rob
Solved! Go to Solution.
10-30-2018 02:22 AM
Hello,
in the first script, you are missing the 'enable" commands, add those and check if it works:
event manager applet shut
event timer cron name shut cron-entry "0 4 * * *"
action 1.0 cli command "enable"
action 1.1 cli command "configure terminal"
action 2 cli command "interface GigabitEthernet2/0/20"
action 3 cli command "shutdown"
event manager applet noshut
event timer cron name noshut cron-entry "50 21 * * *"
action 1.0 cli command "enable"
action 1.1 cli command "configure terminal"
action 2 cli command "interface GigabitEthernet2/0/20"
action 3 cli command "no shutdown"
10-30-2018 02:22 AM
Hello,
in the first script, you are missing the 'enable" commands, add those and check if it works:
event manager applet shut
event timer cron name shut cron-entry "0 4 * * *"
action 1.0 cli command "enable"
action 1.1 cli command "configure terminal"
action 2 cli command "interface GigabitEthernet2/0/20"
action 3 cli command "shutdown"
event manager applet noshut
event timer cron name noshut cron-entry "50 21 * * *"
action 1.0 cli command "enable"
action 1.1 cli command "configure terminal"
action 2 cli command "interface GigabitEthernet2/0/20"
action 3 cli command "no shutdown"
10-30-2018 02:37 AM
Thank you Georg,
The enable command would prompt for a password, would this need to be entered into the script too?
Cheers
Rob
10-30-2018 02:39 AM
Hello,
no, you don't need to add the password to the script...
10-30-2018 09:55 AM
Hello
The below would be applicable weekly Monday-friday
event manager applet shut
event timer cron cron-entry "0 4 * * 1-5"
action 1.0 cli command "enable"
action 1.1 cli command "conf t"
action 1.2 cli command "GigabitEthernet2/0/2"
action 1.3 cli command "shut"
action 1.4 cli command "end"
event manager applet noshut
event timer cron cron-entry "50 21 * * 1-5"
action 2.0 cli command "enable"
action 2.1 cli command "conf t"
action 2.2 cli command "GigabitEthernet2/0/2"
action 2.3 cli command "no shut"
action 2.4 cli command "end"
10-31-2018 01:34 AM
Thank you for those reply's.
I can confirm adding enable to the script has got it working for me. Should be obvious really but I missed it.
Thanks !
Rob
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