cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2432
Views
0
Helpful
8
Replies

EEM script to send alert when all PRI channels are in use?

Michael Marzol
Level 1
Level 1

Hello,

I'd like to be able to have an email sent when all channels of all PRI's on a voice gateway/router are in use. Does anyone have any existing clever solutions for this that they wouldn't mind sharing?

Thanks in advance!

-Mike

8 Replies 8

Joe Clarke
Cisco Employee
Cisco Employee

How would you determine this manually?

This would show you manually what channels are being used for all PRI's on a router:

 

sh voice port summ
                                           IN       OUT
PORT            CH   SIG-TYPE   ADMIN OPER STATUS   STATUS   EC
=============== == ============ ===== ==== ======== ======== ==
0/0/0:23        01  xcc-voice   up    dorm none     none     y
0/0/0:23        02  xcc-voice   up    dorm none     none     y
0/0/0:23        03  xcc-voice   up    dorm none     none     y
0/0/0:23        04  xcc-voice   up    dorm none     none     y
0/0/0:23        05  xcc-voice   up    dorm none     none     y
0/0/0:23        06  xcc-voice   up    dorm none     none     y
0/0/0:23        07  xcc-voice   up    dorm none     none     y
0/0/0:23        08  xcc-voice   up    dorm none     none     y
0/0/0:23        09  xcc-voice   up    dorm none     none     y
0/0/0:23        10  xcc-voice   up    dorm none     none     y
0/0/0:23        11  xcc-voice   up    dorm none     none     y
0/0/0:23        12  xcc-voice   up    dorm none     none     y
0/0/0:23        13  xcc-voice   up    dorm none     none     y
0/0/0:23        14  xcc-voice   up    dorm none     none     y
0/0/0:23        15  xcc-voice   up    dorm none     none     y
0/0/0:23        16  xcc-voice   up    dorm none     none     y
0/0/0:23        17  xcc-voice   up    dorm none     none     y
0/0/0:23        18  xcc-voice   up    dorm none     none     y
0/0/0:23        19  xcc-voice   up    dorm none     none     y
0/0/0:23        20  xcc-voice   up    dorm none     none     y
0/0/0:23        21  xcc-voice   up    dorm none     none     y
0/0/0:23        22  xcc-voice   up    dorm none     none     y
0/0/0:23        23  xcc-voice   up    dorm none     none     y
0/1/0:23        01  xcc-voice   up    dorm none     none     y
0/1/0:23        02  xcc-voice   up    up   none     none     y
0/1/0:23        03  xcc-voice   up    up   none     none     y
0/1/0:23        04  xcc-voice   up    dorm none     none     y
0/1/0:23        05  xcc-voice   up    up   none     none     y
0/1/0:23        06  xcc-voice   up    up   none     none     y
0/1/0:23        07  xcc-voice   up    up   none     none     y
0/1/0:23        08  xcc-voice   up    dorm none     none     y
0/1/0:23        09  xcc-voice   up    up   none     none     y
0/1/0:23        10  xcc-voice   up    up   none     none     y
0/1/0:23        11  xcc-voice   up    up   none     none     y
0/1/0:23        12  xcc-voice   up    up   none     none     y
0/1/0:23        13  xcc-voice   up    dorm none     none     y
0/1/0:23        14  xcc-voice   up    up   none     none     y
0/1/0:23        15  xcc-voice   up    up   none     none     y
0/1/0:23        16  xcc-voice   up    up   none     none     y
0/1/0:23        17  xcc-voice   up    up   none     none     y
0/1/0:23        18  xcc-voice   up    dorm none     none     y
0/1/0:23        19  xcc-voice   up    up   none     none     y
0/1/0:23        20  xcc-voice   up    up   none     none     y
0/1/0:23        21  xcc-voice   up    up   none     none     y
0/1/0:23        22  xcc-voice   up    up   none     none     y
0/1/0:23        23  xcc-voice   up    up   none     none     y

 

 

If they are admin up/oper up they are in use.  Dorm means they are available and not currently being used.  I'm sure there is a way to capture this output on an interval and parse it, but I don't know what that would be.

Of all the show commands for ISDN/PRI, that is one I've never used. Thanks for the info Carl.
 

I was the same way and managed to stumble upon the command myself a couple of years ago.  No problem.  Glad you found it helpful. 

Ah, then perhaps something as simple as this would work:

 

event manager applet check-pri

 event timer watchdog time 3600

 action 001 cli command "enable"

 action 002 cli command "show voice port summ | inc dorm"

 action 003 foreach line $_cli_result "\n"

 action 004   regexp "dorm" $line

 action 005   if $_regexp_result eq 1

 action 006   exit 0

 action 007  end

 action 008 end

 action 009 mail from "user@example.com" to "user@example.com" subject "All PRI channels in use" body "All of the PRI channels are in use" server 10.1.1.1

So this basically looks for any lines that have "dorm" and if it matches, it exits the script?  Doesn't that mean that if it comes across any channels that are actually in use then it is going to send the mail?

No.  The first line that contains dorm will cause the policy to exit without sending the mail.  If there are no dorm lines, it will send an email.

Gotcha.  I missed the "| inc dorm" in the show line, which is why I was confused.  Thanks.

Getting Started

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: