07-18-2011 07:20 AM - edited 03-07-2019 01:15 AM
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!
Solved! Go to Solution.
07-19-2011 07:27 AM
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.
07-19-2011 01:13 AM
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.
07-19-2011 07:08 AM
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!
07-19-2011 07:27 AM
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.
07-19-2011 12:20 PM
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!
07-20-2011 02:11 AM
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?
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