Asterik IP-PBX Statistics (SIP/IAX2 protocols)

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

Moderators: Moderators, Developers

Author
Message
User avatar
adrianmarsh
Cacti User
Posts: 435
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

#16 Post by adrianmarsh » Wed Sep 26, 2007 4:54 am

Whats the story with SNMP support then?
I just read that Asterisk 1.4 has some built-in support, which I like the idea of much better than AMI scripts. Do you have any links to what it supports polling of?

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

#17 Post by itconnection » Wed Sep 26, 2007 7:38 am

adrianmarsh wrote:Whats the story with SNMP support then?
I just read that Asterisk 1.4 has some built-in support, which I like the idea of much better than AMI scripts. Do you have any links to what it supports polling of?
http://www.voipphreak.ca/archives/382

User avatar
adrianmarsh
Cacti User
Posts: 435
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

#18 Post by adrianmarsh » Wed Sep 26, 2007 8:05 am

Yeah I've read through that one, but one thing that still seems missing to me is a basic call counter. The problem with measuring attached SIP clients etc in Cacti, is that it only polls every 5 mins, and therefore you can get an incorrect picture.. eg, 100 people attach and detach within that 5 min period, but the graph shows a constant attached status - not indicative of the workload the server might have.

I don't see Channel-call counters in the list, but I've not looked at the MIB yet (still working out how to read them...)

User avatar
davebassjunkie
Posts: 13
Joined: Mon Nov 19, 2007 7:56 pm

#19 Post by davebassjunkie » Mon Nov 19, 2007 4:15 am

Thanks for the cool script - works like a charm!
Anyway, some edits must be done to make it work in asterisk 1.2 [and not 1.4]

The "show threads" function is not available in asterisk 1.2.. so it can't work.

Line 217: Modify "agent show" to "show agents"
Line 234: Modify "core show uptime seconds" to "show uptime seconds"

And then [i think this IS a bug] - if there is just ONE active iax or sip channel, the string search doesn't work (as it searchs for "channels" and not "channel")

On line 184: Modify "active SIP channels" to "active SIP channel"
On line 189: Modify "active IAX channels" to "active IAX channel"

Maybe the output of asterisk 1.4 is different, i don't know.

Bye!

User avatar
adrianmarsh
Cacti User
Posts: 435
Joined: Wed Aug 17, 2005 8:51 am
Location: UK

#20 Post by adrianmarsh » Mon Feb 11, 2008 7:39 am

Just upgraded Asterisk from 1.2 to 1.4.. now I get some odd readings from the script for SIP peers:

[[email protected] scripts]# ./asx-stats.py
Asterisk Call Manager/1.0
Response: Success
Message: Authentication accepted

sip.peers.total:195
sip.peers.online:3
iax.peers.total:2
iax.peers.online:0
sip.users.total:188
iax.users.total:5
sip.channels:0
iax.channels:0
zap.channels:0
iax.peers.ubigradout.status:0
iax.peers.ubigradin.status:0
iax.peers.ubigradouttest.status:0
iax.peers.20005.status:0

From asterisk I get:

202 sip peers [Monitored: 107 online, 91 offline Unmonitored: 3 online, 1 offline]

Whats the difference between "monitored" and "unmonitored" ?

HansK
Posts: 1
Joined: Fri Feb 22, 2008 8:50 am

zap channel problem

#21 Post by HansK » Fri Feb 22, 2008 8:55 am

I'm having some problems graphing the "PSTN channels"
when i create the data source and the graph I receive the following error:

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="as1 - Asterisk - PSTN channels" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="PSTN channels" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
LINE1:#002A97FF:"channels in use" \
GPRINT::LAST:"Current\:%8.0lf" \
GPRINT::AVERAGE:"Average\:%8.0lf" \
GPRINT::MAX:"Maximum\:%8.0lf\n"

RRDTool Says:

ERROR: parameter '#002A97FF' does not represent a number in line LINE1:#002A97FF:channels in use

also there seems to be a reference to sip channels in "PSTN Channels.xml" graph template
<name>|host_description| - Asterisk - SIP channels</name>

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#22 Post by gandalf » Fri Feb 22, 2008 9:26 am

The DEF statement, referring to a rrd file, is missing. Broken Templates may yield such a result
Reinhard

pascal1024
Posts: 4
Joined: Wed Mar 12, 2008 8:36 am
Location: france

INSTALL Documentation

#23 Post by pascal1024 » Wed Mar 12, 2008 8:40 am

hello every body

( its seems to be a nice application but i really don't understand all from the install file ....
if you have an install documentation with more details it will be very welcome and usefull for me )

FORGET NOW IT'S WORKS !!! :
"[A.FR.2 asx-stats]# ./asx-stats.py 0
Asterisk Call Manager/1.0
Response: Success
Message: Authentication accepted
Asterisk Call Manager/1.0
Response: Success
Message: Authentication accepted"

And a lot of others datas

