nagios snmp

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
nshahorchard
Posts: 16
Joined: Wed Aug 14, 2013 10:47 am

nagios snmp

Post by nshahorchard »

Okay, So i went ahead and install the check_snmp plugin. I downloaded some of the 3rd party MIB files from the respective websites. Once I've downloaded them, I uploaded them into /usr/share/snmp/mibs directory. Here is some examples of the OIDs provided:

SUPERMICRO-HEALTH-MIB smHealthMIB 1.3.6.1.4.1.10876.2.1
SUPERMICRO-HEALTH-MIB smHealthObjects 1.3.6.1.4.1.10876.2.1.1
SUPERMICRO-HEALTH-MIB smHealthMonitorTable 1.3.6.1.4.1.10876.2.1.1.1
SUPERMICRO-HEALTH-MIB smHealthMonitorEntry 1.3.6.1.4.1.10876.2.1.1.1.1
SUPERMICRO-HEALTH-MIB smHealthMonitorIndex 1.3.6.1.4.1.10876.2.1.1.1.1.1


When I run the following, im getting an error:

./check_snmp -H 192.168.XX.XX -C public -o 1.3.6.1.4.1.10876.2.1
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.4.1.10876.2.1


What am I doing wrong?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: nagios snmp

Post by abrist »

You may want to walk the device first, if it works, then try focusing on specific oids::

Code: Select all

snmpwalk -v1 -c public 192.168.xx.xx
Or for snmp v2c:

Code: Select all

snmpwalk -v2c -c public 192.168.xx.xx
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
nshahorchard
Posts: 16
Joined: Wed Aug 14, 2013 10:47 am

Re: nagios snmp

Post by nshahorchard »

So, I've already done that and received a bunch of output:

Example -

HOST-RESOURCES-MIB::hrSWRunParameters.1824 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.1860 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.1900 = STRING: " "
HOST-RESOURCES-MIB::hrSWRunParameters.1992 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.2100 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.2236 = STRING: " "
HOST-RESOURCES-MIB::hrSWRunParameters.2416 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.2428 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.2700 = STRING: " "
HOST-RESOURCES-MIB::hrSWRunParameters.2712 = ""
HOST-RESOURCES-MIB::hrSWRunParameters.2772 =
nshahorchard
Posts: 16
Joined: Wed Aug 14, 2013 10:47 am

Re: nagios snmp

Post by nshahorchard »

I guess my question would be, how do i find out the OIDs from the output of snmpwalk?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: nagios snmp

Post by sreinhardt »

You need to provide it with the proper flags to do numeric output( -O n ). Otherwise the oid in mixed form is the far left string:

HOST-RESOURCES-MIB::hrSWRunParameters.1824

As for check_snmp, you need to tell it to use the specific mib or all mibs with (-m ALL).
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
nshahorchard
Posts: 16
Joined: Wed Aug 14, 2013 10:47 am

Re: nagios snmp

Post by nshahorchard »

Here's a question. How do I find out the OIDs from a mib file?

Code: Select all

-- SUPERMICRO-SMI.mib:  Super Micro Enterprise Structure of Management Information
--
-- October 26 2001, Software LAB
--
-- Copyright (c) 1993-2001 by Super Micro Computer Inc.
-- All rights reserved.
--
-- *****************************************************************

SUPERMICRO-HEALTH-MIB DEFINITIONS ::= BEGIN

IMPORTS
        MODULE-IDENTITY,
        OBJECT-TYPE,
        Integer32,
        Gauge32
                FROM SNMPv2-SMI
        TEXTUAL-CONVENTION,
        DisplayString,
        TruthValue
                FROM SNMPv2-TC
        MODULE-COMPLIANCE,
        OBJECT-GROUP
                FROM SNMPv2-CONF
        smHealth
                FROM SUPERMICRO-SMI;

smHealthMIB MODULE-IDENTITY
        LAST-UPDATED "200110260000Z"
        ORGANIZATION "Super Micro Computer Inc."
        CONTACT-INFO
                "       Software Lab

                Postal: 980 Rock Avenue
                        San Jose, CA  95131
                        USA

                   Tel: +1 408 503 8000

                E-mail: SoftLab@supermicro.com"
        DESCRIPTION
                "MIB module for monitoring health information"
        ::= { smHealth 1 }

