Nagios SNMP Trap Configuration: Difference between revisions

From UNIX Systems Administration
Jump to navigation Jump to search
(Created page with "== 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 # E...")
 
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== SNMP Trap Configuration ==
== SNMP Trap Configuration ==
# Install the following RHEL/CentOS packages
# Install the following RHEL/CentOS packages.
## net-snmp
## '''<tt>net-snmp</tt>'''
## net-snmp-libs
## '''<tt>net-snmp-libs</tt>'''
## net-snmp-agent-libs
## '''<tt>net-snmp-agent-libs</tt>'''
## net-snmp-utils
## '''<tt>net-snmp-utils</tt>'''
## net-snmp-perl
## '''<tt>net-snmp-perl</tt>'''
## snmptt
## '''<tt>snmptt</tt>'''
# Edit the '''<tt>/etc/sysconfig/snmptrapd</tt>'''
# Edit the '''<tt>/etc/sysconfig/snmptrapd</tt>''' file.
## Set the '''<tt>OPTIONS</tt>'' line to reflect '''<tt>OPTIONS="-Lsd -On"</tt>'''
## Set the '''<tt>OPTIONS</tt>''' line to reflect '''<tt>OPTIONS="-Lsd -On"</tt>'''.
# Edit the '''<tt>/etc/snmp/snmptrapd.conf</tt>''' file.
## Add or modify the lines in the file with the following information.
<pre>
authCommunity  log,execute,net public
disableAuthorization yes
traphandle default snmptt
</pre>
# Edit the '''<tt>/etc/snmp/snmptt.ini</tt>''' file.
## Find the '''<tt>[TrapFiles]'''</tt> stanza and modify it to be similar to below.
<pre>
[TrapFiles]
snmptt_conf_files = <<END
/etc/snmp/snmptt.conf
/etc/snmp/snmptt.conf.<new MIB file>
END
</pre>
# Copy the '''<tt>nagios-<version>/contrib/eventhandlers'''</tt> directory to the '''<tt>nagios'''</tt> install directory under '''<tt>libexec'''</tt>.
# Edit your Nagios templates file.
## Add a new service template with the following information.  This is a minimal configuration, modify as per environment.
<pre>
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!
}
</pre>

Latest revision as of 16:54, 14 April 2015

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!
}