SNMP TRAP not displayed in NAGIOS

Information and discussions relating to the NSTI (Nagios SNMP Trap Interface) addon.

SNMP TRAP not displayed in NAGIOS

Postby yellowdog » Mon Dec 02, 2019 9:20 am

Hello,

I have configured a QNAS to report SNMP TRAP to my NAGIOS server, but nothing appears in NAGIOS.
I compiled the MIB and added the reference in /etc/snmp/snmptt.ini
I copied the MIB files in /usr/share/snmp/mibs/

When a TRAP is sent to NAGIOS, I have the following:

in /var/log/messages:

Code: Select all
Nov 28 10:47:55 GLNXNGIOS snmptrapd[2823]: 2019-11-28 10:47:55 taurusfs.domgrosfillex.com [128.1.101.162] (via UDP: [128.1.101.162]:50144) TRAP, SNMP v1, community public      .1.3.6.1.4.1.24681.1.10 Enterprise Specific Trap (1) Uptime: 94 days, 2:57:32.62        .1.3.6.1.4.1.24681.1.1.101.0 = STRING: "[SNMP] Enabled/modified."
Nov 28 10:47:58 GLNXNGIOS snmptt[32645]: .1.3.6.1.4.1.24681.1.10.0.1 Normal "Status Events" taurusfs - Info: [SNMP] Enabled/modified.
Nov 28 10:47:58 GLNXNGIOS nagios: ndomod: Still unable to connect to data sink.  22329 items lost, 5000 queued items to flush.
Nov 28 10:47:58 GLNXNGIOS snmptt[32645]: .1.3.6.1.4.1.24681.1.10.0.1 Normal "Status Events" IpAddress: 128 - Info: [SNMP] Enabled/modified.


in /var/log/snmptt/snmptthandler.debug

Code: Select all
SNMPTTHANDLER started: Thu Nov 28 10:47:55 2019

s = 1574934475, usec = 525610
s_pad = 1574934475, usec_pad = 525610

Data received:

taurusfs.domgrosfillex.com

UDP: [128.1.101.162]:50144

.1.3.6.1.2.1.1.3.0 94:2:57:32.62

.1.3.6.1.6.3.1.1.4.1.0 .1.3.6.1.4.1.24681.1.10.0.1

.1.3.6.1.4.1.24681.1.1.101.0 "[SNMP] Enabled/modified."

.1.3.6.1.6.3.18.1.3.0 128.1.101.162

.1.3.6.1.6.3.18.1.4.0 "public"

.1.3.6.1.6.3.1.1.4.3.0 .1.3.6.1.4.1.24681.1.10

  .1.3.6.1.2.1.1.3.0             type=67 value=Timeticks: (813225262) 94 days, 2:57:32.62
  .1.3.6.1.6.3.1.1.4.1.0         type=6  value=OID: .1.3.6.1.4.1.24681.1.10.0.1
  .1.3.6.1.4.1.24681.1.1.101.0   type=4  value=STRING: "[SNMP] Enabled/modified."
  .1.3.6.1.6.3.18.1.3.0          type=64 value=IpAddress: 128.1.101.162
  .1.3.6.1.6.3.18.1.4.0          type=4  value=STRING: "public"
  .1.3.6.1.6.3.1.1.4.3.0         type=6  value=OID: .1.3.6.1.4.1.24681.1.10
-------------------------------------------------------------
SNMPTTHANDLER-EMBEDDED started: Thu Nov 28 10:47:55 2019

Nothing in /var/log/snmptt/snmpttunknown.log

in /var/log/snmptt/snmptt.log

Code: Select all
Thu Nov 28 10:47:55 2019 .1.3.6.1.4.1.24681.1.10.0.1 Normal "Status Events" taurusfs - Info: [SNMP] Enabled/modified.
Thu Nov 28 10:47:55 2019 .1.3.6.1.4.1.24681.1.10.0.1 Normal "Status Events" IpAddress: 128 - Info: [SNMP] Enabled/modified.


My NAGIOS CFG file is:

Code: Select all
define host{
        use             windows-server  ; Inherit default values from a template
        host_name       taurusfs  ; The name we're giving to this host
        alias           TRAP QNAP ATELIER NUMERIQUE
        address         128.1.101.162
        hostgroups      Divers_Hosts
        }

