Nagios SNMP Trap Configuration

From UNIX Systems Administration
Jump to navigation Jump to search

SNMP Trap Configuration

  1. Install the following RHEL/CentOS packages.
    1. net-snmp
    2. net-snmp-libs
    3. net-snmp-agent-libs
    4. net-snmp-utils
    5. net-snmp-perl
    6. snmptt
  2. Edit the /etc/sysconfig/snmptrapd file.
    1. Set the OPTIONS line to reflect OPTIONS="-Lsd -On".
  3. Edit the /etc/snmp/snmptrapd.conf file.
    1. Add or modify the lines in the file with the following information.
authCommunity   log,execute,net public
disableAuthorization yes
traphandle default snmptt
  1. Edit the /etc/snmp/snmptt.ini file.
    1. 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
  1. Copy the nagios-<version>/contrib/eventhandlers directory to the nagios install directory under libexec.
  2. Edit your Nagios templates file.
    1. 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!
}