cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2632
Views
0
Helpful
3
Replies

dial-peer busyout

tony loktu
Level 1
Level 1

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

3 Replies 3

rosaho
Level 3
Level 3

This discussion has been reposted from Additional Communities to the EEM Scripting community.

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"

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