Asterik IP-PBX Statistics (SIP/IAX2 protocols)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Moderators, Developers

Author
Message
Razor73
Posts: 3
Joined: Wed Apr 01, 2009 11:07 pm
Contact:

#46 Post by Razor73 » Wed Apr 01, 2009 11:25 pm

this is great i am impress what did you post in your blog about "Cacti script for Asterisk IP-PBX statistics"

Razor73
Posts: 3
Joined: Wed Apr 01, 2009 11:07 pm
Contact:

#47 Post by Razor73 » Wed Apr 01, 2009 11:25 pm

this is great i am impress what did you post in your blog about "Cacti script for Asterisk IP-PBX statistics"


_________________
IP PBX

User avatar
smlick
Cacti User
Posts: 267
Joined: Tue May 20, 2008 4:09 am
Location: Italy, Rome

#48 Post by smlick » Fri Apr 24, 2009 3:59 am

itconnection wrote:Hi,
adrianmarsh wrote:Oh this looks good..
Which version of Asterisk will it work with.. 1.2.x ?
We wrote it for 1.4.x, though it's an AMI app, thus it will work with 1.2.x also.

Next to come: ZAP channels, queues, transcoder
Very soon to come: SNMP-based version
Any news about SNMP version?

Regards
Alessio
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map

stryder77
Posts: 5
Joined: Wed Feb 11, 2009 7:47 pm

Host file trouble

#49 Post by stryder77 » Mon May 11, 2009 9:02 am

I have multiple hosts running asterisk that i want to monitor. I added a couple of them to the asx-stats.conf file and i get the same information about the 1st host and not the other 2.

Anyone able to help?

stryder77
Posts: 5
Joined: Wed Feb 11, 2009 7:47 pm

#50 Post by stryder77 » Tue May 12, 2009 9:21 am

NVM... I'm an idiot and didn't specify which host in the hosts file i want to watch when building my graphs. Sorry for the extemely dumb question.

stryder77
Posts: 5
Joined: Wed Feb 11, 2009 7:47 pm

#51 Post by stryder77 » Tue May 19, 2009 9:48 am

Now i'm running into a problem where the python script hangs and runs up the load on the cacti server. Anyone else familiar with this problem?

thiago.fernandes
Posts: 2
Joined: Tue Aug 18, 2009 9:33 am

#52 Post by thiago.fernandes » Tue Aug 18, 2009 9:48 am

I have the same problem. Every day I need kill many process python on the server cacti.

ruben23
Posts: 14
Joined: Thu Jul 30, 2009 2:49 pm
Location: Philippines Davao City
Contact:

#53 Post by ruben23 » Wed Aug 19, 2009 1:41 pm

hi how do i setup this to my new cacti installed on my server- i have an asterisk server on my LAN. sipporting 50 callers.

itconnection
Posts: 11
Joined: Wed Sep 19, 2007 5:31 am

#54 Post by itconnection » Thu Sep 10, 2009 2:00 am

asx-stats was moved to http://www.itconnection.ru/ru/solutions/asx-stats/
New version is available: asx-stats 0.3.0
Bug with too many python processes was fixed.
Configuration file's syntax was changed, you need to create a new configuration file.
Cacti templates was changed too, but the script is compatible with old templates.

thiago.fernandes
Posts: 2
Joined: Tue Aug 18, 2009 9:33 am

#55 Post by thiago.fernandes » Tue Sep 15, 2009 10:19 am

Hi

I have not tested the new version yet, but when I disable the option "Balance Process Load" in "Settings > Poller" the problem doesn't happen more

mikaelbj
Posts: 3
Joined: Tue Sep 15, 2009 3:22 pm

#56 Post by mikaelbj » Tue Sep 15, 2009 3:43 pm

I installed 0.3.0 now, but only got working graphs for Threads and IAX2 peers. SIP channels, SIP peers, heartbeat all give the value "nan". Any idea what's causing this? This is my first attempt at using asx stats and Cacti for that matter. I get a perfectly fine result using the python script from the command line, but no graphs are drawn in Cacti. When I debug the graph from cacti in Graph Management it displays the output "OK" for every graph, even those not showing anything. We're running on Cacti 0.8.7b.

mikaelbj
Posts: 3
Joined: Tue Sep 15, 2009 3:22 pm

#57 Post by mikaelbj » Wed Sep 16, 2009 5:53 am

