04-28-2012 02:22 AM - edited 03-07-2019 06:23 AM
I Trie this, but is not work!
event manager applet RETORNA-BGP-SEG-SEX
event timer cron cron-entry "*/20 18-23 * * 1-5" ! Not work because i can use only one event
event syslog occurs 1 pattern "isla 10 reachability Down->Up"
action 1.0 syslog msg "TESTA-CRON"
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "int lo 20"
action 1.4 cli command "shutdown"
I think need user if, but I don´t know how configure this with if!
Thanks!!!
Solved! Go to Solution.
04-28-2012 06:38 AM
From your cron entry it looks like you're checking it every 20 minutes between those hours. Does it shut down at all? What event are you using to bring it back up? (I'm assuming when you see it go from up to down.)
Dan,
I admit I've never used the track command in an eem applet. I'm going to play around with that today. I've always created 2 applets (one for up and one for down) and always thought there had to be a better way.
John
04-28-2012 07:20 AM
Just when I was reading your reply John, I realized that maybe the event track is not the best option in this case.
If Silvio wants to run the commands :
a) if the track changes to UP between 18 and 23, then matching the logg and also the cron
b) if the track is UP between 18 and 23 , then event track will do it.
It's just the wording.
Dan
04-28-2012 05:44 AM
What are you trying to do?
04-28-2012 06:20 AM
When log router show isla 10 reachability Down->Up, then it put int lo20 in shutdown, but only every day at 06 pm to 11 pm!
Thanks
04-28-2012 06:38 AM
Hi Silvio,
Because in order to take action you must meet 2 conditions , you must use "corellate". Also instead of matching the log from track , you can use "event track"
event manager applet name
event tag track track 1 state up
event tag timer timer cron cron-entry "* 18-23 * * *"
trigger
correlate event track and event timer
action 1.0 syslog msg "TESTA-CRON"
action 1.1 cli command "enable"
action 1.2 cli command "conf t"
action 1.3 cli command "int lo 20"
action 1.4 cli command "shutdown"
Also if you have AAA configured, you will need to add : event manager session cli username user
Dan
04-28-2012 03:39 PM
Thanks Itrie to do this!
05-13-2012 12:11 PM
That you for your help!!!
04-28-2012 06:38 AM
From your cron entry it looks like you're checking it every 20 minutes between those hours. Does it shut down at all? What event are you using to bring it back up? (I'm assuming when you see it go from up to down.)
Dan,
I admit I've never used the track command in an eem applet. I'm going to play around with that today. I've always created 2 applets (one for up and one for down) and always thought there had to be a better way.
John
04-28-2012 07:20 AM
Just when I was reading your reply John, I realized that maybe the event track is not the best option in this case.
If Silvio wants to run the commands :
a) if the track changes to UP between 18 and 23, then matching the logg and also the cron
b) if the track is UP between 18 and 23 , then event track will do it.
It's just the wording.
Dan
04-28-2012 03:48 PM
Thats corret, it is only example!
In this case option b it corret!
But if i use a condition for exemple using a condition if or while, its possible. If yes please post a example!
Thanks
04-28-2012 05:28 PM
Silvio,
I don't have an IOS that allows me to run both syslog and timers under the event clause. It's either one or the other. Double check that you don't have one overwriting the other.
"sh run | b event"
If you only have the event timer, then that's probably why your event isn't firing because it doesn't have anything to look at which is where Dan's suggestion of tracking would come in. If you have the syslog pattern, then it should be working. You could try to change your syslog pattern match like:
event syslog occurs 1 pattern "isla 10 reachability Down.*Up
Edit: I didn't read your original post close enough and noticed that you had already stated that you couldn't have two events. My apologies.
HTH,
John
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: