<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 11, 2009, at 2:43 PM, Grygoriy Dobrovolskyy wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Can you show me your script please ?</blockquote><div><br></div><div>if for example you had 4 trunks&nbsp;then the below should give you the active channels for each trunk plus &nbsp;the total, in a cacti understandable output format.</div><div><br></div><div><div>#!/usr/bin/perl</div><div>($trunk1, $trunk2, $trunk3, $trunk4, $total) = (0,0,0,0,0);</div><div>@channels = split(/\n/, qx(/usr/bin/sudo /usr/sbin/asterisk -rx 'core show channels concise'));</div><div>foreach $line (@channels) {</div><div>&nbsp;&nbsp; &nbsp;$trunk1++ if ($line =~ m/trunk1/);</div><div>&nbsp;&nbsp; &nbsp;$trunk2++ if ($line =~ m/trunk2/);</div><div>&nbsp;&nbsp; &nbsp;$trunk3++ if ($line =~ m/trunk3/);</div><div>&nbsp;&nbsp; &nbsp;$trunk4++ if ($line =~ m/trunk4/)</div><div>}</div><div>$total = $trunk1 + $trunk2 + $trunk3 + $trunk4;</div><div>print "trunk1:$trunk1 trunk2:$trunk2 trunk3:$trunk3 trunk4:$trunk4 total:$total";</div><div>exit 0</div><div><br></div></div><br><blockquote type="cite"> For which version is it ?</blockquote><div><br></div><div>am running this with cacti version&nbsp;0.8.7b</div><div><br></div><div><br></div><div><br></div><div>Hope this helps. The cool thing with this is that you can really customize what you are graphing in cacti.</div><div><br></div><div>--</div><div>Markus</div><div><br></div><br><blockquote type="cite"><br><br><div class="gmail_quote">2009/1/10 Markus A. Wipfler <span dir="ltr">&lt;<a href="mailto:markus@infocom.co.ug">markus@infocom.co.ug</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div style="">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.&nbsp;I use a simple perl script that gets my all active zap, iax, sip channels, how many concurrent calls from network &nbsp;A&nbsp;to B, &nbsp;and more...<div> <br></div><div><div><a href="http://www.cacti.net/downloads/docs/html/making_scripts_work_with_cacti.html" target="_blank">http://www.cacti.net/downloads/docs/html/making_scripts_work_with_cacti.html</a></div><div><br></div> <div>I would also suggest to run the cacti poller every 1 minute rather than the default 5.</div><div><br></div><div><br></div><div>--</div><div>Markus</div><div><br></div><div><br></div><div><br></div><div>&nbsp;</div><div><div> <div><div><div></div><div class="Wj3C7c"><div>On Jan 10, 2009, at 11:24 PM, Matt Gibson wrote:</div><br></div></div><blockquote type="cite"><span style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div link="blue" vlink="purple" lang="EN-US"> <div><div></div><div class="Wj3C7c"><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 11pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);"><a href="http://www.voipphreak.ca/2007/04/16/monitoring-asterisk-14-with-snmp-and-cacti-for-pretty-graphs/" style="color: blue; text-decoration: underline;" target="_blank">http://www.voipphreak.ca/2007/04/16/monitoring-asterisk-14-with-snmp-and-cacti-for-pretty-graphs/</a></span></div> <div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 11pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);">&nbsp;</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"> <span style="font-size: 11.5pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);">Thanks,</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 11.5pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);">Matt G</span></div> <div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 11.5pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);">&nbsp;</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"> <span style="font-size: 11.5pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);">:<span>&nbsp;</span><a href="http://www.voipphreak.ca" style="color: blue; text-decoration: underline;" target="_blank"><span style="color: blue;">http://www.voipphreak.ca</span></a></span></div> <div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 11.5pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);">:<span>&nbsp;</span><a href="http://www.ratemydialplan.com" style="color: blue; text-decoration: underline;" target="_blank"><span style="color: blue;">http://www.ratemydialplan.com</span></a></span></div> <div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 11.5pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);">:<span>&nbsp;</span><a href="http://www.asterisk-jobs.com" style="color: blue; text-decoration: underline;" target="_blank"><span style="color: blue;">http://www.asterisk-jobs.com</span></a></span></div> <div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 11pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);">&nbsp;</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"> <span style="font-size: 11pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);">&nbsp;</span></div><div style="border-style: none none none solid; border-left: 1.5pt solid blue; padding: 0in 0in 0in 4pt;"><div><div style="border-style: solid none none; border-top: 1pt solid rgb(181, 196, 223); padding: 3pt 0in 0in;"> <div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><b><span style="font-size: 10pt; font-family: Tahoma,sans-serif;">From:</span></b><span style="font-size: 10pt; font-family: Tahoma,sans-serif;"><span>&nbsp;</span><a href="mailto:asterisk-users-bounces@lists.digium.com" style="color: blue; text-decoration: underline;" target="_blank">asterisk-users-bounces@lists.digium.com</a><span>&nbsp;</span>[<a href="mailto:asterisk-users-bounces@lists.digium.com" style="color: blue; text-decoration: underline;" target="_blank">mailto:asterisk-users-bounces@lists.digium.com</a>]<span>&nbsp;</span><b>On Behalf Of<span>&nbsp;</span></b>Robert Augustyn<br> <b>Sent:</b><span>&nbsp;</span>Saturday, January 10, 2009 2:45 PM<br><b>To:</b><span>&nbsp;</span><a href="mailto:asterisk-users@lists.digium.com" style="color: blue; text-decoration: underline;" target="_blank">asterisk-users@lists.digium.com</a><br> <b>Subject:</b><span>&nbsp;</span>[asterisk-users] How to monitor asterisk with SNMP?</span></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;">&nbsp;</div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"> <span style="font-size: 10pt; font-family: Arial,sans-serif;">Hi,</span></div></div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 10pt; font-family: Arial,sans-serif;">We have zabbix running and would love to be able to monitor our asterisk box with it.</span></div> </div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 10pt; font-family: Arial,sans-serif;">I believe that some sort of SNMP is build in 1.4+ correct?</span></div> </div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 10pt; font-family: Arial,sans-serif;">Where do I find more info or a how to on what is supported and how to use it?</span></div> </div><div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 10pt; font-family: Arial,sans-serif;">Thank you.</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"> <span style="font-size: 11pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);">&nbsp;</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: 'Times New Roman',serif;"><span style="font-size: 11pt; font-family: Calibri,sans-serif; color: rgb(31, 73, 125);">&nbsp;</span></div> </div></div></div></div></div>_______________________________________________<br>-- Bandwidth and Colocation Provided by<span>&nbsp;</span><a href="http://www.api-digital.com" style="color: blue; text-decoration: underline;" target="_blank">http://www.api-digital.com</a><span>&nbsp;</span>--<br> <br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br>&nbsp;&nbsp;<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" style="color: blue; text-decoration: underline;" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a></div> </span></blockquote></div><br></div></div></div></div><br>_______________________________________________<br> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br> <br> asterisk-users mailing list<br> To UNSUBSCRIBE or update options visit:<br> &nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br> _______________________________________________<br>-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com">http://www.api-digital.com</a> --<br><br>asterisk-users mailing list<br>To UNSUBSCRIBE or update options visit:<br> &nbsp;&nbsp;<a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a></blockquote></div><br></body></html>