SMHealthInfoTypes ::= TEXTUAL-CONVENTION
        STATUS          current
        DESCRIPTION
                "Represents the different types of health information that
                may be present in a managed device.  The following health
                information types are currently predefined:
                        0:  fan speed
                        1:  voltage
                        2:  temperature
                "
        SYNTAX          Integer32 (0..64)
smHealthObjects OBJECT IDENTIFIER ::= { smHealthMIB 1 }

smHealthMonitorTable OBJECT-TYPE
        SYNTAX      SEQUENCE OF SMHealthMonitorEntry
        MAX-ACCESS  not-accessible
        STATUS      current
        DESCRIPTION
                "A table of health monitoring entries."
        ::= { smHealthObjects 1 }

-- ================
smHealthMonitorEntry OBJECT-TYPE
        SYNTAX      SMHealthMonitorEntry
        MAX-ACCESS  not-accessible
        STATUS      current
        DESCRIPTION
                "An entry in the health monitoring table.
                Entries cannot be created or deleted via SNMP operations."
        INDEX       { smHealthMonitorIndex }
        ::= { smHealthMonitorTable 1 }

SMHealthMonitorEntry ::=
        SEQUENCE {
                smHealthMonitorIndex            Integer32,
                smHealthMonitorName                     DisplayString,
                smHealthMonitorType                     SMHealthInfoTypes,
                smHealthMonitorReading          Integer32,
                smHealthMonitorHighLimit        Integer32,
                smHealthMonitorLowLimit         Integer32,
                smHealthMonitorMaxReading       Integer32,
                smHealthMonitorMinReading       Integer32,
                smHealthMonitorDivisor          Integer32,
                smHealthMonitorMonitor          TruthValue
        }

smHealthMonitorIndex OBJECT-TYPE
        SYNTAX      Integer32 (1..65535)
        MAX-ACCESS  not-accessible
        STATUS      current
        DESCRIPTION
                "The unique value which identifies this Monitor device."
        ::= { smHealthMonitorEntry 1 }

smHealthMonitorName OBJECT-TYPE
        SYNTAX      DisplayString
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
                "A textual full name assigned to the Monitor device.
                This object is suitable for output to a human operator."
        ::= { smHealthMonitorEntry 2 }

smHealthMonitorType OBJECT-TYPE
        SYNTAX      SMHealthInfoTypes
        MAX-ACCESS  read-only

 STATUS      current
        DESCRIPTION
                "A textual full name assigned to the Monitor device.
                This object is suitable for output to a human operator."
        ::= { smHealthMonitorEntry 2 }

smHealthMonitorType OBJECT-TYPE
        SYNTAX      SMHealthInfoTypes
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
                "Identifies this Monitor device type."
        ::= { smHealthMonitorEntry 3 }

smHealthMonitorReading OBJECT-TYPE
        SYNTAX      Integer32 (0..65535)
        MAX-ACCESS  read-only
        STATUS      current
        DESCRIPTION
                "Indicates the value from the Monitor device that are
                currently in use on the managed device.
                FAN reading is in unit of RPM,
                Voltage reading is in unit of mV,
                Temperture reading is in unit of degree C"
        ::= { smHealthMonitorEntry 4 }

smHealthMonitorHighLimit OBJECT-TYPE
        SYNTAX      Integer32 (0..65535)
        MAX-ACCESS  read-write
        STATUS      current
        DESCRIPTION
                "Indicates the value for the High limitation
                for the Monitor device that are currently in use on the
                managed device.
                Apply to Temperature and Voltage deivces only.
                Voltage limit is in unit of mV,
                Temperture limit is in unit of degree C"
        ::= { smHealthMonitorEntry 5 }