mikaelbj wrote:I installed 0.3.0 now, but only got working graphs for Threads and IAX2 peers. SIP channels, SIP peers, heartbeat all give the value "nan". Any idea what's causing this? This is my first attempt at using asx stats and Cacti for that matter. I get a perfectly fine result using the python script from the command line, but no graphs are drawn in Cacti. When I debug the graph from cacti in Graph Management it displays the output "OK" for every graph, even those not showing anything. We're running on Cacti 0.8.7b.
SIP channels have started working partly too, but the line in the graph is not coherent. There are small blue marks showing up every now and then in the graph, but it looks like I'm out of data for most of the polled hours.

psn
Posts: 2
Joined: Thu Sep 24, 2009 12:17 pm

Fix to problems I was experiencing

#58 Post by psn » Thu Sep 24, 2009 12:24 pm

Hey everyone,

First off, great script. Thanks for putting this together.

That being said, I was experiencing an issue with the latest version (0.3.0). When trying to graph sip.users and certain other metrics with particular hosts, I was having problems. Cacti would not create the graph image (the image would show up as broken in my browser). upon further inspection, I found that the rrd files weren't being created either.

After a bit of digging, I found that the issue was that certain commands wouldn't work, such as asx-stats.py [server] sip.users, whereas sip.channels would work. sip.users was simply stalling and then timing out when run from the command line. The two issues that were causing this were:

1) Sometimes the asterisk manager would return the "--END COMMAND--" line not on a new, separate line. For instance, I was seeing "1020--END COMMAND--" come back. The python script would stall waiting for the end command line because this "1020" version of it would not be recognized.

2) When disconnecting from commands, manager was waiting for an extra return carriage on "action: logout" before terminating the connection.

Here is a diff that shows the changes I made. Hope they help someone out there.

Code: Select all

# diff asx-stats.py asx-stats.py.old 
20c20
< import sys, os, re, time, signal, string
---
> import sys, os, re, time, signal
55,56c55
< 	#while s != response:
< 	while string.find(response,s) == -1:
---
> 	while s != response:
71c70
< 	message = query(socket, "action: logoff\r\n\r\n", verbose = verbose)
---
> 	message = query(socket, "action: logoff\r\n", verbose = verbose)

-Taylor

mikaelbj
Posts: 3
Joined: Tue Sep 15, 2009 3:22 pm

Re: Fix to problems I was experiencing

#59 Post by mikaelbj » Sat Sep 26, 2009 5:46 am

psn wrote:Hey everyone,

First off, great script. Thanks for putting this together.

That being said, I was experiencing an issue with the latest version (0.3.0). When trying to graph sip.users and certain other metrics with particular hosts, I was having problems. Cacti would not create the graph image (the image would show up as broken in my browser). upon further inspection, I found that the rrd files weren't being created either.

After a bit of digging, I found that the issue was that certain commands wouldn't work, such as asx-stats.py [server] sip.users, whereas sip.channels would work. sip.users was simply stalling and then timing out when run from the command line. The two issues that were causing this were:

1) Sometimes the asterisk manager would return the "--END COMMAND--" line not on a new, separate line. For instance, I was seeing "1020--END COMMAND--" come back. The python script would stall waiting for the end command line because this "1020" version of it would not be recognized.

2) When disconnecting from commands, manager was waiting for an extra return carriage on "action: logout" before terminating the connection.

Here is a diff that shows the changes I made. Hope they help someone out there.

Code: Select all

# diff asx-stats.py asx-stats.py.old 
20c20
< import sys, os, re, time, signal, string
---
> import sys, os, re, time, signal
55,56c55
< 	#while s != response:
< 	while string.find(response,s) == -1:
---
> 	while s != response:
71c70
< 	message = query(socket, "action: logoff\r\n\r\n", verbose = verbose)
---
> 	message = query(socket, "action: logoff\r\n", verbose = verbose)

-Taylor

Unfortunately this didn't help in my case. I can run the commands for SIP peers, SIP users and heartbeat from the command line and it returns an integer value, but rrdtool shows NaN when I dump the the rrd file, thus leaving me without a working graph. The commands worked even before I applied this patch. I am connecting to Asterisk 1.4.22

psn
Posts: 2
Joined: Thu Sep 24, 2009 12:17 pm

#60 Post by psn » Mon Sep 28, 2009 11:12 am

You know, I may have gotten ahead of myself on that one. The fix does allow the script to run correctly now, and it returns a valid integer at the command line. I still am not getting graphs however. Not really sure what could be wrong here except something to do with the other aspects of the package (components other than the polling script).

Post Reply