cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2708
Views
5
Helpful
12
Replies

Help in designing a kron to shutdown an interface

jomo frank
Level 1
Level 1

Hello Expert

 

I tried run the following Kron but I am unsuccessful . 

 

kron policy-list restart-interface
cli enable
cli config t
cli int FastEthernet0/1
cli shutdown

 

kron occurrence restart-interface at 10:45 recurring

 

i humbly request some guidance to run same successfully.

Regards

2 Accepted Solutions

Accepted Solutions

kron policy-list restart-interface
cli enable
cli config t
cli int FastEthernet0/1
cli shutdown

exit

 

below runs at 10:45

kron occurrence restart-interface at 10:45 recurring

policy-list restart-interface

 

 

BB

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

How to Ask The Cisco Community for Help

View solution in original post

At 10:45 it runs every day

 

here is a good explanation :

 

https://crontab.guru/#45_10_*_*_*

 

every 2 hours as below :

 

https://crontab.guru/every-2-hours

 

BB

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

How to Ask The Cisco Community for Help

View solution in original post

12 Replies 12

balaji.bandi
Hall of Fame
Hall of Fame
kron occurrence restart-interface at 10:45 recurring

not sure we understand this, Do you want @10:45am shutdown and no shutdown interface fas 0/1 ?

 

BB

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

How to Ask The Cisco Community for Help

hello Balaji,

 

The restart-inferface is just the name I should have use a different name.

I just need to shutdown  the interface at 10.45 am this exercise is just a test .

 

Regards

I

 

kron policy-list restart-interface
cli enable
cli config t
cli int FastEthernet0/1
cli shutdown

exit

 

below runs at 10:45

kron occurrence restart-interface at 10:45 recurring

policy-list restart-interface

 

 

BB

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

How to Ask The Cisco Community for Help

Good Day,

 

I tried as per your suggestion but nothing happened 

Unsure what a am doing wrong?

 

 

kron occurrence restart-interface at 10:45 recurring
policy-list restart-interface
!
kron policy-list restart-interface
cli enable
cli config t
cli int FastEthernet0/1
cli shutdown

 

Thank you

 

Do you still have an issue ? kron runs @104am  

BB

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

How to Ask The Cisco Community for Help

Hello Balaji,

 

The kron did not run the interface is still up.

 

Regards

Looks there is Limitation in kron, its not excuting what expected, instead you can use EEM as below :

 


event manager applet shut-interface
event timer cron name shutdown-interface-schedule cron-entry "45 10 * * *"
action 01.0 cli command "enable"
action 02.0 cli command "config t"
action 03.0 cli command "interface FastEthernet0/1"
action 04.0 cli command "shutdown"
action 05.0 syslog msg "Interfeace FastEthernet0/1 has been shutdown by EEM applet"
end

 

Tested and working as below in my LAB (just used time 16:46)

 

 

image.png

BB

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

How to Ask The Cisco Community for Help

Hello 

 

I will try the new method but I am trying to understand the event time line

 

event timer cron name shutdown-interface-schedule cron-entry "45 10 * * *"

 

for example if you need an event to happen ever 60 minutes (1 hr) how do amend the event timer line to do so.

 

Regards

 

Hello Expert,

 

The event manager work perfect.

 

 I am trying to understand the event time line

 

event timer cron name shutdown-interface-schedule cron-entry "45 10 * * *"

 

Could you please modify the event manager to restart the interface very 120 minutes (2 hrs).

 

Regards

At 10:45 it runs every day

 

here is a good explanation :

 

https://crontab.guru/#45_10_*_*_*

 

every 2 hours as below :

 

https://crontab.guru/every-2-hours

 

BB

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

How to Ask The Cisco Community for Help

Hello Bal,

 

Thank you for all the assistance.

 

Regards

dude i had to sign in just to thumbs up your post if I could give you 100 thumbs up I would thanks a million!

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: