Linux iTOps Tube

Wednesday, 23 November 2011

Testing Your MIB Value

Testing Your MIB Value

Once you have identified an interesting MIB value for your Linux system you can then use the snmpwalk command to poll it. Many times the text aliases in a MIB only reference the OID branch and not the OID the data located in a leaf ending in an additional number like a ".0" or ".1". The snmpget command doesn't work with branches giving an error stating that the MIB variable couldn't be found.

In the example below, the ssCpuRawUser OID alias was found to be interesting, but the snmpget command fails to get a value. Follow up with the snmpwalk command shows that the value is located in ssCpuRawUser.0 instead. The snmpget is then successful in retrieving the "counter32" type data with a current value of 396271.

[root@bigboy tmp]# snmpget -v1 -c craz33guy localhost ssCpuRawUser  
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: UCD-SNMP-MIB::ssCpuRawUser
[root@bigboy tmp]#
[root@bigboy tmp]# snmpwalk -v1 -c craz33guy localhost ssCpuRawUser
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 396241
[root@bigboy tmp]# snmpget -v1 -c craz33guy localhost ssCpuRawUser.0
UCD-SNMP-MIB::ssCpuRawUser.0 = Counter32: 396271
[root@bigboy tmp]#

The MIB values that work successfully with snmpget are the ones you should use with MRTG.

No comments:

Post a Comment