Monitoring Asterisk via SNMP

While Asterisk’s SNMP table is quite limited, it is still very useful.

Yesterday we committed a complete Asterisk MIB implementation to OSS_SNMP.

Before you can use it however, you’ll have to enable SNMP on your Asterisk host. There are instructions that work for me on Digium’s site here.

Once you have that working, you can query Asterisk over SNMP really easily as follows:

 $host = new \OSS_SNMP\SNMP( $asteriskIP, $community );
 echo "Asterisk version: " . $host->useAsterisk()->version();
 echo "Active calls: " . $host->useAsterisk()->callsActive();
 echo "Calls processed: " . $host->useAsterisk()->callsProcessed();

To add this this, we added a proof of concept Asterisk wallboard to NOCtools which includes active channels, uptime, version information and more. Here’s a screenshot:

[NOCtools Asterisk Wallboard]
NOCtools – Asterisk Wallboard
This entry was posted in Asterisk, How-tos, NOCtools, Open Source, OSS_SNMP, PHP and tagged , , , , . Bookmark the permalink.

One Response to Monitoring Asterisk via SNMP

  1. Pingback: BarryODonovan.com

Comments are closed.