We are not exactly bandits. Bandwidth-Bandits (b2) is a group of IT Pros tackling packets on a daily basis. Each member has their own colorful and unique experience in the evolving field of enterprise data networks, IT security and routing multimedia over IP. The goal of this collaboration is to share knowledge gained from years of experience and pick up new ones from readers. Welcome to our space in the web, please feel free to post what you have in mind.
(b2)
Friday, December 3, 2010
MRTG Graphing of VoIP Sessions on Cisco IP-to-IP Gateway
Just a quick post. I would like to share this helpful PERL script created by Yasin Kaplan,especially to those who use MRTG as part of their daily network traffic monitoring task.
Cisco does not provide an OID for fetching number of VoIP sessions on an IP-to-IP Gateway. One way to plot number of VoIP sessions using MRTG is explained below. You need IOS version >= 12.4 on the Cisco gateway.
IOS command “show call leg active event -log” gives total number of call legs established on a Cisco gateway. Half of this number gives actual VoIP session s established on a Cisco IP-to-IP Gateway:
Cisco#show call leg active event-log
Total call-legs: 268
You can get updated number of sessions information periodically telnet into gateway. MRTG allows console output of shell or PERL scripts as data source in place of SNMP OIDs. Following PERL script can be used to get number of active call legs form a Cisco Gateway:
monitor# more /usr/local/bin/voip_sess.pl
#!/usr/bin/perl
use Net::Rsh;
my $mgw = $ARGV[0];
my $voip_sess;
my @greped;
$a=Net::Rsh->new();
@c=$a->rsh($mgw,"root","root","sh call leg act event-log");
@greped=grep(/^Total/, @c);
You need to add following configuration to Cisco Gateway in order the gateway permit incoming
RCMD request:
ip rcmd rsh-enable
ip rcmd remote-host root 101 root enable
ip rcmd remote-username root
ip rcmd source-interface !
access-list 101 remark **** RCMD Access Control ****
access-list 101 permit ip host 192.168.10.1 any
Finally add a profile to your “mrtg.cfg” script to read number of VoIP sessions. MRTG user must have necessary rights to run “voip_sess.pl” (chmod +x /usr/local/bin/voip_sess).
No comments:
Post a Comment