cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1675
Views
5
Helpful
9
Replies

I need event manager that do: when log router show "isla 10 reachability Down->Up"

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!!!

2 Accepted Solutions

Accepted Solutions

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

HTH, John *** Please rate all useful posts ***

View solution in original post

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

View solution in original post

9 Replies 9

John Blakley
VIP Alumni
VIP Alumni

What are you trying to do?

HTH, John *** Please rate all useful posts ***

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

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

Thanks Itrie to do this!

That you for your help!!!

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

HTH, John *** Please rate all useful posts ***

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

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

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

HTH, John *** Please rate all useful posts ***
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: