Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

dial-peer busyout

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

Everyone's tags (1)
3 REPLIES
Community Member

This discussion has been

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

Community Member

Hi Tony,

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"

Community Member

Hei Shrikant

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

492
Views
0
Helpful
3
Replies
CreatePlease to create content