Page 1 of 2

snmp questions

Posted: Tue Dec 20, 2016 5:46 pm
by rockisland
centos 7 core
64 bit
manual
Installed Version: 5.3.4

I am working with snmp for the first time and am having problems, and know that it is probably the result of lack of general knowledge of snmp and how to use Nagios to check snmp. I can't seem to get mibs to work correctly, when I use Ireasoning mib browser I get the results that I expect but when when I use the check_snmp I think I am missing something.

goal: have it list the voltage:
this is the oid:psbatteryvoltage.0,.1.3.6.1.4.1.6302.2.1.2.5.1.0

I am loading mibs.
Here are the results I am getting:
command:/usr/local/nagios/libexec/check_snmp -H host -o psbatteryvoltage -C public -P 2c -m all
result:SNMP OK - Such Instance currently exists at this OID |
command:/usr/local/nagios/libexec/check_snmp -H host -o psbatteryvoltage.0 -C public -P 2c -m all
result:External command error: MIB search path: /home/myhome/.snmp/mibs:/usr/share/snmp/mibs
Cannot find module (Q-BRIDGE-MIB): At line 23 in /usr/share/snmp/mibs/f10-openFlow.mib
Did not find 'VlanId' in module #-1 (/usr/share/snmp/mibs/f10-openFlow.mib)
Cannot find module (Q-BRIDGE-MIB): At line 17 in /usr/share/snmp/mibs/f10-fip-snooping.mib
Did not find 'dot1qVlanIndex' in module #-1 (/usr/share/snmp/mibs/f10-fip-snooping.mib)
psbatteryvoltage.0: Unknown Object Identifier (Sub-id not found: (top) -> psbatteryvoltage)
command:/usr/local/nagios/libexec/check_snmp -H host -o .1.3.6.1.4.1.6302.2.1.2.5.1.0 -C public -P 2c
result:SNMP OK - 54571 | iso.3.6.1.4.1.6302.2.1.2.5.1.0=54571

Re: snmp questions

Posted: Wed Dec 21, 2016 10:32 am
by avandemore
What is the output from:

Code: Select all

snmpwalk -v 2c -c public host .1.3.6.1.4.1

Re: snmp questions

Posted: Fri Dec 23, 2016 4:46 pm
by rockisland
I am pretty sure that it is not reading my mibs for some reason. here is what you asked for:

Code: Select all

UCD-DEMO-MIB::ucdDemoResetKeys.0 = INTEGER: 0
UCD-DEMO-MIB::ucdDemoPublicString.0 = ""
UCD-DEMO-MIB::ucdDemoUserList.0 = ""
UCD-DEMO-MIB::ucdDemoPassphrase.0 = ""
SNMPv2-SMI::enterprises.6302.2.1.1.1.0 = STRING: "Emerson Network Power"
SNMPv2-SMI::enterprises.6302.2.1.1.2.0 = STRING: "ACU+"
SNMPv2-SMI::enterprises.6302.2.1.1.3.0 = STRING: "4.21"
SNMPv2-SMI::enterprises.6302.2.1.1.4.0 = STRING: "AS110"
SNMPv2-SMI::enterprises.6302.2.1.1.5.0 = STRING: "std2.012"
SNMPv2-SMI::enterprises.6302.2.1.2.1.0 = INTEGER: 2
SNMPv2-SMI::enterprises.6302.2.1.2.2.0 = INTEGER: 55192
SNMPv2-SMI::enterprises.6302.2.1.2.3.0 = INTEGER: 41269
SNMPv2-SMI::enterprises.6302.2.1.2.4.0 = INTEGER: 37
SNMPv2-SMI::enterprises.6302.2.1.2.5.1.0 = INTEGER: 54926
SNMPv2-SMI::enterprises.6302.2.1.2.5.2.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.5.3.0 = INTEGER: 100000
SNMPv2-SMI::enterprises.6302.2.1.2.5.4.0 = INTEGER: 300000
SNMPv2-SMI::enterprises.6302.2.1.2.5.5.1.1.116 = INTEGER: 116
SNMPv2-SMI::enterprises.6302.2.1.2.5.5.1.2.116 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.5.5.1.3.116 = STRING: "Battery 1"
SNMPv2-SMI::enterprises.6302.2.1.2.6.1.0 = INTEGER: 244368
SNMPv2-SMI::enterprises.6302.2.1.2.6.2.0 = INTEGER: 244757
SNMPv2-SMI::enterprises.6302.2.1.2.6.3.0 = INTEGER: 244583
SNMPv2-SMI::enterprises.6302.2.1.2.7.1.0 = INTEGER: 8208
SNMPv2-SMI::enterprises.6302.2.1.2.7.2.0 = INTEGER: -268976
SNMPv2-SMI::enterprises.6302.2.1.2.7.3.1.1.73781 = INTEGER: 73781
SNMPv2-SMI::enterprises.6302.2.1.2.7.3.1.2.73781 = INTEGER: 8208
SNMPv2-SMI::enterprises.6302.2.1.2.7.3.1.3.73781 = STRING: "IB2 Temp 1"
SNMPv2-SMI::enterprises.6302.2.1.2.7.3.1.4.73781 = INTEGER: 2
SNMPv2-SMI::enterprises.6302.2.1.2.7.3.1.5.73781 = INTEGER: 3
SNMPv2-SMI::enterprises.6302.2.1.2.8.0 = INTEGER: 2
SNMPv2-SMI::enterprises.6302.2.1.2.9.0 = INTEGER: 2
SNMPv2-SMI::enterprises.6302.2.1.2.10.1.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.10.2.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.10.3.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.11.1.0 = INTEGER: 3
SNMPv2-SMI::enterprises.6302.2.1.2.11.2.0 = INTEGER: 3
SNMPv2-SMI::enterprises.6302.2.1.2.11.3.0 = INTEGER: 37092
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.1.3 = INTEGER: 3
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.1.4 = INTEGER: 4
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.1.5 = INTEGER: 5
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.2.3 = STRING: "1R482000e     "
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.2.4 = STRING: "1R482000e     "
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.2.5 = STRING: "1R482000e     "
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.3.3 = STRING: "B06"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.3.4 = STRING: "B06"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.3.5 = STRING: "B06"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.4.3 = STRING: "1.09"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.4.4 = STRING: "1.09"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.4.5 = STRING: "1.09"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.5.3 = STRING: "03140906040"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.5.4 = STRING: "03140906202"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.5.5 = STRING: "03140906256"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.6.3 = INTEGER: 14387
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.6.4 = INTEGER: 13638
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.6.5 = INTEGER: 13643
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.7.3 = STRING: "Rectifier #1"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.7.4 = STRING: "Rectifier #2"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.7.5 = STRING: "Rectifier #3"
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.8.3 = INTEGER: 2
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.8.4 = INTEGER: 2
SNMPv2-SMI::enterprises.6302.2.1.2.11.4.1.8.5 = INTEGER: 2
SNMPv2-SMI::enterprises.6302.2.1.2.12.1.0 = INTEGER: 41
SNMPv2-SMI::enterprises.6302.2.1.2.13.1.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.13.2.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.13.3.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.13.4.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.13.5.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.14.1.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.14.2.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.14.3.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.14.4.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.2.14.5.0 = INTEGER: 0
SNMPv2-SMI::enterprises.6302.2.1.3.0 = Counter32: 140

