See www.zabbix.com for the official Zabbix site.

ConfigureSnmptrapsCentos6 RHEL6

From Zabbix.org
Jump to: navigation, search

Install Packages

yum install net-snmp-utils
yum install net-snmp-perl
yum install snmptt
(perl-Net-SNMP will be installed together with snmptt)

Configure Service

chkconfig snmptt on
chkconfig snmptrapd on

Edit Zabbix Server Config

vi /etc/zabbix/zabbix_server.conf

StartSNMPTrapper=1
SNMPTrapperFile=/tmp/zabbix_traps.tmp

Edit snmptrapd Config

vi /etc/snmp/snmptrapd.conf

traphandle default snmptt
authCommunity   log,execute,net public

Edit snmptt Config

vi /etc/snmp/snmptt.ini

translate_log_trap_oid = 2
net_snmp_perl_enable = 1
date_time_format = %H:%M:%S %Y/%m/%d
log_file = /tmp/zabbix_traps.tmp
log_system_enable = 1

vi /etc/snmptt.conf

EVENT general .* "General event" Normal
FORMAT ZBXTRAP $aA $ar

Create an SNMP item TEST

Host's SNMP interface IP: 127.0.0.1
Key: snmptrap["General"]
Log time format: hh:mm:ss yyyy/MM/dd

Open Firewall & Start Services

vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m udp -p udp --dport 161 -j ACCEPT
service snmptrapd start
service snmptt start

Send an snmptrap

snmptrap -v 1 -c public 127.0.0.1 '.1.3.6.1.6.3.1.1.5.3' '0.0.0.0' 6 33 '55' .1.3.6.1.6.3.1.1.5.3 s “teststring000”

Configure SELinux

grep snmptt /var/log/audit/audit.log | audit2allow -M snmptt
semodule -i snmptt.pp

Send a New Trap

snmptrap -v 1 -c public 127.0.0.1 '.1.3.6.1.6.3.1.1.5.3' '0.0.0.0' 6 33 '55' .1.3.6.1.6.3.1.1.5.3 s “teststring000”

Based on the Zabbix Manual

https://www.zabbix.com/documentation/2.0/manual/config/items/itemtypes/snmptrap


Send comments & idea's to patrik<at>open-future.be