[asterisk-users] How to monitor asterisk with SNMP?
Benoit
maverick at maverick.eu.org
Mon Jan 12 02:10:09 CST 2009
Well, at worst you can make use of the exec and pass_persist feature of
snmpd
that way you can build you own script that will run locally to the
asterisk box
and query using snmp
Grygoriy Dobrovolskyy a écrit :
> I wonder if the same is possible with centreon ?
> Someone is using centreon here ?
>
>
> 2009/1/11 Markus A. Wipfler <markus at infocom.co.ug
> <mailto:markus at infocom.co.ug>>
>
>
> On Jan 11, 2009, at 2:43 PM, Grygoriy Dobrovolskyy wrote:
>
>> Can you show me your script please ?
>
> if for example you had 4 trunks then the below should give you the
> active channels for each trunk plus the total, in a cacti
> understandable output format.
>
> #!/usr/bin/perl
> ($trunk1, $trunk2, $trunk3, $trunk4, $total) = (0,0,0,0,0);
> @channels = split(/\n/, qx(/usr/bin/sudo /usr/sbin/asterisk -rx
> 'core show channels concise'));
> foreach $line (@channels) {
> $trunk1++ if ($line =~ m/trunk1/);
> $trunk2++ if ($line =~ m/trunk2/);
> $trunk3++ if ($line =~ m/trunk3/);
> $trunk4++ if ($line =~ m/trunk4/)
> }
> $total = $trunk1 + $trunk2 + $trunk3 + $trunk4;
> print "trunk1:$trunk1 trunk2:$trunk2 trunk3:$trunk3 trunk4:$trunk4
> total:$total";
> exit 0
>
>
>> For which version is it ?
>
> am running this with cacti version 0.8.7b
>
>
>
> Hope this helps. The cool thing with this is that you can really
> customize what you are graphing in cacti.
>
> --
> Markus
>
>
>>
>>
>> 2009/1/10 Markus A. Wipfler <markus at infocom.co.ug
>> <mailto:markus at infocom.co.ug>>
>>
>> Another way to monitor this via cacti (for example if you
>> don't have snmp support for asterisk or need to customize
>> what you are graphing) is to create a new data input method
>> in cacti and then use a script to get you the required
>> data. I use a simple perl script that gets my all active zap,
>> iax, sip channels, how many concurrent calls from network
>> A to B, and more...
>>
>> http://www.cacti.net/downloads/docs/html/making_scripts_work_with_cacti.html
>>
>> I would also suggest to run the cacti poller every 1 minute
>> rather than the default 5.
>>
>>
>> --
>> Markus
>>
>>
>>
>>
>> On Jan 10, 2009, at 11:24 PM, Matt Gibson wrote:
>>
>>> http://www.voipphreak.ca/2007/04/16/monitoring-asterisk-14-with-snmp-and-cacti-for-pretty-graphs/
>>>
>>> Thanks,
>>> Matt G
>>>
>>> : http://www.voipphreak.ca
>>> : http://www.ratemydialplan.com
>>> : http://www.asterisk-jobs.com
>>>
>>>
>>> *From:* asterisk-users-bounces at lists.digium.com
>>> <mailto:asterisk-users-bounces at lists.digium.com> [mailto:asterisk-users-bounces at lists.digium.com] *On
>>> Behalf Of *Robert Augustyn
>>> *Sent:* Saturday, January 10, 2009 2:45 PM
>>> *To:* asterisk-users at lists.digium.com
>>> <mailto:asterisk-users at lists.digium.com>
>>> *Subject:* [asterisk-users] How to monitor asterisk with SNMP?
>>>
>>> Hi,
>>> We have zabbix running and would love to be able to monitor
>>> our asterisk box with it.
>>> I believe that some sort of SNMP is build in 1.4+ correct?
>>> Where do I find more info or a how to on what is supported
>>> and how to use it?
>>> Thank you.
>>>
>>>
>>
More information about the asterisk-users
mailing list