smHealthMonitorLowLimit OBJECT-TYPE
        SYNTAX      Integer32 (0..65535)
        MAX-ACCESS  read-write
        STATUS      current
        DESCRIPTION
                "Indicates the value for the Low limitation
                for the Monitor device that are currently in use on the
                managed device.
                FAN limit is in unit of RPM,
                Voltage limit is in unit of mV,
                Temperture limit is in unit of degree C"
        ::= { smHealthMonitorEntry 6 }

And I been provided with:

SUPERMICRO-HEALTH-MIB SMHealthInfoTypes
SUPERMICRO-HEALTH-MIB smHealthMIB 1.3.6.1.4.1.10876.2.1
SUPERMICRO-HEALTH-MIB smHealthObjects 1.3.6.1.4.1.10876.2.1.1
SUPERMICRO-HEALTH-MIB smHealthMonitorTable 1.3.6.1.4.1.10876.2.1.1.1
SUPERMICRO-HEALTH-MIB smHealthMonitorEntry 1.3.6.1.4.1.10876.2.1.1.1.1
SUPERMICRO-HEALTH-MIB smHealthMonitorIndex 1.3.6.1.4.1.10876.2.1.1.1.1.1
SUPERMICRO-HEALTH-MIB smHealthMonitorName 1.3.6.1.4.1.10876.2.1.1.1.1.2
SUPERMICRO-HEALTH-MIB smHealthMonitorType 1.3.6.1.4.1.10876.2.1.1.1.1.3
SUPERMICRO-HEALTH-MIB smHealthMonitorReading 1.3.6.1.4.1.10876.2.1.1.1.1.4
SUPERMICRO-HEALTH-MIB smHealthMonitorHighLimit 1.3.6.1.4.1.10876.2.1.1.1.1.5
SUPERMICRO-HEALTH-MIB smHealthMonitorLowLimit 1.3.6.1.4.1.10876.2.1.1.1.1.6
SUPERMICRO-HEALTH-MIB smHealthMonitorMaxReading 1.3.6.1.4.1.10876.2.1.1.1.1.7
SUPERMICRO-HEALTH-MIB smHealthMonitorMinReading 1.3.6.1.4.1.10876.2.1.1.1.1.8
SUPERMICRO-HEALTH-MIB smHealthMonitorDivisor 1.3.6.1.4.1.10876.2.1.1.1.1.9
SUPERMICRO-HEALTH-MIB smHealthMonitorMonitor 1.3.6.1.4.1.10876.2.1.1.1.1.10
SUPERMICRO-HEALTH-MIB smHealthNotifications 1.3.6.1.4.1.10876.2.1.2
SUPERMICRO-HEALTH-MIB smHealthConformance 1.3.6.1.4.1.10876.2.1.3
SUPERMICRO-HEALTH-MIB smHealthCompliances 1.3.6.1.4.1.10876.2.1.3.1
SUPERMICRO-HEALTH-MIB smHealthCompliance 1.3.6.1.4.1.10876.2.1.3.1.1
SUPERMICRO-HEALTH-MIB smHealthGroups 1.3.6.1.4.1.10876.2.1.3.2
SUPERMICRO-HEALTH-MIB smHealthMonitorGroup 1.3.6.1.4.1.10876.2.1.3.2.1
nshahorchard
Posts: 16
Joined: Wed Aug 14, 2013 10:47 am

Re: nagios snmp

Post by nshahorchard »

I see your point with the flags. How, in nagios, can i specify which mib file to use? I just threw them in /usr/share/snmp/mibs...I didn't know which variable allowed me to specify path of mib file. This is for 3rd party hardware (e.g Raid Conrtollers, Super Mico HArdware)
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: nagios snmp

Post by slansing »

If you have not taken a look already, we have a few solutions for this which do have stand alone guides as far as I know:

http://nagios.sourceforge.net/docs/3_0/ ... ptrap.html

Also, I noted quite a few third party tutorials here:

https://www.google.com/search?q=how+to+ ... annel=fflb
nshahorchard
Posts: 16
Joined: Wed Aug 14, 2013 10:47 am

Re: nagios snmp

Post by nshahorchard »

I've tried to implement some of those. Here is where my confusion is. When I find third party mib files. I am placing them inside of /usr/share/snmp/mibs. However, when i run snmpwalk, its not pulling any of the information for those mibs. What would cause this? I see its using the standard mib for the output. Aside from uploading the mib files in that directory, what else would I need to do to enable these outputs?

[root@nagios02 ~]# net-snmp-config --default-mibdirs
/root/.snmp/mibs:/usr/share/snmp/mibs
nshahorchard
Posts: 16
Joined: Wed Aug 14, 2013 10:47 am

Re: nagios snmp

Post by nshahorchard »

making some headway here:

snmptranslate -m +SUPERMICRO-HEALTH-MIB -IR -On smHealthMonitorMinReading
.1.3.6.1.4.1.10876.2.1.1.1.1.8

What may be a dumb question...

How in the world can I get the true status instead of stating what the string is. In other words, What is the current voltage of the below?


[root@nagios02 ~]# ./check_snmp -H 192.168.XX.XX -C $COMM -o .1.3.6.1.4.1.10876.2.1.1.1.1.2.11
SNMP OK - CPU1 Vcore Voltage


snmpwalk -v 2c -c orchard 192.168.XX.XX SUPERMICRO -O n
.1.3.6.1.4.1.10876.2.1.1.1.1.2.1 = STRING: Fan1 Fan Speed
.1.3.6.1.4.1.10876.2.1.1.1.1.2.2 = STRING: Fan2 Fan Speed
.1.3.6.1.4.1.10876.2.1.1.1.1.2.3 = STRING: Fan3 Fan Speed
.1.3.6.1.4.1.10876.2.1.1.1.1.2.4 = STRING: Fan4 Fan Speed
.1.3.6.1.4.1.10876.2.1.1.1.1.2.5 = STRING: FanA Fan Speed
.1.3.6.1.4.1.10876.2.1.1.1.1.2.6 = STRING: FanB Fan Speed
.1.3.6.1.4.1.10876.2.1.1.1.1.2.7 = STRING: Power1 Fan 1 Speed
.1.3.6.1.4.1.10876.2.1.1.1.1.2.8 = STRING: Power1 Fan 2 Speed
.1.3.6.1.4.1.10876.2.1.1.1.1.2.9 = STRING: Power2 Fan 1 Speed
.1.3.6.1.4.1.10876.2.1.1.1.1.2.10 = STRING: Power2 Fan 2 Speed
.1.3.6.1.4.1.10876.2.1.1.1.1.2.11 = STRING: CPU1 Vcore Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.12 = STRING: CPU2 Vcore Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.13 = STRING: CPU1 VDIMM Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.14 = STRING: CPU2 VDIMM Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.15 = STRING: -12V Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.16 = STRING: +5VSB Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.17 = STRING: VTT Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.18 = STRING: +1.5V Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.19 = STRING: +5V Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.20 = STRING: +12V Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.21 = STRING: +3.3V Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.22 = STRING: +3.3VSB Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.23 = STRING: VBAT Voltage
.1.3.6.1.4.1.10876.2.1.1.1.1.2.24 = STRING: CPU1 Temperature
.1.3.6.1.4.1.10876.2.1.1.1.1.2.25 = STRING: CPU2 Temperature
.1.3.6.1.4.1.10876.2.1.1.1.1.2.26 = STRING: System Temperature
.1.3.6.1.4.1.10876.2.1.1.1.1.2.27 = STRING: Peripheral Temperature
.1.3.6.1.4.1.10876.2.1.1.1.1.2.28 = STRING: PCH Temperature
.1.3.6.1.4.1.10876.2.1.1.1.1.2.29 = STRING: Power1 Temperature
.1.3.6.1.4.1.10876.2.1.1.1.1.2.30 = STRING: Power2 Temperature
.1.3.6.1.4.1.10876.2.1.1.1.1.2.31 = STRING: Chassis Intrusion
.1.3.6.1.4.1.10876.2.1.1.1.1.2.32 = STRING: Power Supply Status
.1.3.6.1.4.1.10876.2.1.1.1.1.2.33 = STRING: Power1 Supply Failure
.1.3.6.1.4.1.10876.2.1.1.1.1.2.34 = STRING: Power2 Supply Failure
Locked