BUT NOTHING apear in cacti graph
one debug for exemple (it's the same for all the templates for asterisk)debug :

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="AFR1 - Asterisk - IAX2 channels" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="IAX2 channels" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/html/cacti/rra/afr1_iax_channels_23.rrd":iax_channels:AVERAGE \
DEF:b="/var/www/html/cacti/rra/afr1_iax_channels_23.rrd":iax_channels:MAX \
LINE1:a#002A97FF:"channels in use" \
GPRINT:a:LAST:"Current\:%8.0lf" \
GPRINT:a:AVERAGE:"Average\:%8.0lf" \
GPRINT:b:MAX:"Maximum\:%8.0lf\n"
RRDTool Says: OK

If someone have any idea ....
thanks in advance

pascal
Last edited by pascal1024 on Thu Mar 13, 2008 10:08 am, edited 2 times in total.

cdb0788
Posts: 1
Joined: Wed Mar 12, 2008 3:40 pm
Location: Lima, OH

Channels

#24 Post by cdb0788 » Wed Mar 12, 2008 3:41 pm

Is there a way to break out this script and make it return the results from, lets say, channels 25-49 instead of from all channels?

rossmc
Posts: 2
Joined: Fri Mar 21, 2008 12:12 pm

#25 Post by rossmc » Fri Mar 21, 2008 12:13 pm

I have just installed this and when running the script manually all seems ok;

Asterisk Call Manager/1.0
Response: Success
Message: Authentication accepted

sip.peers.total:27
sip.peers.online:25
iax.peers.total:0
iax.peers.online:0
sip.users.total:27
iax.users.total:3
sip.channels:0
iax.channels:0
zap.channels:4
iax.peers.gradwellout.status:0


However when trying to view the graphs in Cacti I am just receiving blank/no graphs?

Anyone got any ideas?

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#26 Post by gandalf » Fri Mar 21, 2008 2:58 pm

As a general help, please visit second link of my signature
Reinhard

pascal1024
Posts: 4
Joined: Wed Mar 12, 2008 8:36 am
Location: france

#27 Post by pascal1024 » Sun Mar 23, 2008 5:07 pm

hello
thanks for your answer
i will have a look
pascal

pascal1024
Posts: 4
Joined: Wed Mar 12, 2008 8:36 am
Location: france

#28 Post by pascal1024 » Wed Mar 26, 2008 7:36 am

HELLO Reinhard

i check all in your second link ...

here is what i get everytime in the cacti.log :

03/26/2008 01:20:02 PM - CMDPHP: Poller[0] Host[3] DS[15] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/26/2008 01:20:02 PM - CMDPHP: Poller[0] Host[3] DS[16] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/26/2008 01:20:02 PM - CMDPHP: Poller[0] Host[2] DS[12] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/26/2008 01:20:03 PM - CMDPHP: Poller[0] Host[2] DS[13] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/26/2008 01:20:03 PM - CMDPHP: Poller[0] Host[3] DS[17] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/26/2008 01:20:03 PM - CMDPHP: Poller[0] Host[2] DS[42] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/26/2008 01:20:03 PM - CMDPHP: Poller[0] Host[4] DS[23] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/26/2008 01:20:03 PM - CMDPHP: Poller[0] Host[4] DS[24] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/26/2008 01:20:03 PM - CMDPHP: Poller[0] Host[4] DS[25] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/26/2008 01:20:03 PM - CMDPHP: Poller[0] Host[4] DS[28] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/26/2008 01:20:04 PM - CMDPHP: Poller[0] Host[4] DS[29] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/26/2008 01:20:04 PM - SYSTEM STATS: Time:3.3851 Method:cmd.php Processes:3 Threads:N/A Hosts:9 HostsPerProcess:3 DataSources:56 RRDsProcessed:46


the ./asx-stats.py 0 command give me all OK
and i have always no graph in cacti
can you help me ?
thanks in advance
pascal

User avatar
gandalf
Developer
Posts: 22375
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

#29 Post by gandalf » Wed Mar 26, 2008 4:53 pm

You're on the right track. Switch to DEBUG to find the exact output of the script
Reinhard

pascal1024
Posts: 4
Joined: Wed Mar 12, 2008 8:36 am
Location: france

#30 Post by pascal1024 » Thu Mar 27, 2008 2:21 pm

hi here is more log

03/27/2008 08:15:03 PM - CMDPHP: Poller[0] Host[4] DS[23] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/27/2008 08:15:03 PM - CMDPHP: Poller[0] Host[4] DS[23] CMD: /var/www/html/cacti/scripts/asx-stats.py 0 iax.channels, output: U
03/27/2008 08:15:03 PM - CMDPHP: Poller[0] Host[4] DS[24] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/27/2008 08:15:03 PM - CMDPHP: Poller[0] Host[4] DS[24] CMD: /var/www/html/cacti/scripts/asx-stats.py 0 sip.channels, output: U
03/27/2008 08:15:03 PM - CMDPHP: Poller[0] Host[4] DS[25] WARNING: Result from CMD not valid. Partial Result: Asterisk Call Manage
03/27/2008 08:15:03 PM - CMDPHP: Poller[0] Host[4] DS[25] CMD: /var/www/html/cacti/scripts/asx-stats.py 0 sip.users.total, output: U
03/27/2008 08:15:03 PM - CMDPHP: Poller[0] Host[4] DS[26] CMD: perl /var/www/html/cacti/scripts/ping.pl 81.252.162.140, output: 0.728
03/27/2008 08:15:03 PM - CMDPHP: Poller[0] Host[4] DS[27] SNMP: v2: 81.252.162.140, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.2, output: 232169975

i check the path he is good
here is my iaxpeers file
TR2-AFR1-ADZ3
TR-AFR1-AMD5
TR-AFR1-AMD1
TR-AFR1-AFR2
TR-AFR1-ADZ3
TR-AFR1-ADZ2
TR-AFR1-ADZ1
out-qualitel1
In2-voxbone
In-voxbone


i don't what i can do now
pascal

Post Reply