[cisco-voip] Monitor Historical PRI Usage
Tim Reimers
tim.reimers at asheville.k12.nc.us
Tue Aug 1 10:06:02 EDT 2006
I'm trying to use MRTG to do this---
This script:
#!/usr/bin/perl
use Net::Telnet::Cisco;
my $session = Net::Telnet::Cisco->new(Host => 'router.ip.address.xxx');
$session->login(Password => 'telnetpassword-goes-here');
# Enable mode
if ($session->enable("enable-pass-goes-here") ) {
my @output = $session->cmd('sh voice call status');
print @output;
} else {
warn "Can't enable: " . $session->errmsg;
}
$session->close;
This is the result-
[root at acslinux scripts]# ./isdncalls.pl
CallID CID ccVdb Port DSP/Ch Called # Codec
Dial-peers
0x4A1F7 2B51 0x843764A0 1/1:23.7 11/2 *92533459 g711ulaw
2000/10050
0x4A215 1930 0x84100A54 1/0:23.5 5/1 6101 g711ulaw
1090/2005
0x4A221 1935 0x84100A54 1/0:23.1 4/1 7000 g711ulaw
1090/2005
0x4A224 3551 0x843764A0 1/1:23.5 10/4 *8002382727 g711ulaw
2000/10100
0x4A229 1937 0x84100A54 1/0:23.3 4/3 6500 g711ulaw
1090/2005
0x4A22C 3751 0x843764A0 1/1:23.6 11/1 *92164936 g711ulaw
2000/10050
6 active calls found
[root at acslinux scripts]#
I haven't found a way to get that using pure SNMP, which would be more
secure
than having your telnet/enable in clear text in a perl script...
Does anyone know the OID that is represented here?
I'm still working on the rest of the Perl script to strip away
all the call info and leave only the last line, then strip everything
but the first digit
off that line..
Which would result in the script returning a '6' in this case..
MRTG config would look like this:
[root at acslinux mrtg]# cat isdnusage.cfg
WorkDir: /var/www/html/mrtg/hosts
#############################################################
# ISDN Usage for ACS pri router
# ip address xxx.xxx.xxx.xxx
Title[isdnpri]: ACS 2600 PRI router
MaxBytes[isdnpri]: 5000
AbsMax[isdnpri]: 10000
Options[isdnpri]: gauge
Target[isdnpri]: `/usr/local/ciscoscripts/isdnusage.pl`
PageTop[isdnpri]: <H1>ISDN channel usage on PRI</H1>
<P>Measures ISDN channel usage via a perl script getting the
'show voice call active' </P>
YLegend[isdnpri]: ISDN calls active
ShortLegend[isdnpri]: ms
Legend1[isdnpri]: Maximum calls
Legend2[isdnpri]: Minimum calls
WithPeak[isdnpri]: ymwd
#-------------------------------------------------------------------
That, and putting
*/5 * * * * root /usr/bin/mrtg /etc/mrtg/isdnusage.cfg --logging
/var/log/mrtg.log
into /etc/cron.d/mrtg
would do it...
All I'm lacking is taking the output of that sh active command and
trimming it down to being nothing but the number of calls...
________________________________
From: cisco-voip-bounces at puck.nether.net
[mailto:cisco-voip-bounces at puck.nether.net] On Behalf Of Jeff Anderson
Sent: Monday, July 31, 2006 2:00 PM
To: cisco-voip at puck.nether.net
Subject: [cisco-voip] Monitor Historical PRI Usage
I have a mgcp controlled PRI that I would like to be able to view its
utilization on. In particular I would like to know average and peak ds0
usage. I can find this information in realtime using perfmon/RTMT. The
problem is I would like to collect this data and view it at a later
time. I configured logging (in perfmon) for this particular DS-1 and the
file grew to 100MB (*.blg) but when I go to view it, nothing is there.
Probably user error but I can't seem to figure it out.
I also tried CAR using the Gateway Utilization report but that only give
me "% of Calls". Does anyone know of a better way to collect this data?
Any help is appreciated.
Thanks,
Jeff
More information about the cisco-voip
mailing list