Setup snmp and snmptrap monitoring under Zabbix

Jephe Wu -

Objective: understanding snmp, snmptrap under zabbix

Note:For zabbix, –with-net-snmp zabbix compiling option is not needed if you only want to receive traps. if you also want to poll snmp, then it is required.

part I - snmp monitoring - snmpget, snmpwalk

1. snmp items with zabbix
refer to[]=snmp&s[]=item

2. get snmp item name
# snmpwalk snmpserver -v1 -c public
# snmpwalk -c public -v 2c ipaddress

root@snmp:~/ # snmpget -c public -v 1 .
SNMPv2-SMI::enterprises. = Gauge32: 9

Note: is a cisco ipsec mib at, refer to cikeGlobalActiveTunnels

Refer to free snmp MIB library at

Part II - snmptrap

1. snmptrapd.conf 
root@snmptrap:/etc/snmp/ # chkconfig --list snmptrapd
snmptrapd       0:off 1:off 2:on 3:on 4:on 5:on 6:off

root@snmptrap:/etc/snmp/ # /etc/init.d/snmptrapd status
snmptrapd (pid  27227) is running...

root@snmptrap:/etc/snmp/ # more snmptrapd.conf 
authCommunity execute public
authCommunity execute PUBLIC
disableAuthorization yes
#log syslog
traphandle default /usr/bin/
traphandle default /usr/bin/perl /usr/bin/traptoemail -s -f snmptrap@snmptrap.domain

Note: if community string is not public, please change the first/second line.
refer to for traphandle perl script

2. test it from snmptrap server itself, you should receive email.
# snmptrap -Ci -v 2c -c public localhost "" "NET-SNMP-MIB::netSnmpExperimental" NET-SNMP-MIB:netSnmpExperimental s "test"

root@snmptrap:/etc/snmp/ # which snmptrap
root@snmptrap:/etc/snmp/ # rpm -qf /usr/bin/snmptrap

Note: you might want to look at SNMPTT at 

3. sample zabbix templates for snmp devices

Part III - References  (better to use for snmp walk)  (absolutely free, for snmpwalk, put in the Object ID column, then click 'snmpwalk' button)