Asterik IP-PBX Statistics (SIP/IAX2 protocols)
Moderators: Developers, Moderators
this is great i am impress what did you post in your blog about "Cacti script for Asterisk IP-PBX statistics"
_________________
IP PBX
_________________
IP PBX
Any news about SNMP version?itconnection wrote:Hi,
We wrote it for 1.4.x, though it's an AMI app, thus it will work with 1.2.x also.adrianmarsh wrote:Oh this looks good..
Which version of Asterisk will it work with.. 1.2.x ?
Next to come: ZAP channels, queues, transcoder
Very soon to come: SNMP-based version
Regards
Alessio
Cacti Version 0.8.8c production / 0.8.8c test W2008 -- Plugin:Weathermap - Monitor - CAMM 1.6.7 :) - Nectar - GPS Map
Host file trouble
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?
Anyone able to help?
-
- Posts: 2
- Joined: Tue Aug 18, 2009 9:33 am
-
- Posts: 11
- Joined: Wed Sep 19, 2007 5:31 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.
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.
-
- Posts: 2
- Joined: Tue Aug 18, 2009 9:33 am
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.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.
Fix to problems I was experiencing
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.
-Taylor
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
Re: Fix to problems I was experiencing
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
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).
Who is online
Users browsing this forum: No registered users and 0 guests