cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
344
Views
0
Helpful
1
Replies

EEM - ASR9K - EEM Scritp of Multiple line of event manager environment

Hans Martinez
Level 1
Level 1

Hi community, I'm working on implementing EEM on a Cisco ASR9K; I need to be able to determine by syslog when a track changes UP/DOWN status. When I add the lines of "event manager environment" the system only leaves the last one of "environment". I would like to know how I can apply the script so that I can have both "Down" and "UP" options.

Below is the script that I am applying.

event manager environment _syslog_pattern .*(track 6 state Track_Up)
event manager environment _syslog_pattern .*(track 6 state Track_Down)
event manager directory user policy harddisk:/eem/
event manager policy trk6up.tcl username eem_user type user
event manager policy trk6down.tcl username eem_user type user

Then the result after applying the commit, in a show run:

RP/0/RSP0/CPU0:PE#
RP/0/RSP0/CPU0:PE#sh run | i event manager
Thu Jun 15 12:33:52.407 UTC
Building configuration...
event manager environment _syslog_pattern .*(track 6 state Track_Down)
event manager directory user policy harddisk:/eem/
event manager policy trk6up.tcl username eem_user persist-time 3600 type user
event manager policy trk6down.tcl username eem_user persist-time 3600 type user
RP/0/RSP0/CPU0:PE#

When running separately the EEM the scripts work without problem; The only drawback is how to apply both lines of "environmet". If someone can help me, I will be very grateful.

Here the tcls:

1 Accepted Solution

Accepted Solutions

Hans Martinez
Level 1
Level 1

Solved
event manager environment _syslog_pattern1 .*(track 6 state Track_Up)
event manager environment _syslog_pattern2 .*(track 6 state Track_Down)

View solution in original post

1 Reply 1

Hans Martinez
Level 1
Level 1

Solved
event manager environment _syslog_pattern1 .*(track 6 state Track_Up)
event manager environment _syslog_pattern2 .*(track 6 state Track_Down)