You are on page 1of 2


SNMP with Asterisk 1.6

Created: 28 Jan 2011 8:44 AM

This knowledge base article describes how to install and configure the Simple Network Management Protocol (SNMP).

Install the Net-SNMP Package

To install the package, you have to follow the next steps: Log in as root to your VoipNow Professional server using your favorite SSH console (e.g.: Putty). Run: yum -c /etc/voipnow/voipnow-yum.conf install net-snmp Usually, this is package is already installed on VoipNow 2.0.0 or newr versions.

Configure SNMPD
To configure the snmpd package, follow the next steps: Copy the asterisk-mib.txt and the digium-mib.txt files from /usr/share/doc/voipnow-asterisk-1.6.xx/ to /usr/share/snmp/mibs. Add the following to the /etc/snmp/snmpd.conf file:
rocommunity MY_VOIPNOW syslocation SYS_PATH syscontact ADMIN [ADMIN@HOSTNAME] master agentx agentXperms 0660 0550 nobody asterisk agentuser asterisk agentgroup asterisk com2sec local localhost MY_VOIPNOW com2sec local NETWORK/24 MY_VOIPNOW group MyROGroup any local view all included .1 access MyROGroup "" v1 noauth exact all none none

where: MY_VOIPNOW is the name of the snmp community. Do not forget to replace it everywhere, if changed. SYS_PATH is the system location. ADMIN@HOSTNAME is the administrator's email address. NETWORK/24 is the network address allowed to gather data. Add the following to the /etc/snmp/snmp.conf file:
Page 1/2 4PSA Support Zone

mibs +ASTERISK-MIB Enable the snmp Asterisk module (edit /etc/asterisk/res_snmp.conf):

; ; Configuration file for res_snmp ; [general] ; We run as a subagent per default -- to run as a agent ; we must run as root (to be able to bind to port 161) subagent = yes ; SNMP must be explicitly enabled to be active enabled = yes

Create the /var/agentx directory and change modes: chmod /var/agentx 777 Start snmpd and snmptrapd by running: /etc/init.d/snmpd start /etc/init.d/snmptrapd start After starting snmpd, the agentx socket will be created in the /var/agentx/master directory. Due to a bug in snmpd, the owner and group will be root:root. In order to enable the Asterisk connection with the socket, you have to change permissions after each restart: chown asterisk:asterik /var/agentx/master Restart Asterisk. It should connect to the agentx socket, so check out /var/log/messages for confirmation. Test the installation: export MIBS=+ASTERISK-MIB snmpwalk -c MY_VOIPNOW -v 1 localhost asterisk This should print all the snmp parameters from the Asterisk mib.

The SNMP Information Provided by Asterisk

Asterisk provides 5 information classes through snmp: asteriskVersion - Asterisk version information. asteriskConfiguration - Configuration information. asteriskModules - Asterisk modules information. asteriskIndications - Country information. asteriskChannels - Channel information.

Page 2/2 4PSA Support Zone