cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4427
Views
5
Helpful
2
Replies

EEM script Shutdown Interface at a certain time

david_calissano
Level 1
Level 1

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 

 

 

1 Accepted Solution

Accepted Solutions

balaji.bandi
Hall of Fame
Hall of Fame

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

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

View solution in original post

2 Replies 2

balaji.bandi
Hall of Fame
Hall of Fame

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

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

david_calissano
Level 1
Level 1

Hello, 

Thanks for your answer . 

It worked perfectly . 

Also thanks for https://crontab.guru/ , great tool . 

 

Have a nice day 

 

David