Page 1 of 1

check_snmp underline

Posted: Tue Dec 30, 2014 8:31 am
by whitest
Is there way to use check_snmp plugin with OIDs, that contanes underline in the names??
When I run that command I recieve the error:

Code: Select all

#./check_snmp -H 10.14.222.80 -C public -m DATAKOM-MIB -o "Engine_Temperature"
External command error: Bad operator (_): At line 17 in /usr/local/share/snmp/mibs/500-snmp_E_34076_D500_20121225.mib
Engine_Temperature: Unknown Object Identifier (Sub-id not found: (top) -> Engine_Temperature)
There is optin "u" in snmpget utility, that allows underlines:

Code: Select all

#snmpget -v 1 -c BNBsnmpNag -m DATAKOM-MIB -P u 10.14.222.80 Engine_Temperature
DATAKOM-MIB::Engine_Temperature = INTEGER: 274

But I can't set this option in the check_snmp plugin :(

Re: check_snmp underline

Posted: Tue Dec 30, 2014 3:03 pm
by tgriep
Could you upload the mib file "500-snmp_E_34076_D500_20121225.mib" here so we can look at it?

Did you upload the mib file in NagiosXI?

You can do this by clicking on Admin -> System Extensions -> Manage MIBs
Browse to your MIB file and upload it.

Re: check_snmp underline

Posted: Wed Dec 31, 2014 3:56 am
by whitest
I've attached MIB file.

Re: check_snmp underline

Posted: Fri Jan 02, 2015 9:29 am
by tgriep
The MIB file didn't upload to the server, could you upload it again of PM the file to me?

Re: check_snmp underline

Posted: Mon Jan 05, 2015 10:17 am
by tgriep
I did some research and found that ASN.1 forbids the use of the underscore ('_') character in descriptors.
Here are the characters that they say are supported.
Descriptors (including identifiers like MIB module names and type names) must not contain other characters than:
a b c d e f g h i j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 1 2 3 4 5 6 7 8 9 -

Some programs like snmpget ignore bad characters.

I converted your mib file and changed the underscores to hyphens, will that work for you?

You will have to remove the bad mib file and replace it with the fixed one that is attached to this post.
Then you would use this as your check command
./check_snmp -H 10.14.222.80 -C public -m DATAKOM-MIB -o "Engine-Temperature"

Re: check_snmp underline

Posted: Mon Jan 05, 2015 10:26 am
by whitest
Thank you very much, tgriep!
It woks!

Re: check_snmp underline

Posted: Mon Jan 05, 2015 11:14 am
by cmerchant
Glad it worked. We'll go ahead and close this thread.