Page 1 of 2

SNMP Traps going to Unknown

Posted: Mon Jul 31, 2017 2:17 pm
by tcanthonyii
I'm working to add eSensors to nagios. I have 10 of these, 1 -- aquoxe, 6 -- PM01XE and 3 -- EM32.

After using this document https://assets.nagios.com/downloads/nag ... 1496238764

I have determined that my sensors are dumping traps to the server but they are being logged to https://assets.nagios.com/downloads/nag ... 1496238764

Code: Select all

Mon Jul 31 11:50:45 2017: Unknown trap (.1.3.6.1.4.1.23718.3.1.0) received from 192.168.8.131 at:
Value 0: 192.168.8.131
Value 1: 192.168.8.131
Value 2: 15019
Value 3: .1.3.6.1.4.1.23718.3.1.0
Value 4: 192.168.8.131
Value 5:
Value 6:
Value 7:
Value 8:
Value 9:
Value 10:


Mon Jul 31 12:01:45 2017: Unknown trap (.1.3.6.1.4.1.23718.3.1.0) received from 192.168.8.131 at:
Value 0: 192.168.8.131
Value 1: 192.168.8.131
Value 2: 14844
Value 3: .1.3.6.1.4.1.23718.3.1.0
Value 4: 192.168.8.131
Value 5:
Value 6:
Value 7:
Value 8:
Value 9:
Value 10:


Mon Jul 31 12:03:09 2017: Unknown trap (.1.3.6.1.4.1.23718.3.1.0) received from 192.168.8.131 at:
Value 0: 192.168.8.131
Value 1: 192.168.8.131
Value 2: 13318
Value 3: .1.3.6.1.4.1.23718.3.1.0
Value 4: 192.168.8.131
Value 5:
Value 6:
Value 7:
Value 8:
Value 9:
Value 10:
In the troubleshooting guide it showed unconfigured objects. However when I go there, there are no objects that show as unconfigured. I also run per the testing doc from my nagioslog server a few test traps and they too show up in the unknown log.

I do have the esensors.mib file uploaded to nagios as well that was downloaded from esensors. Also I used the SNMP trap wizard on each of the hosts to monitor for traps.

From eSensors the OID's are as follows:

Code: Select all

1.3.6.1.4.1.23718.1	product
1.3.6.1.4.1.23718.1.1	name
1.3.6.1.4.1.23718.1.2	version
1.3.6.1.4.1.23718.1.3	date
1.3.6.1.4.1.23718.1.4	serial

1.3.6.1.4.1.23718.2.1.1.2.0	trapEnabled #1
1.3.6.1.4.1.23718.2.1.1.2.1	trapEnabled #2
1.3.6.1.4.1.23718.2.1.1.2.2	trapEnabled #3
1.3.6.1.4.1.23718.2.1.1.3.0	trapReceiverIPAddress #1
1.3.6.1.4.1.23718.2.1.1.3.1	trapReceiverIPAddress #2
1.3.6.1.4.1.23718.2.1.1.3.2	trapReceiverIPAddress #3
1.3.6.1.4.1.23718.2.1.1.4.0	trapCommunity #1
1.3.6.1.4.1.23718.2.1.1.4.1	trapCommunity #2
1.3.6.1.4.1.23718.2.1.1.4.2	trapCommunity #3

1.3.6.1.4.1.23718.3	measurements
1.3.6.1.4.1.23718.3.1	illumination
1.3.6.1.4.1.23718.3.2	humidity
1.3.6.1.4.1.23718.3.3	temperature
1.3.6.1.4.1.23718.3.4	temperature unit
1.3.6.1.4.1.23718.3.5 thermistor temperature	
1.3.6.1.4.1.23718.3.6 voltage input
1.3.6.1.4.1.23718.3.7 contact closure input
1.3.6.1.4.1.23718.3.8 flood sensor
I am running nagiosxi as an appliance on version 5.4.1

Any help is appreciated. This is my first foray into SNMP. I've successfully avoided for for years but now must get this working.

Thanks for all the help.

Re: SNMP Traps going to Unknown

Posted: Mon Jul 31, 2017 3:44 pm
by tgriep
If the OID's from that device are showing up in the snmpttunknown.log log file usually means that the MIB file was either not uploaded the Nagios XI system or that the file that was uploaded does not contain TRAP-TYPE OIDs so the information was not added to the /etc/snmp/snmptt.conf file.

When you upload the MIB file using the XI GUI, you will need to check the box called "Process Trap".
When you do that, it will add the TRAP OID's to the snmptt.conf file so the system can translate and forward the traps to the XI process.
When you uploaded the MIB, did you check the box? Try uploading it again and see if that fixes the issue for you.

Re: SNMP Traps going to Unknown

Posted: Tue Aug 01, 2017 8:21 am
by tcanthonyii
I did check the box. However I removed the MIB and re-added. Still a no go. On the browser through I see that the permissions are set for apache instead of root like all the other mibs and the permissions are rw-rw-r--. All others have rw-r--r--

Re: SNMP Traps going to Unknown

Posted: Tue Aug 01, 2017 10:12 am
by tgriep
Can you post the MIB file so I can see it and test with it?

Re: SNMP Traps going to Unknown

Posted: Tue Aug 01, 2017 10:21 am
by tcanthonyii
File name is esensor.mib and can be downloaded here: --- http://www.eesensors.com/media/wysiwyg/ ... h-SNMP.zip

Code: Select all

-- Esensors Inc. EM08 Device control MIB.
--
-- Author                   Date        Comment
-- ==================================================================
-- Yuan Ma         	    07/12/2011   Initial
--

Esensors DEFINITIONS ::= BEGIN

IMPORTS
   enterprises, IpAddress, Gauge, TimeTicks     FROM RFC1155-SMI
   DisplayString                                FROM RFC1213-MIB
   OBJECT-TYPE                                  FROM RFC-1212
   TRAP-TYPE                                    FROM RFC-1215;

esensors                           OBJECT IDENTIFIER ::=  { enterprises 23718 }

product                            OBJECT IDENTIFIER ::=  { esensors 1 }
setup                              OBJECT IDENTIFIER ::=  { esensors 2 }
measurements                       OBJECT IDENTIFIER ::=  { esensors 3 }
alarm                              OBJECT IDENTIFIER ::=  { esensors 4 }

--   On-Off          ::=   INTEGER { off(0), on(1) }


name    OBJECT-TYPE
   SYNTAX DisplayString
   ACCESS read-only
   STATUS mandatory
   DESCRIPTION
      "Name of product, EM08 websensor device."
   ::= { product 1 }
   

version    OBJECT-TYPE
   SYNTAX DisplayString
   ACCESS read-only
   STATUS mandatory
   DESCRIPTION
      "Version string"
   ::= { product 2 }
   
date    OBJECT-TYPE
   SYNTAX DisplayString
   ACCESS read-only
   STATUS mandatory
   DESCRIPTION
      "Date of version"
   ::= { product 3 }
      
serial  OBJECT-TYPE
   SYNTAX DisplayString
   ACCESS read-only
   STATUS mandatory
   DESCRIPTION
      "Device serial number"
   ::= { product 4 }  
   
      
illumination  OBJECT-TYPE
    SYNTAX  DisplayString
    ACCESS read-only
    STATUS mandatory
    DESCRIPTION
        "Illumination measurement string, unit is Lx"
    ::= { measurements 1 }   

humidity  OBJECT-TYPE
    SYNTAX  DisplayString
    ACCESS read-only
    STATUS mandatory
    DESCRIPTION
        "Relative humidity measurement string, unit is %"
    ::= { measurements 2 }     
    
temperature  OBJECT-TYPE
    SYNTAX  DisplayString
    ACCESS read-only
    STATUS mandatory
    DESCRIPTION
        "Temperature measurement string"
    ::= { measurements 3 }
    
tempUnit  OBJECT-TYPE
    SYNTAX INTEGER { fahrenheit(1), celsius(2) }
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "The temperature scale type, 1 is F, 2 is C"
    ::= { measurements 4 }
                        
thermistor  OBJECT-TYPE
    SYNTAX  DisplayString
    ACCESS read-only
    STATUS mandatory
    DESCRIPTION
        "Thermistor temperature measurement string"
    ::= { measurements 5 }    
    
voltage  OBJECT-TYPE
    SYNTAX  DisplayString
    ACCESS read-only
    STATUS mandatory
    DESCRIPTION
        "Voltage monitor measurement string, unit is vol"
    ::= { measurements 6 }
        
contactclosure  OBJECT-TYPE
    SYNTAX INTEGER { open(0), close(1) }
    ACCESS read-only
    STATUS mandatory
    DESCRIPTION
        "contact closure input status, 1 is close, 0 is open"
    ::= { measurements 7 }
        
Floodsensor  OBJECT-TYPE
    SYNTAX INTEGER { dry(0), wet(1) }
    ACCESS read-only
    STATUS mandatory
    DESCRIPTION
        "Flood sensor status, 1 is wet, 0 is dry"
    ::= { measurements 8 }
        
illumLower  OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..5))
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "Lower limit for illumination alarm, unit is Lx, e.g. 5.0. Trap alarm will be sent when illumination falls below this setting"
    ::= { alarm 1 }
    
illumUpper  OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..5))
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "Upper limit for illumination alarm, unit is Lx, e.g. 999. Trap alarm will be sent when illumination is above this setting"
    ::= { alarm 2 }    
    
humidityLower  OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..5))
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "Lower limit for relative humidity alarm, e.g. 10%. Trap alarm will be sent when humidity falls below this setting"
    ::= { alarm 3 }        
    
humidityUpper  OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..5))
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "Upper limit for relative humidity alarm, e.g. 80%. Trap alarm will be sent when humidity is above this setting"
    ::= { alarm 4 } 
    
tempLower  OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..6))
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "Lower limit for temperature alarm, unit is Fahrenheit, e.g. 15. Trap alarm will be sent when temperature falls below this setting"
    ::= { alarm 5 }
    
tempUpper  OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..6))
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "Upper limit for temperature alarm, unit is Fahrenheit, e.g. 120. Trap alarm will be sent when temperature is above this setting"
    ::= { alarm 6 }  
        
thmtLower  OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..6))
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "Lower limit for thermistor temperature alarm, unit is Fahrenheit, e.g. 15. Trap alarm will be sent when temperature falls below this setting"
    ::= { alarm 7 } 
        
thmtUpper  OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..6))
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "Upper limit for thermistor temperature alarm, unit is Fahrenheit, e.g. 120. Trap alarm will be sent when temperature is above this setting"
    ::= { alarm 8 } 
        
vinLower  OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..6))
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "Lower limit for voltage monitor alarm, unit is vol, e.g. 100. Trap alarm will be sent when voltage falls below this setting"
    ::= { alarm 9 } 
        
vinUpper  OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..6))
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "Upper limit for voltage monitor alarm, unit is vol, e.g. 120. Trap alarm will be sent when voltage is above this setting"
    ::= { alarm 10 }
    
cinAction  OBJECT-TYPE
    SYNTAX INTEGER { none(0), close(1), open(2)}
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "contact closure input trigger mode, 0: no action, 1:close,  2:open"
    ::= { alarm 11 } 
    
traps OBJECT-TYPE
    SYNTAX SEQUENCE OF TrapEntry
    ACCESS not-accessible
    STATUS mandatory
    DESCRIPTION
        "Trap table"
    ::= { setup 1 }        
    
trapEntry OBJECT-TYPE
    SYNTAX TrapEntry
    ACCESS not-accessible
    STATUS mandatory
    DESCRIPTION
        "Single trap entry containing trap receiver info."
    INDEX { trapReceiverNumber }
     ::= { traps 1 }
     
TrapEntry ::=
    SEQUENCE {
        trapReceiverNumber
            INTEGER,
        trapEnabled
            INTEGER,
        trapReceiverIPAddress
            IpAddress,
        trapCommunity
            DisplayString
    }            
    
trapReceiverNumber  OBJECT-TYPE
    SYNTAX INTEGER (0.. 4)
    ACCESS not-accessible
    STATUS mandatory
    DESCRIPTION
        "Index of trap receiver"
    ::= { trapEntry 1 }
    
trapEnabled OBJECT-TYPE
    SYNTAX INTEGER { no(0), yes(1) }
    ACCESS read-write
    STATUS mandatory
    DESCRIPTION
        "Indicates if this trap entry is enabled or not."
    ::= { trapEntry 2 }


trapReceiverIPAddress OBJECT-TYPE
    SYNTAX  IpAddress
    ACCESS  read-write
    STATUS mandatory
    DESCRIPTION
        "Trap receiver IP address"
    ::= { trapEntry 3 }

trapCommunity OBJECT-TYPE
    SYNTAX  DisplayString (SIZE (0..7))
    ACCESS  read-write
    STATUS mandatory
    DESCRIPTION
        "Trap community to be used by agent to send trap"
    ::= { trapEntry 4 }



END   

Re: SNMP Traps going to Unknown

Posted: Tue Aug 01, 2017 11:47 am
by tgriep
I took a look at the MIB file and to get the Traps imported in to the snmptt.conf file, there has to be OID's defined as TRAP-TYPE and I do not see any in that MIB file.
The program that imports those entries, looks for that option when it imports the MIB filed. If it is not there, then it does not add the entries and the received traps are unknown.
You can see if esensors has a MIB file with the traps or you can manually create them.
You can look at the KB article for instructions on creating your own.
https://support.nagios.com/kb/article/n ... orial.html

Here is an example of what a traps entry looks like from a MIB file.

Code: Select all

TRAP-TEST-MIB DEFINITIONS ::= BEGIN
        IMPORTS ucdExperimental FROM UCD-SNMP-MIB;

demotraps OBJECT IDENTIFIER ::= { ucdExperimental 990 }

demo-trap TRAP-TYPE
        STATUS current
        ENTERPRISE demotraps
        VARIABLES { sysLocation }
        DESCRIPTION "This is just a demo"
        ::= 17
END

Re: SNMP Traps going to Unknown

Posted: Tue Aug 01, 2017 1:28 pm
by tcanthonyii
I will check with them first. That document has a lot going on in it. I'll review that as well and let you know what I find.

Re: SNMP Traps going to Unknown

Posted: Tue Aug 01, 2017 4:22 pm
by tgriep
OK, let us know if you have any other questions.

Re: SNMP Traps going to Unknown

Posted: Wed Aug 02, 2017 10:33 am
by tcanthonyii
So I got with their support and they gave me a github site with a new wizard/plugin

https://github.com/Esensors/nagiosxi-wizard


I've applied what they ask but it still doesn't work. Running through their check wizard it says the service check commands are not defined anywhere. I'm still working with them to get this working as I think it will be ideal over SNMP.

Re: SNMP Traps going to Unknown

Posted: Wed Aug 02, 2017 1:02 pm
by tmcdonald
Sounds like you will need to take their config file:

https://github.com/Esensors/nagiosxi-wi ... sensor.cfg

and import it into XI:

https://assets.nagios.com/downloads/nag ... ios-XI.pdf