cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
7717
Views
0
Helpful
5
Replies

I need to do cron to runn eem

silviorodrigues
Level 1
Level 1

Daers good morning!

I need to do cron to runn eem script 07 AM to 08 PM and monday to friday ony!

Thanks for help-me!

1 Accepted Solution

Accepted Solutions

joe_quinn
Level 1
Level 1

Hi,

Try the EEM timer ED as follows:

event manager applet scheduledAction

event timer cron cron-entry "0 7,20 * * 1-5" name cronpolicy

(actions here)

Cheers,

Joe.

View solution in original post

5 Replies 5

The shortest config options would be to let it run everyday at the times you want.

the config would look like:

kron occurrence CSC-MORNING at 7:00 recurring

kron occurrence CSC-EVENING at 20:00 recurring

!

kron policy-list CSC-MORNING

cli event man run EEM-SCRIPT

kron policy-list CSC-EVENING

cli event man run EEM-SCRIPT

IF you need it only for Monday to Friday, you will have to create a policy-list with its own occurence twice a day Mon-Fri.

Hth.

Ruhann thanks, but its not work yet!

Maybe I can do something wrong, look:

Follow my eem configuration:

event manager applet BGP-CT1-EM-SHUTDOWN

event syslog occurs 1 pattern "1 ip sla 1 state Up->Down"

action 1.0 syslog msg "Devido a queda do link, BGP CT1 Sendo colocado em shutdown!!!"

action 1.1 cli command "enable"

action 1.2 cli command "conf t"

action 1.3 cli command "router bgp 28189"

action 1.4 cli command "neighbor 192.198.2.1 shutdown"

I put your commands, like you say-me and change only script name:

kron occurrence CSC-EVENING at 20:00 recurring

!

kron occurrence CSC-MORNING at 11:30 recurring

!

kron policy-list CSC-MORNING

cli event man run BGP-CT1-EM-SHUTDOWN

!

kron policy-list CSC-EVENING

cli event man run BGP-CT1-EM-SHUTDOWN

Now is 10:50 AM, show the scritp not should work, but it continues!

look show clock output

10:56:35.272 UTC Tue Jul 19 2011

Follow other command output about kron

br-sao-co1-rtd-me01#show kron schedule

Kron Occurrence Schedule

CSC-EVENING inactive, will run again in 0 days 08:52:21 at 20:00 on

CSC-MORNING inactive, will run again in 0 days 00:22:03 at 11:30 on

Thanks for now!

joe_quinn
Level 1
Level 1

Hi,

Try the EEM timer ED as follows:

event manager applet scheduledAction

event timer cron cron-entry "0 7,20 * * 1-5" name cronpolicy

(actions here)

Cheers,

Joe.

Good afternon!

The problem is: when I put this line

event timer cron cron-entry "0 7,20 * * 1-5" name cronpolicy

it delete the line

event syslog occurs 1 pattern "1 ip sla 1 state Up->Down"

and scritp not work more!

Thanks!

Ah ok, I thought you wanted to trigger an eem policy on a schedule at particular times.

event syslog occurs 1 pattern "1 ip sla 1 state Up->Down"  will trigger the policy to run when a syslog message is sent from the device with the pattern "1 ip sla 1 state Up->Down" included in the text.

What exactly is the requirement for the policy you are trying to write?

Review Cisco Networking for a $25 gift card