Cacti (home)ForumsDocumentation
Cacti: offical forums and support
It is currently Tue Jul 23, 2019 7:01 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 84 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Asterik IP-PBX Statistics (SIP/IAX2 protocols)
PostPosted: Wed Sep 19, 2007 5:43 am 
Offline

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

We at ITConnection.ru are happy to post this Cacti script for Asterisk IP-PBX statistics. It's based on Python, works over AMI connection and provides cute and comprehensive graphs like this:

Image
Image
Image
Image
Image
Image
Image
Image
Image
Image
Image

We are open for any change requests or follow-up discussions, please give us feedback by replying to this post!

Have a nice time with Asterisk, the world's most advanced open-source telephony platform!

Cheers!


Attachments:
File comment: Asterisk IP-PBX Statistics for Cacti, asx-stats, v0.2.0
asx-stats-0.2.0.tgz [27.69 KiB]
Downloaded 6212 times
File comment: Asterisk IP-PBX Statistics for Cacti, asx-stats, v.0.1.5.1
asx-stats-0.1.5.1.tar.gz [22.74 KiB]
Downloaded 3664 times


Last edited by itconnection on Mon Oct 06, 2008 7:35 am, edited 5 times in total.
Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 19, 2007 7:59 am 
Offline
Cacti User
User avatar

Joined: Wed Aug 17, 2005 8:51 am
Posts: 435
Location: UK
Oh this looks good..
Which version of Asterisk will it work with.. 1.2.x ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 19, 2007 11:57 am 
Offline

Joined: Wed Sep 19, 2007 5:31 am
Posts: 11
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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 19, 2007 12:10 pm 
Offline
Cacti User
User avatar

Joined: Wed Aug 17, 2005 8:51 am
Posts: 435
Location: UK
I took a quick look at the files, and will maybe play a little more tomorrow. I've not had much to do with the manager side of A*k yet, so am I right in thinking I need an entry in manager.conf for this to work?

I'd like to hear more about the SNMP work too..


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 20, 2007 5:36 am 
Offline

Joined: Wed Sep 19, 2007 5:31 am
Posts: 11
Updated version with ZAP channels:


Attachments:
File comment: Asterisk IP-PBX Statistics for Cacti, asx-stats, v.0.1.1
asx-stats-0.1.1.tgz [19.57 KiB]
Downloaded 2658 times
Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 20, 2007 10:30 am 
Offline
Cacti User
User avatar

Joined: Wed Aug 17, 2005 8:51 am
Posts: 435
Location: UK
Do you have a host template?
I've imported the .xml files, updated manager.xml, updated iaxpeers with an entry from my iax.conf file, updated asx-stats.conf and copied the .py files over.

Next step is the data source and graphs, but I'm not sure what to put.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 20, 2007 10:38 am 
Offline
Cacti User
User avatar

Joined: Wed Aug 17, 2005 8:51 am
Posts: 435
Location: UK
ok.. figured out the data and graph details..

but thought I'd give it a while manually..

I get:

[email protected] scripts]# ./asx-stats.py localhost 0
name 'localhost' is not defined

from:

[[email protected] scripts]# cat /etc/asx-stats.conf
# host 0
# host name
hosts.0.hostname = localhost
# AMI port
hosts.0.port = 5035
# username for AMI
hosts.0.username = cacti
# password for AMI
hosts.0.password = somepassword


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 20, 2007 10:48 am 
Offline
Cacti User
User avatar

Joined: Wed Aug 17, 2005 8:51 am
Posts: 435
Location: UK
Ah... ok I get it.. made some more progress...
Now I can get:

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


but it just sits there...
and if I try:

[[email protected] scripts]# ./asx-stats.py 0 iax.peers.ubigradin.status

again it just stops... no output..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 21, 2007 8:30 am 
Offline

Joined: Wed Sep 19, 2007 5:31 am
Posts: 11
Try to use new updated version. Edit the file asx-stats.py: set the line "verbose = 0" to "verbose = 1" and post the output here.


Attachments:
File comment: Asterisk IP-PBX Statistics for Cacti, asx-stats, v.0.1.2
asx-stats-0.1.2.tgz [19.6 KiB]
Downloaded 2504 times
Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 23, 2007 7:18 am 
Offline

Joined: Sun Sep 23, 2007 6:48 am
Posts: 3
itconnection wrote:
Try to use new updated version. Edit the file asx-stats.py: set the line "verbose = 0" to "verbose = 1" and post the output here.


I have exactly the same symptoms as above - it authenticates and then does nothing. With verbose=1, rhe response for me is as follows:-

Code:
srv scripts # ./asx-stats.py 0
Asterisk Call Manager/1.0
Response: Success
Message: Authentication accepted
Asterisk Call Manager/1.0
Response: Success
Message: Authentication accepted

Response: Error
Message: Permission denied


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 4:46 am 
Offline

Joined: Wed Sep 19, 2007 5:31 am
Posts: 11
Looks like you don't have permission to run commands via AMI. Check your AMI configuration.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 5:09 am 
Offline

Joined: Sun Sep 23, 2007 6:48 am
Posts: 3
itconnection wrote:
Looks like you don't have permission to run commands via AMI. Check your AMI configuration.


That was pretty much the first thing I did.

Code:
[monitor]
secret = xxxxxxxxx
deny=
permit=192.168.1.0/255.255.255.255
read = system,call,log,verbose,command,agent,user
write =


The user used for monitoring has all available read permissions assigned to it. The fact that the asx-stats script successfully authenticates means it can't be a problem with the username, password or subnet configuration.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 7:59 am 
Offline

Joined: Wed Sep 19, 2007 5:31 am
Posts: 11
Try to use this script, it can show a query.


Attachments:
File comment: Asterisk IP-PBX Statistics for Cacti, asx-stats, v.0.1.3
asx-stats-0.1.3.tgz [19.6 KiB]
Downloaded 3029 times
Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 8:12 am 
Offline
Cacti User
User avatar

Joined: Wed Aug 17, 2005 8:51 am
Posts: 435
Location: UK
Odd.. I'd already posted a reply to the forum.. all I had to do to make it worked was change the permissions to

read=command
write=command


I think maybe its the WRITE part thats needed.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 25, 2007 9:03 am 
Offline

Joined: Sun Sep 23, 2007 6:48 am
Posts: 3
itconnection wrote:
Try to use this script, it can show a query.


This version of the script did indeed indicate that it was hanging after being getting an error in issuing a command.

Code:
srv scripts # ./asx-stats.py 0
action: login
username: queuemonitor
secret: queuemon
events: off


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

action: command
command: iax2 show peer iax2.fwd.net


Response: Error
Message: Permission denied


I'd suggest including the required AMI user configuration as part of the README file, but it also looks like some error checking may be required.

However, now that that's all said and done, thanks greatly for this! It's looking good.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 84 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group