userdoc:tt_asterisk_snmp_monitoring

Asterisk SNMP Monitoring

Asterisk includes the res_snmp.so module designed to provide monitoring information via SNMP. Particularly useful when used together with Zabbix remote monitoring.

Note: AstLinux 1.1.2 or later is required

Example: /mnt/kd/snmp/snmpd.conf

com2sec notConfigUser default public

group notConfigGroup v1  notConfigUser
group notConfigGroup v2c notConfigUser

view all included .1
view system included .iso.org.dod.internet.mgmt.mib-2.system

access notConfigGroup "" any noauth exact all none none

syslocation Omaha, NE
syscontact AstLinux - www.astlinux-project.org

agentaddress udp:127.0.0.1:161

master agentx
agentXSocket /var/agentx/master
agentXPerms 0660 0550

sysObjectID .1.3.6.1.4.1.22736.1

Edit syslocation and syscontact for your location.

Apply snmpd.conf changes, restart snmpd service using CLI:

service snmpd stop
service snmpd init

With the system snmpd.conf changes applied, you should see useful information with the following commands.

Example snmp commands using CLI:

# Linux uname -a
snmpget -OQv -v2c -c public 127.0.0.1 SNMPv2-MIB::sysDescr.0

# System uptime
snmpget -OQv -v2c -c public 127.0.0.1 SNMPv2-MIB::sysUpTime.0

# List network interfaces
snmpwalk -OQv -v2c -c public 127.0.0.1 IF-MIB::ifDescr

Enable SNMP in Asterisk by editing /etc/asterisk/res_snmp.conf in the [general] section:

;
; Configuration file for res_snmp
;---------------------------------
;
; -- snip --

[general]
; We run as a subagent per default -- to run as a full 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

Apply the res_snmp.conf change in Asterisk, unload and load the res_snmp.so module, or restart the asterisk service.

With both the system snmpd.conf and Asterisk res_snmp.conf changes applied, you should see useful information with the following commands.

Example snmp commands using CLI:

# Walk Asterisk SNMP tree
snmpwalk -v2c -c public 127.0.0.1 ASTERISK-MIB::asterisk

# Asterisk Version
snmpget -OQv -v2c -c public 127.0.0.1 ASTERISK-MIB::astVersionString.0

# Number of active channels
snmpget -OQv -v2c -c public 127.0.0.1 ASTERISK-MIB::astNumChannels.0

# List active channels
snmpwalk -OQv -v2c -c public 127.0.0.1 ASTERISK-MIB::astChanName
  • userdoc/tt_asterisk_snmp_monitoring.txt
  • Last modified: 2016/06/28 18:48
  • by abelbeck