Re: snmp questions

Posted: Fri Dec 23, 2016 6:25 pm
by ruffsense
its reading it:
SNMPv2-SMI::enterprises.6302.2.1.2.5.1.0 = INTEGER: 54926

Re: snmp questions

Posted: Tue Dec 27, 2016 10:09 am
by avandemore
As @ruffsense cites, it does appear to be reading the value.

I'm not sure I understand your question, can you rephrase it?

Re: snmp questions

Posted: Thu Dec 29, 2016 5:27 pm
by rockisland
I guess I would expect it to return a value using: psbatteryvoltage.0
I guess it doesn't do that, you have to input the actual oid.

Re: snmp questions

Posted: Fri Dec 30, 2016 9:20 am
by rkennedy
You may need the MIB if you're looking for the full resolver.

@rockisland - did you have any further questions?

Re: snmp questions

Posted: Fri Dec 30, 2016 3:32 pm
by rockisland
so that is my problem, I have added the right mib into nagios and it does not look like it works.

when I run this command
:/usr/local/nagios/libexec/check_snmp -H host -o psbatteryvoltage.0 -C public -P 2c -m all
I get
result:External command error: MIB search path: /home/myhome/.snmp/mibs:/usr/share/snmp/mibs
Cannot find module (Q-BRIDGE-MIB): At line 23 in /usr/share/snmp/mibs/f10-openFlow.mib
Did not find 'VlanId' in module #-1 (/usr/share/snmp/mibs/f10-openFlow.mib)
Cannot find module (Q-BRIDGE-MIB): At line 17 in /usr/share/snmp/mibs/f10-fip-snooping.mib
Did not find 'dot1qVlanIndex' in module #-1 (/usr/share/snmp/mibs/f10-fip-snooping.mib)
psbatteryvoltage.0: Unknown Object Identifier (Sub-id not found: (top) -> psbatteryvoltage)

when I use the oid like this:
/usr/local/nagios/libexec/check_snmp -H host -o .1.3.6.1.4.1.6302.2.1.2.5.1.0 -C public -P 2c

It works and gives me this:
SNMP OK - 54571 | iso.3.6.1.4.1.6302.2.1.2.5.1.0=54571

this tells me that the mibs are not loaded properly, either the permissions are off or something. unfortunately I haven't had a lot of time to dig into it.

Re: snmp questions

Posted: Fri Dec 30, 2016 3:44 pm
by ruffsense
Maybe it is case-sentitive psBatteryVoltage.0

Re: snmp questions

Posted: Fri Dec 30, 2016 5:12 pm
by rockisland
unfortunately not I tried it both ways.