09-22-2014 06:52 AM
Hi I'm new to EEM so please bare with me. I'm trying to get our CUBE to write to syslog when the dial-peer is busied out I this doesnt work but how do i get the applet to pick out the "busyout" from the output of the command? event manager applet CheckSIP-Trunk event timer watchdog time 60 action 1.0 cli command "enable" action 2.0 cli command "sh dial-peer voice | in options" action 3.0 if regexp $_cli_result eq busyout action 4.0 syslog priority critical msg "SIP status is not working. Please check service with Service Provider." action 5.0 end
07-31-2015 06:40 PM
This discussion has been reposted from Additional Communities to the EEM Scripting community.
12-13-2016 01:13 PM
Hi Tony,
I could see in another forum that you finally found a way to monitor the dial-peer busy out through below EEM script.
event manager applet CheckSIP-Trunk
event timer watchdog time 60
action 2.0 cli command "sh dial-peer voice | in dial-peer action"
action 2.1 regexp "dial-peer action.*= ([a-z]+)," $_cli_result result result1
action 3.0 if $result1 eq "busyout"
action 3.1 syslog priority critical msg "SIP status is not working. Please check service with Service Provider."
action 3.4 end
can you explain below 3 commands with syntax, i would like to know what each command does.
action 2.0 cli command "sh dial-peer voice | in dial-peer action"
action 2.1 regexp "dial-peer action.*= ([a-z]+)," $_cli_result result result1
action 3.0 if $result1 eq "busyout"
12-14-2016 02:12 AM
Hei Shrikant
In short:
action 2.0 cli command "sh dial-peer voice | in dial-peer action"
Runs the command "show dial-peer voice | include dial-peer action"
action 2.1 regexp "dial-peer action.*= ([a-z]+)," $_cli_result result result1
Runs regexp on the output and places it in a variable called result1
action 3.0 if $result1 eq "busyout"
compares the variable to "busyout"
And if it does, then send "SIP status is not working. Please check service with Service Provider." to syslog.
Did that make sense?
/Tony
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