[SR-Users] Monitor SIP Trunk Usage with MRTG

JR Richardson jmr.richardson at gmail.com
Thu May 12 01:38:50 CEST 2011


On Wed, May 11, 2011 at 10:42 AM, JR Richardson
<jmr.richardson at gmail.com> wrote:
> Hi All,
>
> So I'm still banging away at monitoring various SIP trunk capacity,
> the dialog module is working well for this purpose.  I am running
> local server cron job scripts to pull data and put into local flat
> files for reference.
>
> My next step is to pull this data from a remote server and graph with
> MRTG (this is what I use for most other network monitoring).  It looks
> like I can use the mi_xmlrpc module and remotely query the SIP Router
> with kamctl commands and parse the results into MRTG.
>
> I'm interested in hearing from others that may have already done this
> and would not mind sharing some scripts or from anyone that has an
> alternative method.
>
> Any guidance or affirmation that this is a good method that works
> would be helpful.
>
> On the MRTG server, I'm using perl scripts for a lot of my data
> pulling.  I am using Kamailio 3.0.
>
> Thanks.
>
> JR
Well, i could not get the mi_xmlrpc module compiled due to
dependencies, but that is another story.  I setup mi_datagram andI'm
trying to get that going.  I have can query the sip router with mi
commands and see the response on the wire in the return UDP packets,
but can't seem to get them to parse out of the perl script:

!/usr/bin/perl
#udpclient.pl

use strict;
use IO::Socket::INET;
$|++;

my ($socket,$data);

#  We call IO::Socket::INET->new() to create the UDP Socket
# and bind with the PeerAddr.
$socket = new IO::Socket::INET
(PeerAddr=>'10.10.12.24:8080',Proto=>'udp',LocalPort=>2424,)
        or die "ERROR in Socket Creation : $!\n";

#send operation
$data = ":ds_list:\n";
$socket->send($data);

#read operation
my ($datagram,$flags);
$socket->recv($datagram,42,$flags);;
print "Data received from socket : $socket\n";

sleep(1);
$socket->close();


Does anyone have a working script?

Thanks.

JR
-- 
JR Richardson
Engineering for the Masses



More information about the sr-users mailing list