06-15-2023 12:15 PM
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:
Solved! Go to Solution.
06-15-2023 02:06 PM
Solved
event manager environment _syslog_pattern1 .*(track 6 state Track_Up)
event manager environment _syslog_pattern2 .*(track 6 state Track_Down)
06-15-2023 02:06 PM
Solved
event manager environment _syslog_pattern1 .*(track 6 state Track_Up)
event manager environment _syslog_pattern2 .*(track 6 state Track_Down)
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