Page 1 of 2

Check_snmp Usage

Posted: Mon May 23, 2016 2:37 pm
by spyder13337
Hello Everybody i am having issue with check_snmp this is for a Tripp Lite UPS

so if i run this command

./check_snmp -H xx.xx.xx.xx -C xxxxx -o .1.3.6.1.2.1.33.1.1.2
./check_snmp -H xx.xx.xx.xx -P 1 -C xxxx -o .1.3.6.1.2.1.33.1.1.2

i get an output of
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.2.1.33.1.1.2

so i decided to run this command
./check_snmp -H xx.x.xx.xx -P 1 -C xxxxx -o .1.3.6.1.2.1.33.1.1.2 -m UPS-MIB

and i get this error msg (i verify this with snmpwalk so i now this exist)

External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UPS-MIB::upsIdentModel


so i verify that this is the correct info and ran this

snmptranslate .1.3.6.1.2.1.33.1.1.2
UPS-MIB::upsIdentModel

then this snmptranslate .1.3.6.1.2.1.33.1.1.2 -On
.1.3.6.1.2.1.33.1.1.2



so i ran this

./check_snmp -H xx.xx.xx.xx -P 1(and 2c) -C xxxxx -o .1.3.6.1.2.1.33.1.1.2 -m UPS-MIB

External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UPS-MIB::upsIdentModel

so i ran this command

./check_snmp -H xx.x.xx.xx -P 1 -C univoice -o .1.3.6.1.2.1.33.1.1.2 -m UPS-MIB -On

the first time i run this i get the info that i am looking for
SNMP OK - SU5000RT4U |

then i run again back to back serveral times and it rotates the this to outputs
SNMP OK - SU5000RT4U |
SNMP OK - 09 | UPS-MIB::upsIdentUPSSoftwareVersion.0=09

these are the MIBS that i am have loaded in /etc/snmpd/snmp.conf
mibs +UPS-MIB
mibs +TRIPPLITE-MIB
mibs +PowerNet-MIB
mibs +BROTHER-MIB

how can i get a straight answer from check_snmp

those all of it look correct

Re: Check_snmp Usage

Posted: Mon May 23, 2016 4:06 pm
by tgriep
It could be that the plugin is timing out. Try adding a the following to the command to increase the timeout to 30 seconds.

Code: Select all

-t 30

Re: Check_snmp Usage

Posted: Mon May 23, 2016 4:09 pm
by ssax
In addition to tgriep's post:

Did you put the MIBs in /usr/share/snmp/mibs or some other directory? Are there multiple UPS-MIBs in there?

Code: Select all

grep -R upsIdentModel /usr/share/snmp/mibs/*

Re: Check_snmp Usage

Posted: Mon May 23, 2016 5:25 pm
by spyder13337
i removed all MIB from snmpd.conf and physical removed them from MIB folder

so now when i do the snmptralate .1.3.6.1.2.1.33.1.1.2

SNMPv2-SMI::mib-2.33.1.1.2

i ran this now

grep -R upsIdentModel /usr/share/snmp/mibs/*

and get nothing but i still recieve weird outputs

./check_snmp -H xx.xx.xx.xx -P 1 -C xxxxx -o .1.3.6.1.2.1.33.1.1.2 -On
SNMP OK - "SU5000RT4U" |
./check_snmp -H xx.xx.xx.xx -P 1 -C xxxxx -o .1.3.6.1.2.1.33.1.1.2 -On
SNMP OK - "09" |
./check_snmp -H xx.xx.xx.xx -P 1 -C xxxxx -o .1.3.6.1.2.1.33.1.1.2 -On
SNMP OK - "SU5000RT4U" |
./check_snmp -H xx.xx.xx.xx -P 1 -C xxxxx -o .1.3.6.1.2.1.33.1.1.2 -On
SNMP OK - "09" |
./check_snmp -H xx.xx.xx.xx -P 1 -C xxxxx -o .1.3.6.1.2.1.33.1.1.2 -On
SNMP OK - "SU5000RT4U" |
./check_snmp -H xx.xx.xx.xx -P 1 -C xxxxx -o .1.3.6.1.2.1.33.1.1.2 -On
SNMP OK - "09" |
./check_snmp -H xx.xx.xx.xx -P 1 -C xxxxx -o .1.3.6.1.2.1.33.1.1.2 -On
SNMP OK - "SU5000RT4U" |

and now this is w/o -On augement

./check_snmp -H xx.xx.xx.xx -P 1 -C xxxxx -o .1.3.6.1.2.1.33.1.1.2
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.2.1.33.1.1.2

Re: Check_snmp Usage

Posted: Mon May 23, 2016 6:10 pm
by spyder13337
so if i run this command which i added the right MIB to snmp.conf
but i don't understand why it giving me an error

./check_snmp -H xx.xx.xx.xx -C xxxxx -o .1.3.6.1.4.1.850.100.1.1.2 -m TRIPPLITE-MIB

i get this result

External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: TRIPPLITE-MIB::tlUpsIdentSerialNum

Re: Check_snmp Usage

Posted: Mon May 23, 2016 6:20 pm
by Box293
spyder13337 wrote:./check_snmp -H xx.xx.xx.xx -P 1 -C xxxxx -o .1.3.6.1.2.1.33.1.1.2
External command error: Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: iso.3.6.1.2.1.33.1.1.2
Try removing the leading . and also add a .0 at the end:

Code: Select all

./check_snmp -H xx.xx.xx.xx -P 1 -C xxxxx -o 1.3.6.1.2.1.33.1.1.2.0

Re: Check_snmp Usage

Posted: Tue May 24, 2016 2:56 pm
by spyder13337
thanks everyone for your help...

box293 that is crazy as hell and i am not sure why but it worked but it did

so now the i am monitoring my UPS but i notice but i notice that i need to monitor battery charge and incase it fall below a certain number i want it to trigger a warn and crit so i did doing some research now on that

Re: Check_snmp Usage

Posted: Tue May 24, 2016 3:00 pm
by rhassing
You should have a look if the UPS does snmptrapping.
There is some information available on http://mona.deltics.info/snmptrapping/

Re: Check_snmp Usage

Posted: Tue May 24, 2016 4:44 pm
by rkennedy
@rhassing is right, traps might be the best way to go. The other option is rewriting a wrapper to parse the information as a variable, which you could then create warning / critical values based off of.

A bit more information about them can be found here - https://assets.nagios.com/downloads/nag ... ios_XI.pdf

Re: Check_snmp Usage

Posted: Tue May 24, 2016 4:47 pm
by Box293
spyder13337 wrote:box293 that is crazy as hell and i am not sure why but it worked but it did
Glad it's working.

OIDs typically end with .0, the .0 indicates that it's a value.

This is a good talk on SNMP and it's how I learned that tid bit of information:
https://support.nagios.com/kb/article.php?id=451