check_snmp help (missing MIB?)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

check_snmp help (missing MIB?)

Post by jbennett »

I am trying to create a few more SNMP checks for our UPSs, but am running into issues. Please note: I am NOT trying to utilize traps. I've tried this in the past but they never seemd to update once issues had cleared so it was not a viable option for us.

When I look at the current checks, I see the following:

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_snmp -H 10.100.84.172 -C public -o upsBatteryStatus -m USHA-MIB -c 2:2
This check returns results successfully and all is fine. However,

Looking at the USHA-MIB file that I want to use, I see the following trap:

Code: Select all

ushaUpsFailed       TRAP-TYPE
        ENTERPRISE      upsTrapGroup
        DESCRIPTION
                "SEVERE: The ups is not working fine."
        ::= 6
If I try and do the following:

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_snmp -H 10.100.84.172 -C public -o ushaUpsFailed -m USHA-MIB -c 2:2
It returns with:

Code: Select all

OUTPUT: External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: USHA-MIB::ushaUpsFailed
I went into the mib folder (/usr/share/snmp/mibs) to pull up the USHA-MIB.mib file and it doesn't exist...

So now I'm really confused. Per the first check command, we are looking at the MIB file titled USHA-MIB. However, it doesn't exist...so A) how is it looking at it B) where is it?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: check_snmp help (missing MIB?)

Post by Box293 »

This website is of great help:
http://www.net-snmp.org/wiki/index.php/ ... cations_09

Code: Select all

For non-table objects ("scalars"), this instance subidentifier will always be '.0', and it must be included when making a GET request. 
So your command should be:

Code: Select all

/usr/local/nagios/libexec/check_snmp -H 10.100.84.172 -C public -o ushaUpsFailed.0 -m USHA-MIB -c 2:2
I added .0 to ushaUpsFailed


Does this fix your problem?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: check_snmp help (missing MIB?)

Post by jbennett »

Code: Select all

OUTPUT: External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: USHA-MIB::ushaUpsFailed.0
Unfortunately, I'm still getting the same message.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_snmp help (missing MIB?)

Post by sreinhardt »

I don't think this is going to work. One thing to note is that traps are not generally, its possible but not done often, made available via snmp get requests. Traps are intended to always be asynchronously sent from the "client" device to the receiver and not requested. Are there other non-trap-type or non-notification-type traps that might provide the same or similar information?
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.
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: check_snmp help (missing MIB?)

Post by jbennett »

I'd really just prefer to use traps if at all possible, but they just don't seem to update. I can have a UPS send out a trap that a UPS has gone into bypass, but then once it's resolved, it doesn't update with a resolved message. It will stay there until there's another failure. I would think that there's a section within the MIB that I haven't edited correctly? Is that it or is this a normal issue?
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: check_snmp help (missing MIB?)

Post by sreinhardt »

Actually if you would like the check to auto-resolve after a period of time, I would suggest setting a freshness check of say 1 hour, and use check_dummy to return OK with a message of "Cleared down trap" or something along those lines that gives you a clear message. All this will do is tell core to clear the trap if nothing has come in for 1 hour, allowing you to receive another alert when a new trap comes in as warning or critical. I believe this is what you were asking, but correct me if that is not the case.
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.
User avatar
rseiwert
Posts: 196
Joined: Wed Jun 22, 2011 10:33 pm
Location: Somewhere between Here and Now

Re: check_snmp help (missing MIB?)

Post by rseiwert »

Yes that Trap is not a MIB variable. You can poll MIB variables not traps. I typically test with snmpwalk and see what I get starting with enterprises. You will need the mib in your mibs directory.

You probably can query the upsBatteryGroupStatus object and get good feedback

Code: Select all

upsBatteryGroupStatus OBJECT-TYPE
     SYNTAX     INTEGER {
           unknown(1),
           batteryNormal(2),
           batteryLow(3),
           batteryDepleted(4),
           batteryDischarging(5),
           batteryFailure(6)
     }
     ACCESS read-only
     STATUS mandatory
     DESCRIPTION
               "The indication of the status in the UPS system's batteries."
     ::= { upsBatteryGroup 1 }
Grumpy Olde IT Guy
User avatar
rseiwert
Posts: 196
Joined: Wed Jun 22, 2011 10:33 pm
Location: Somewhere between Here and Now

Re: check_snmp help (missing MIB?)

Post by rseiwert »

Also I would be checking and grabbing perf data from
Sorry to spam the forum but it looks like you can query a lot of useful info.

Code: Select all

UpsInputGroupEntry ::=
    SEQUENCE {
             upsInputGroupLineIndex   PositiveInteger,
             upsInputGroupFrequency   NonNegativeInteger,
             upsInputGroupVoltage     NonNegativeInteger,
             upsInputGroupCurrent     NonNegativeInteger,
             upsInputGroupTruePower   NonNegativeInteger,
             upsInputGroupVoltageMax  NonNegativeInteger,
             upsInputGroupVoltageMin  NonNegativeInteger
             }

Code: Select all

UpsOutputGroupEntry ::=
    SEQUENCE {
             upsOutputGroupLineIndex   PositiveInteger,
             upsOutputGroupVoltage     NonNegativeInteger,
             upsOutputGroupCurrent     NonNegativeInteger,
             upsOutputGroupPower       NonNegativeInteger,
             upsOutputGroupPercentLoad INTEGER
             }

Code: Select all

upsTestBatteryTestResult OBJECT-TYPE
        SYNTAX  INTEGER {
                donePassed(1),
                doneWarning(2),
                doneError(3),
                aborted(4),
                inProgress(5),
                noTestsInitiated(6)
        }

Code: Select all

emdSatatusTemperature OBJECT-TYPE
        SYNTAX  INTEGER
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "The measurement of EMD temperature, in 0.1 degree"
        ::= { emdStatus 2}

emdSatatusHumidity OBJECT-TYPE
        SYNTAX  INTEGER
        ACCESS read-only
        STATUS mandatory
        DESCRIPTION
                "The measurement of EMD humidity, in 0.1 degree"
        ::= { emdStatus 3}
Grumpy Olde IT Guy
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_snmp help (missing MIB?)

Post by lmiltchev »

jbennett, did you try rseiwert's suggestion?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked