check_snmp underline

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.
Locked
whitest
Posts: 107
Joined: Tue Dec 30, 2014 8:16 am

check_snmp underline

Post 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 :(
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_snmp underline

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
whitest
Posts: 107
Joined: Tue Dec 30, 2014 8:16 am

Re: check_snmp underline

Post by whitest »

I've attached MIB file.
Attachments
500-snmp_E_34076_D500_20121225.txt
(20.39 KiB) Downloaded 502 times
Last edited by whitest on Sat Jan 03, 2015 3:09 am, edited 1 time in total.
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_snmp underline

Post by tgriep »

The MIB file didn't upload to the server, could you upload it again of PM the file to me?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_snmp underline

Post 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"
Attachments
500-snmp_E_34076_D500_20121225-fixed.txt
Removed underscore
(20.39 KiB) Downloaded 527 times
Be sure to check out our Knowledgebase for helpful articles and solutions!
whitest
Posts: 107
Joined: Tue Dec 30, 2014 8:16 am

Re: check_snmp underline

Post by whitest »

Thank you very much, tgriep!
It woks!
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: check_snmp underline

Post by cmerchant »

Glad it worked. We'll go ahead and close this thread.
Locked