11-18-2021 12:52 AM - edited 11-18-2021 01:03 AM
Hello everyone,
i want to shut - no shut an int (e.g. g0/0)at night , like at 00.00 using an EEM script .
The script will be used on a IOS XE based device .
Can you suggest a script or a reference to do that ?
Thanks in advance
Regards
Solved! Go to Solution.
11-18-2021 01:29 AM
here is shut @ 00:00 and no shut @5:00am
event manager applet shutdown_gigport
event timer cron cron-entry "0 0 * * *"
action 10 cli command "enable"
action 20 cli command "config t"
action 30 cli command "interface GigabitEthernet0/0"
action 40 cli command "shut"
action 50 cli command "end"
action 60 syslog msg "Interface GigabitEthernet0/0 has been shutdown"
event manager applet noshut_gigport
event timer cron cron-entry "0 5 * * *"
action 10 cli command "enable"
action 20 cli command "config t"
action 30 cli command "interface GigabitEthernet0/0"
action 40 cli command "no shut"
action 50 cli command "end"
action 60 syslog msg "Interface GigabitEthernet0/0 has been restored"
https://crontab.guru/ this give you what time you can do cron
11-18-2021 01:29 AM
here is shut @ 00:00 and no shut @5:00am
event manager applet shutdown_gigport
event timer cron cron-entry "0 0 * * *"
action 10 cli command "enable"
action 20 cli command "config t"
action 30 cli command "interface GigabitEthernet0/0"
action 40 cli command "shut"
action 50 cli command "end"
action 60 syslog msg "Interface GigabitEthernet0/0 has been shutdown"
event manager applet noshut_gigport
event timer cron cron-entry "0 5 * * *"
action 10 cli command "enable"
action 20 cli command "config t"
action 30 cli command "interface GigabitEthernet0/0"
action 40 cli command "no shut"
action 50 cli command "end"
action 60 syslog msg "Interface GigabitEthernet0/0 has been restored"
https://crontab.guru/ this give you what time you can do cron
11-18-2021 07:45 AM
Hello,
Thanks for your answer .
It worked perfectly .
Also thanks for https://crontab.guru/ , great tool .
Have a nice day
David
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