Created by: Leonard LECOUEY on 26-04-2010 09:17:57 AM Hello,
I wrote a Perl script to get the ActiveCall on the CallManager using AXL and XML::Simple. The goal is to supervise the CallManager and get all information like RTMT.
I first start with the active calls (I can also get CallsCompleted, CallsInProgress, etc) and hope to get all other the important information (FXO, MGCP gateway information, active port, etc).
I can get like three counters in a same request if I want, but I don't arrive to extract the result correctly. So I only do one counter per XML request to get the selected result.
I used XML::Simple because I had some trouble using SOAP::Lite with perfmon request. In my script, I do four requests: 1)Open the session (and get the session ID) 2)Add the counter 3)Collect the counter result 4)Close the session
It's working but I don't know if I¿m doing it correctly and I imagine there is a simple way to get this type of information. If you have suggestion, ideas or correction, please let me know!
---------------------------------------------------------------------------------------------------------------------- #!c:/perl/bin/perl -w use strict; use LWP::UserAgent; use XML::Simple;
# CallManager informations my $cucm = "your callmanager ip address"; my $axlport = "8443"; my $axluser = "axl login"; my $axlpwd = "axl password";
# Globals my $session = undef; my $xml = undef; my $soapEnv = undef; my $req = undef; my $res = undef;
######################## OPEN AND GET THE SESSIONHANDLE ########################
# Pass request to the user agent and get a response back $res = LWP::UserAgent->new->request($req);
# Check the outcome of the response and get the session ID if ($res->{_rc} == 200) { $xml = eval {XMLin($res->content,KeyAttr => "return")}; if($@){ $res=$@; }else { $res=$xml; } # Get the session ID $session = $res->{'soapenv:Body'}->{'ns1erfmonOpenSessionResponse'}->{'SessionHandle'}->{'content'};
# Pass request to the user agent and get a response back $res = LWP::UserAgent->new->request($req);
# Check the outcome of the response if ($res->{_rc} == 200){ $xml = eval {XMLin($res->content,KeyAttr => "return")}; if($@){ $res=$@; }else{ $res=$xml; } } else { print $res->status_line, "\n"; }
Subject: RE: Perl : CallManager monitoring script Replied by: Indrajit Chakrabarty on 24-05-2010 01:44:50 AM Does anyone have a C#/.NET sample of this script?
Subject: RE: Perl : CallManager monitoring script Replied by: Chester Rieman on 01-06-2012 08:55:19 AM I'm trying this out but getting:
500 Internal Server Error Use of uninitialized value in concatenation (.) or string at test8.pl line 60.
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: