JR Richardson
2008-Jan-27 21:36 UTC
[asterisk-users] Asterisk and MRTG, a little help please...
Hi All, After reading the sparse info and attempting to get this running, I'm unsuccessful and could use some guidance. I already have a MRTG server up and running serving hundreds of router interface graphs. I would like to add SIP/IAX channel graphs for all our asterisk servers. I'm running asterisk 1.2 and MRTG 2.4.17. I tried the script from http://karlsbakk.net/asterisk/ but get errors that MRTG does not recognize the first few lines, so I think I'm running into MRTG version compatibility issues. Can anyone send me the MRTG scripts that may work with this setup? Thanks. JR -- JR Richardson Engineering for the Masses
JR Richardson wrote:>Hi All, > >After reading the sparse info and attempting to get this running, I'm >unsuccessful and could use some guidance. > >I already have a MRTG server up and running serving hundreds of router >interface graphs. I would like to add SIP/IAX channel graphs for all >our asterisk servers. I'm running asterisk 1.2 and MRTG 2.4.17. I >tried the script from http://karlsbakk.net/asterisk/ but get errors >that MRTG does not recognize the first few lines, so I think I'm >running into MRTG version compatibility issues. > >Can anyone send me the MRTG scripts that may work with this setup? > > >I have the exact same script from that web page and it runs fine on Asterisk 1.2 and MRTG 2.9.29 (default RH ES3.0 install). I also have other servers on RH9 and MRTG 2.10.13 running without issue as well. What errors are you getting? Andres. http://www.neuroredes.com>Thanks. > >JR > >
Alejandro Acosta
2008-Jan-28 14:31 UTC
[asterisk-users] Asterisk and MRTG, a little help please...
JR, That script runs fine. You should be able to run it first manually, if so please copy and paste the error. Thanks, Alejandro,> > After reading the sparse info and attempting to get this running, I'm > unsuccessful and could use some guidance. > > I already have a MRTG server up and running serving hundreds of router > interface graphs. I would like to add SIP/IAX channel graphs for all > our asterisk servers. I'm running asterisk 1.2 and MRTG 2.4.17. I > tried the script from http://karlsbakk.net/asterisk/ but get errors > that MRTG does not recognize the first few lines, so I think I'm > running into MRTG version compatibility issues. > > Can anyone send me the MRTG scripts that may work with this setup? > > Thanks. > > JR > -- > JR Richardson > Engineering for the Masses > > _______________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >
JR Richardson
2008-Jan-28 16:25 UTC
[asterisk-users] Asterisk and MRTG, a little help please...
> >After reading the sparse info and attempting to get this running, I'm > >unsuccessful and could use some guidance. > > > >I already have a MRTG server up and running serving hundreds of router > >interface graphs. I would like to add SIP/IAX channel graphs for all > >our asterisk servers. I'm running asterisk 1.2 and MRTG 2.4.17. I > >tried the script from http://karlsbakk.net/asterisk/ but get errors > >that MRTG does not recognize the first few lines, so I think I'm > >running into MRTG version compatibility issues. > > > >Can anyone send me the MRTG scripts that may work with this setup? > > > > > > > I have the exact same script from that web page and it runs fine on > Asterisk 1.2 and MRTG 2.9.29 (default RH ES3.0 install). I also have > other servers on RH9 and MRTG 2.10.13 running without issue as well. > What errors are you getting?Unknown option: h Unknown option: 1 Unknown option: 2 ERROR: Line 3 (use strict;) in CFG file (10.10.14.102.cfg) does not make sense I named the script file the IP address of the server.cfg instead of asterisk-mrtg. I call the script from the command line: # env LANG=C /usr/bin/mrtg 10.10.14.102.cfg -h 10.10.14.102 -1 SIP -2 IAX2 JR -- JR Richardson Engineering for the Masses
> >Unknown option: h >Unknown option: 1 >Unknown option: 2 >ERROR: Line 3 (use strict;) in CFG file (10.10.14.102.cfg) does not make sense > >I named the script file the IP address of the server.cfg instead of >asterisk-mrtg. > >I call the script from the command line: > ># env LANG=C /usr/bin/mrtg 10.10.14.102.cfg -h 10.10.14.102 -1 SIP -2 IAX2 > > >The problem is that is not how its supposed to work. The file is just a script that you need to run from withing a regular mrtg.cfg file. So first you build a regular mrtg.cfg file and test it out with something you are used to like Ethernet Traffic or whatever. Then you add something like this at the bottom: Title[servername]: Server title PageTop[servername]: <h1>servername.domain.com</h1> Target[servername]: `/usr/local/bin/asterisk-mrtg -h servername.domain.com -1 SIP -2 IAX2` Options[servername]: gauge,integer MaxBytes[servername]: 90 YLegend[servername]: Active channels ...You see the Target Line...Thats where the perl script from http://karlsbakk.net/asterisk/ goes. It is not an MRTG config file as you have tried to use it. Andres http://www.neuroredes.com>JR > >
JR Richardson
2008-Jan-28 20:01 UTC
[asterisk-users] Asterisk and MRTG, a little help please...
> 6. Re: > That script runs fine. You should be able to run it first manually, if so > please copy and paste the error. >mrtg:/var/www/mrtg# env LANG=C /usr/bin/mrtg 2008-01-28 11:16:01: WARNING: Could not get any data from external command '/var/mrtg/10.10.14.102.cfg -h 10.10.14.102 -1 SIP -2 IAX2' Maybe the external command did not even start. (Illegal seek) 2008-01-28 11:16:01: WARNING: Problem with External get '/var/mrtg/10.10.14.102.cfg -h 10.10.14.102 -1 SIP -2 IAX2': Expected a Number for 'in' but nothing' 2008-01-28 11:16:01: WARNING: Problem with External get '/var/mrtg/10.10.14.102.cfg -h 10.10.14.102 -1 SIP -2 IAX2': Expected a Number for 'out' but nothing' 2008-01-28 11:16:01: ERROR: Target[asterisklab2][_IN_] ' $target->[0]{$mode} ' did not eval into defined data 2008-01-28 11:16:01: ERROR: Target[asterisklab2][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data ntcp-mrtg:/var/www/mrtg# I can see the script log into the manager interface on the asterisk server at 10.10.14.102, and there are active SIP channels during script execution. Any ideas? Thanks. JR -- JR Richardson Engineering for the Masses
JR Richardson
2008-Jan-29 02:45 UTC
[asterisk-users] Asterisk and MRTG, a little help please...
> You need to take a step back and first test the script without using > MRTG. Execute it like this: > # /opt/bin/asterisk-mrtg -h localhost -u XXX -p XXXX -1 SIP -2 Zap > 10 > 10 > 10 > 10 > > You should get 4 lines of numbers. That respresents your SIP and Zap > channels. Once you get past this step go back and plug it into your > MRTG config.I run the script without using mrtg but I don't get any reply: mrtg:# /var/mrtg/asterisk-mrtg -h [ipaddress] -u [user] -p [pass] -1 SIP -2 IAX2 mrtg:# I can see the script log into the manager on the asterisk server, but doesn't return any figures. i haven't modified anything in the script. I'm wondering if the script is OK and maybe Asterisk manager is not setup correctly or asterisk is not returning proper value. Here is what I have configured in manager.conf: [general] enabled = yes port = 5038 bindaddr = 0.0.0.0 [user] secret = pass deny=0.0.0.0/0.0.0.0 permit=[subnet of mrtg server] read = system,call,log,verbose,command,agent,user Thanks. JR -- JR Richardson Engineering for the Masses