You are on page 1of 5
020%8 How To: Monitor Asterisk wth SNMP © Google + oxilla ‘VoIP and mobile communications news and information * Home All Content Residential VoIP Business VoIP » Hardware Mobile VoIP. * News Spotlight How-to Forum Contact Voxilla How To: Monitor Aster! February 3, 2009 By Eric Chamberlain sk with SNMP We needed a better way to monitor and track performance of RE.com’s Asterisk 1.6 boxes. We learned quickly that the scarce documentation for configuring Asterisk to use Simple Network Management Protocol (SNMP) is conflicting and outdated. So we decided to share our configuration and hopefully save others a lot of time and head-scratching, Downloading the Asterisk 1.6 source code Enabling SNMP support in Asterisk requires a rebuild of Asterisk. If you already have the Asterisk source code on your Asterisk server, open a terminal session with the Asterisk box and navigate to the Asterisk source code directory, then skip to Installing Net-SNMP. Ifyou don’t have the Asterisk source code on your Asterisk server, open a terminal session with the Asterisk box and copy these instructions to the command line: ‘get asterisk source # create source dit mkdir -p /usr/sre/digium ed /ust/ste/digium’ wget http://downloads.digium.com/pub/asterisk/asterisk-1.6-current tar.gz tar xzvf asterisk-1.6- current.tar.gz cd asterisk-1.6.* Installing Net-SNMP Asterisk SNMP support is provided by the res_snmp module. To build this module, you need to install the following packages: Fipsivaxla com/20002103!conigurng-asterisk-srmp-suppor! 4s ararote How To: Monitor Asterisk with SNMP ‘= netsnmp ‘+ net-snmp-devel ‘+ net-snmp-utils «= bzip2 + bzip2-devel Im_sensors Im_sensors-devel newt newt-devel Ona CentOS or Fedora box you can use the following command to instal all the packages at once: yum -y install net-snmp net-snmp-devel net-snmp-utils bzip2-devel newt-devel Im_sensors-devel ; # snmp support —res_snmp Preparing the Asterisk box Once the necessary packages are installed, run the following commands from the Asterisk source code directory: feonfigure make menusclect Running make menuselect will launch a menu that looks something like the image below. Asterisk Module and Build Options Selection Select the Resource Modules option from the menu and press the Return key. Then scroll down to res_snmp, if res_snimp is not selected, press the spacebar to enable res_snmp. The selection should now look like the image below. ipsvaxla com/200302103!conigurng-asterisk-srmp-suppor! 25 020%8 How To: Monitor Asterisk wth SNMP Asterisk resource modules If you are unable to select res_snmp, it means the Net-SNMP package was not installed properly or the Asterisk configure tool was unable to find the Net-SNMP package. Try running .configure -with-netsnmp from the command line and then re-run make menuselect. Press x to save your configuration changes. Now we can build Asterisk with SNMP support and install it by runing the following commands make /etc/init.d/asterisk stop ; # make sure asterisk is stopped before installing ‘make install Configuring the SNMP daemon There are three versions of SNMP, but two are insecure and should not be used over an untrusted network. We chose SNMPV3, which requires authentication and encryption from the asteriskUser when it connects to the server, To create an SNMPv3 user account and to configure it to require authentication and encryption, run the commands below, replacing change_this_password with your own password. echo "# Asterisk user rwuser asteriskUser priv createUser asteriskUser SHA change this password AES >> /ete/snmp/snmpd.conf Asterisk uses AgentX to communicate with the SNMP daemon. Run the command below to configure the SNMP daemon for AgentX. If your Asterisk daemon, does not run as a member of the asterisk group, replace asterisk in the agentXPerms command with an asterisk daemon group. echo * # Asterisk configuration master agentx agentXsocket /var/agentx/master agentxPerns @668 @550 nobody asterisk ">>. Jete/snmp/snmpd.conf ipsvaxla com/200302103!conigurng-asterisk-srmp-suppor!

You might also like