Issue for nagios monitoring SNMP Trap

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
michaelli
Posts: 115
Joined: Thu Jan 29, 2015 11:21 am

Issue for nagios monitoring SNMP Trap

Post by michaelli »

Hi,

To configure nagiosxi monitoring snmp trap service, I follow the below article but failed to get the trap messages in nagiosxi (Nagios XI 2014R2.5).

http://assets.nagios.com/downloads/nagi ... ios_XI.pdf

1. I run the below scripts to install extra package and snmptt package.
NagiosXI-SNMPTrap-setup.sh

2. Use SNMP Trap wizard to configure the device

3. In side client device, generate a SNMP trap messages and success

Code: Select all

snmptrap -v 2c -c public 172.31.4.166 '' NOTIFICATION-LOG-MIB::nlmLogVariableOctetStringVal SNMPv2-MIB::sysDescr s "`date`[INFO]-[CPLUS]-[CBT]: MySQL Dump execution failure. Please contact CBT DO during office hour."
Log /var/log/messages in nagiosxi

Code: Select all

Apr 12 13:38:13 nagiosxi snmptrapd[15922]: 2015-04-12 13:38:13 nagiosxir [UDP: [172.31.4.165]:55751->[172.31.4.166]]:#012.1.3.6.1.2.1.1.3.0 = Timeticks: (335143994) 38 days, 18:57:19.94#011.1.3.6.1.6.3.1.1.4.1.0 = OID: .1.3.6.1.2.1.92.1.3.2.1.8#011.1.3.6.1.2.1.1.1 = STRING: Sun Apr 12 13:38:13 HKT 2015[INFO]-[CPLUS]-[CBT]: MySQL Dump execution failure. Please contact CBT DO during office hour.
/var/log/snmptt/snmpttunknown.log, it shows the trap messages is unknow trap

Code: Select all

Sun Apr 12 13:38:13 2015: Unknown trap (.1.3.6.1.2.1.92.1.3.2.1.8) received from nagiosxir at:
Value 0: nagiosxir
Value 1: 172.31.4.165
Value 2: 38:18:57:19.94
Value 3: .1.3.6.1.2.1.92.1.3.2.1.8
Value 4: 172.31.4.165
Value 5:
Value 6:
Value 7:
Value 8:
Value 9:
Value 10:
Ent Value 0: .1.3.6.1.2.1.1.1=Sun Apr 12 13:38:13 HKT 2015[INFO]-[CPLUS]-[CBT]: MySQL Dump execution failure. Please contact CBT DO during office hour.
4. nagiosxi service snmp trap still keep "OK" status.

I further find nagios snmp trap article in google and follow below procedure.

http://xavier.dusart.free.fr/nagios/en/snmptraps.html

In step "Compiling MIBs", I execute below command but result is "Failed translations: 1"

Code: Select all

snmpttconvertmib --in=/usr/share/snmp/mibs/NOTIFICATION-LOG-MIB.txt --out=/etc/snmp/snmptt.confNOTIFICATION-LOG-MIB --exec='/usr/local/nagios/libexec/eventhandlers/submit_check_result $r TRAP 1'
Result:

Code: Select all

*****  Processing MIB file *****

snmptranslate version: NET-SNMP version: 5.7.3
severity: Normal

File to load is:        /usr/share/snmp/mibs/NOTIFICATION-LOG-MIB.txt
File to APPEND TO:      /etc/snmp/snmptt.confNOTIFICATION-LOG-MIB

MIBS environment var:   /usr/share/snmp/mibs/NOTIFICATION-LOG-MIB.txt
mib name: NOTIFICATION-LOG-MIB


Processing MIB:         NOTIFICATION-LOG-MIB
#
Line: 475
NOTIFICATION-TYPE: The
Enterprise: nlmLog
Looking up via snmptranslate: NOTIFICATION-LOG-MIB::The
Unknown object identifier: NOTIFICATION-LOG-MIB::The
OID:


Done

Total translations:        1
Successful translations:   0
Failed translations:       1
And no information update to SNMPTT configuration file.

In ngaiosxi server, I cannot find the below directory and file

Code: Select all

[root@nagiosxi /]# ls -ld /usr/local/nagios/libexec/eventhandlers
ls: cannot access /usr/local/nagios/libexec/eventhandlers: No such file or directory
[root@nagiosxi /]# ls -l /usr/local/nagios/libexec/eventhandlers/submit_check_result
ls: cannot access /usr/local/nagios/libexec/eventhandlers/submit_check_result: No such file or directory
Am I missing some steps so that I cannot configure the SNMP Trap service?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Issue for nagios monitoring SNMP Trap

Post by Box293 »

michaelli wrote:I further find nagios snmp trap article in google and follow below procedure.

http://xavier.dusart.free.fr/nagios/en/snmptraps.html