define hostgroup{
        hostgroup_name  Divers_Hosts    ; The name of the hostgroup
        alias           Devices ; Long name of the group
        }

define service{
host_name       taurusfs
use             snmptrap-service
}

Thank you for helping me.
yellowdog
 
Posts: 18
Joined: Mon Dec 02, 2013 7:22 am

Re: SNMP TRAP not displayed in NAGIOS

Postby cdienger » Mon Dec 02, 2019 4:05 pm

Do you see ndo2db running if you run:

Code: Select all
ps aux | grep ndo


If not, try starting it with:

Code: Select all
/usr/local/nagios/bin/ndo2db -c /usr/local/nagios/etc/ndo2db.cfg -f


Also look in nagios.log to see if the snmp messages are getting logged to Nagios when then come in:

Code: Select all
tail -f /usr/local/nagios/var/nagios.log


You'd see entries like the following for any traps coming in that don't yet have a config in Nagios:

Code: Select all
[1514933633] Error: Got host checkresult for 'somehost', but no such host can be found
[1514933633] Error: Got check result for service 'someservice' on host 'somehost'. Unable to find service
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 3849
Joined: Tue Feb 07, 2017 11:26 am

Re: SNMP TRAP not displayed in NAGIOS

Postby yellowdog » Tue Dec 03, 2019 4:32 am

ndo2db is running on the server

The nagios.log shows the TRAP from the device named taurusfs but nothing on the NAGIOS console.


Code: Select all
[root@GLNXNGIOS ~]# tail -f /var/log/nagios/nagios.log
[1575362575] ndomod: Still unable to connect to data sink.  6085833 items lost, 5000 queued items to flush.
[1575362584] HOST ALERT: taurusfs;DOWN;SOFT;1;PING CRITICAL - Packet loss = 100%
yellowdog
 
Posts: 18
Joined: Mon Dec 02, 2013 7:22 am

Re: SNMP TRAP not displayed in NAGIOS

Postby cdienger » Tue Dec 03, 2019 5:44 pm

ndomod is running into issues:

Code: Select all
[1575362575] ndomod: Still unable to connect to data sink.  6085833 items lost, 5000 queued items to flush.


Was /usr/local/nagios/etc/ndo2db.cfg modified? Is the database offloaded to another server?

I'd like you to PM me a profile if the above doesn't help you track down the issue. It can be generated under Admin > System Config > System Profile > Download Profile, or from the command line with:

Code: Select all
/usr/local/nagiosxi/html/includes/components/profile/getprofile.sh 12345


The profile is then saved to:

Code: Select all
/usr/local/nagiosxi/var/components/profile.zip
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 3849
Joined: Tue Feb 07, 2017 11:26 am

Re: SNMP TRAP not displayed in NAGIOS

Postby yellowdog » Thu Dec 05, 2019 7:08 am

The ndo2db.cfg has never been modified, the content is here:

Code: Select all
#####################################################################
# NDO2DB DAEMON CONFIG FILE
#
# Last Modified: 01-02-2009
#####################################################################



# LOCK FILE
# This is the lockfile that NDO2DB will use to store its PID number
# in when it is running in daemon mode.

lock_file=/var/ndo2db.lock



# USER/GROUP PRIVILIGES
# These options determine the user/group that the daemon should run as.
# You can specify a number (uid/gid) or a name for either option.

ndo2db_user=nagios
ndo2db_group=nagios



# SOCKET TYPE
# This option determines what type of socket the daemon will create
# an accept connections from.
# Value:
#   unix = Unix domain socket (default)
#   tcp  = TCP socket

#socket_type=unix
socket_type=tcp



# SOCKET NAME
# This option determines the name and path of the UNIX domain
# socket that the daemon will create and accept connections from.
# This option is only valid if the socket type specified above
# is "unix".

socket_name=/usr/local/nagios/var/ndo.sock


# TCP PORT
# This option determines what port the daemon will listen for
# connections on.  This option is only vlaid if the socket type
# specified above is "tcp".

tcp_port=5668



# ENCRYPTION
# This option determines if the ndo2db daemon will accept SSL to encrypt the
# network traffic between module and ndo2db daemon.
# Both sides have to enable this feature which depends on SSL Libraries
# like openssl or kerberos
# This option is only valid if the output type
# option specified above is "tcpsocket".
#
# A value of '1' will enable this feature

use_ssl=0



# DATABASE SERVER TYPE
# This option determines what type of DB server the daemon should
# connect to.
# Values:
#       mysql = MySQL
#       pgsql = PostgreSQL

db_servertype=mysql



# DATABASE HOST
# This option specifies what host the DB server is running on.

db_host=localhost



# DATABASE PORT
# This option specifies the port that the DB server is running on.
# Values:
#       3306 = Default MySQL port
#       5432 = Default PostgreSQL port

db_port=3306



# DATABASE NAME
# This option specifies the name of the database that should be used.

db_name=ndo



# DATABASE TABLE PREFIX
# Determines the prefix (if any) that should be prepended to table names.
# If you modify the table prefix, you'll need to modify the SQL script for
# creating the database!

db_prefix=nagios_



# DATABASE USERNAME/PASSWORD
# This is the username/password that will be used to authenticate to the DB.
# The user needs at least SELECT, INSERT, UPDATE, and DELETE privileges on
# the database.

db_user=ndouser
db_pass=ndopassword



## TABLE TRIMMING OPTIONS
# Several database tables containing Nagios event data can become quite large
# over time.  Most admins will want to trim these tables and keep only a
# certain amount of data in them.  The options below are used to specify the
# age (in MINUTES) that data should be allowd to remain in various tables
# before it is deleted.  Using a value of zero (0) for any value means that
# that particular table should NOT be automatically trimmed.

# Keep timed events for 24 hours
max_timedevents_age=1440

# Keep system commands for 1 week
max_systemcommands_age=10080

# Keep service checks for 1 week
max_servicechecks_age=10080

# Keep host checks for 1 week
max_hostchecks_age=10080

# Keep event handlers for 31 days
max_eventhandlers_age=44640

# Keep external commands for 31 days
max_externalcommands_age=44640




# DEBUG LEVEL
# This option determines how much (if any) debugging information will
# be written to the debug file.  OR values together to log multiple
# types of information.
# Values: -1 = Everything
#          0 = Nothing
#          1 = Process info
#          2 = SQL queries

debug_level=-1



# DEBUG VERBOSITY
# This option determines how verbose the debug log out will be.
# Values: 0 = Brief output
#         1 = More detailed
#         2 = Very detailed

debug_verbosity=1



# DEBUG FILE
# This option determines where the daemon should write debugging information.

debug_file=/var/ndo2db.debug



# MAX DEBUG FILE SIZE
# This option determines the maximum size (in bytes) of the debug file.  If
# the file grows larger than this size, it will be renamed with a .old
# extension.  If a file already exists with a .old extension it will
# automatically be deleted.  This helps ensure your disk space usage doesn't
# get out of control when debugging.

max_debug_file_size=1000000



I do have only have one NAGIOS server.

I don't believe the problem is linked with ndo2db, because I have already configured 15 other devices with SNMP TRAPS in the past and it works fine with it.
yellowdog
 
Posts: 18
Joined: Mon Dec 02, 2013 7:22 am

Re: SNMP TRAP not displayed in NAGIOS

Postby cdienger » Thu Dec 05, 2019 5:00 pm

I'm still suspicious of messages like:

Code: Select all
[1575362575] ndomod: Still unable to connect to data sink.  6085833 items lost, 5000 queued items to flush.


but if other traps and everything else seems to be working then we look past it for now.

This entry:

Code: Select all
[1575362584] HOST ALERT: taurusfs;DOWN;SOFT;1;PING CRITICAL - Packet loss = 100%


Is not a passive check. If you're not seeing passive checks from taurusfs or seeing something like:

Code: Select all
[1514933633] Error: Got check result for service 'someservice' on host 'somehost'. Unable to find service


Then the next step would be to review the /etc/snmp/snmptt.conf which is what is responsible for calling the script to submit the trap to nagios.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
cdienger
Support Tech
 
Posts: 3849
Joined: Tue Feb 07, 2017 11:26 am


Return to Nagios SNMP Trap Interface

Who is online

Users browsing this forum: No registered users and 2 guests