Nagios SNMP Trap Configuration
Jump to navigation
Jump to search
SNMP Trap Configuration
- Install the following RHEL/CentOS packages.
- net-snmp
- net-snmp-libs
- net-snmp-agent-libs
- net-snmp-utils
- net-snmp-perl
- snmptt
- Edit the /etc/sysconfig/snmptrapd file.
- Set the OPTIONS line to reflect OPTIONS="-Lsd -On".
- Edit the /etc/snmp/snmptrapd.conf file.
- Add or modify the lines in the file with the following information.
authCommunity log,execute,net public disableAuthorization yes traphandle default snmptt
- Edit the /etc/snmp/snmptt.ini file.
- Find the [TrapFiles] stanza and modify it to be similar to below.
[TrapFiles] snmptt_conf_files = <<END /etc/snmp/snmptt.conf /etc/snmp/snmptt.conf.<new MIB file> END
- Copy the nagios-<version>/contrib/eventhandlers directory to the nagios install directory under libexec.
- Edit your Nagios templates file.
- Add a new service template with the following information. This is a minimal configuration, modify as per environment.
define service { name snmptrap-service use generic-service ; Inherit default values from the generic-service definition is_volatile 1 ; Service is volatile check_period none ; The check is NEVER initiated by the Nagios Server notification_interval 15 ; Re-notify about service problems every 15 minutes max_check_attempts 1 ; Check the service up to 2 times in order to determine its final (hard) state check_command check-host-alive ; This is used to manually "reset" the status of the service register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE! }