In step "Compiling MIBs", I execute below command but result is "Failed translations: 1"

Code: Select all

snmpttconvertmib --in=/usr/share/snmp/mibs/NOTIFICATION-LOG-MIB.txt --out=/etc/snmp/snmptt.confNOTIFICATION-LOG-MIB --exec='/usr/local/nagios/libexec/eventhandlers/submit_check_result $r TRAP 1'


Result:

Code: Select all

    *****  Processing MIB file *****

    snmptranslate version: NET-SNMP version: 5.7.3
    severity: Normal

    File to load is:        /usr/share/snmp/mibs/NOTIFICATION-LOG-MIB.txt
    File to APPEND TO:      /etc/snmp/snmptt.confNOTIFICATION-LOG-MIB

    MIBS environment var:   /usr/share/snmp/mibs/NOTIFICATION-LOG-MIB.txt
    mib name: NOTIFICATION-LOG-MIB


    Processing MIB:         NOTIFICATION-LOG-MIB
    #
    Line: 475
    NOTIFICATION-TYPE: The
    Enterprise: nlmLog
    Looking up via snmptranslate: NOTIFICATION-LOG-MIB::The
    Unknown object identifier: NOTIFICATION-LOG-MIB::The
    OID:


    Done

    Total translations:        1
    Successful translations:   0
    Failed translations:       1
Can you please upload the MIB file via the XI GUI:
Admin > System Extensions > Manage MIBs
Make sure the Process Trap box is ticked.

If this does not work then please attach the MIB file here.

What should happen is Nagios XI will create a file in /usr/share/snmp/mibs/processed_mibs/ with EVENTs for any traps it finds in the MIB.

When these EVENTs are matched to incoming SNMP Traps, it will be logged in /var/log/snmptt/snmptt.log AND will be submitted to Nagios as a Passive service check.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
michaelli
Posts: 115
Joined: Thu Jan 29, 2015 11:21 am

Re: Issue for nagios monitoring SNMP Trap

Post by michaelli »

Hi Box293,

Thanks for your reply. Actually, the file "NOTIFICATION-LOG-MIB.txt" is already exist in /usr/share/snmp/mibs/.

In nagiosxi, I just download this file and then follow your instruction to upload, check "process trap" and then click "upload MIB".

But it has the follow message in result

Code: Select all

Uploaded file had one or more failed translations when converting to snmptt mib.
In /usr/share/snmp/mibs, I see the directory "processed_mibs" (before it doesn't has this directory)

Code: Select all

-rw-rw-r-- 1 apache apache  24694 Apr 13 15:34 NOTIFICATION-LOG-MIB.txt
drwxr-sr-x 2 apache nagios   4096 Apr 13 15:34 processed_mibs
I try to download the "NOTIFICATION-LOG-MIB.txt" in the internet. But it is still failed for translations.

http://www.opensource.apple.com/source/ ... IB.txt?txt
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Issue for nagios monitoring SNMP Trap

Post by ssax »

Here is a fixed version of the MIB, there was a problem with one of the descriptions, there are no traps in that file though so when you upload it through the XI web interface you shouldn't select process traps.
NOTIFICATION-LOG-MIB.txt
You do not have the required permissions to view the files attached to this post.
michaelli
Posts: 115
Joined: Thu Jan 29, 2015 11:21 am

Re: Issue for nagios monitoring SNMP Trap

Post by michaelli »

Hi ssax,

When I upload the MIB file to nagiosxi GUI, it shows below messages.

Code: Select all

SNMP MIBs

Total translations: 0
Successful translations: 0
MIB is added, but is does not contain any TRAP-TYPE definitions, so no traps were added, even though user input said there should be traps specified.
And the content of /usr/share/snmp/mibs/processed_mibs/NOTIFICATION-LOG-MIB.txt show below

Code: Select all

[root@nagiosxi processed_mibs]# cat NOTIFICATION-LOG-MIB.txt
#
#
#
#
MIB: NOTIFICATION-LOG-MIB (file:/usr/share/snmp/mibs/NOTIFICATION-LOG-MIB.txt) converted on Tue Apr 14 12:41:15 2015 using snmpttconvertmib v1.4beta2
[root@nagiosxi processed_mibs]# pwd
/usr/share/snmp/mibs/processed_mibs
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Issue for nagios monitoring SNMP Trap

Post by jdalrymple »

As ssax indicated - there are no traps in that MIB. Your SNMP provider is never going to generate a trap for that OID.

I guess the weird thing is that I didn't know that the snmptrap binary would let you send a trap from a non-trap OID in a MIB.

I suggest looking at the troubleshooting section of our NagiosXI config document and start by testing your traps there using our procedure.

http://assets.nagios.com/downloads/nagi ... ios_XI.pdf
Locked