03-12-2021 02:47 AM
hi, please tell me two points:
1. I want to exclude a word in eem via regexp, for example there is a line:
sh run | i hostname hostname test-router
i need to select everything except "hostname" and "router"
doing so:
action 112 regexp "(!?hostname|-router)" "$_cli_result" name
but it doesn't work because eem swears at the "?" and it is removed
2. how to make a delay in EEM, let's say it should trigger on "event track 10 state down" I just want him to wait 3 minutes after he fixes it and then run all the necessary commands
Solved! Go to Solution.
11-25-2022 11:33 AM
Change action 0030 to this line and variable $octet3and4 will contain the value of the last two octets. action 0040 is not needed.
action 0030 regexp "([0-9]+\.[0-9]+\.([0-9]+\.[0-9]+))" $_cli_result match WANIP octet3and4
03-13-2021 03:42 AM
Hello,
not sure if the second part of your question has already been answered:
--> 2. how to make a delay in EEM, let's say it should trigger on "event track 10 state down" I just want him to wait 3 minutes after he fixes it and then run all the necessary commands
The line:
action x wait 180
would delay the execution of the script, depending on where that line is placed in the script.
03-14-2021 10:35 PM
thought about the proposed a little, apparently the best option would be the following
if the line "% TRACK-6-STATE: 10 ip sla 10 reachability Up -> Down" appears in syslog, then turn on the countdown, if the line "% TRACK-6-STATE: 10 ip sla 10 reachability does not appear in syslog in 5 minutes Down-> Up "then further check the mac address on the port and send the letter
though I'm still thinking how to portray it
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: