Finding the correct SNMP OID’s to monitor a device is more or less a painful process.
Here is an example of using trying to find OID’s to monitor a QNAP NAS device.
Thankfully they include the MIB file on the device itself. Easy right?
I download the file and take a look, but there are no OID’s just Textual Names.
That’s no good to me, I need OID’s damn it!
I came across a utility called snmptranslate which is part of the net-snmp package. (Download here)
Copy the MIB file into C:\usr\share\snmp\mibs
So just for fun, lets find the CPU usage OID.
In the MIB file we have.
systemCPU-Usage OBJECT-TYPE
SYNTAX DisplayString
MAX-ACCESS read-only
STATUS current
DESCRIPTION
“System CPU usage”
::= { systemInfo 1 }
Punch that into SNMPTranslate
snmptranslate.exe -On NAS-MIB::systemCPU-Usage .1.3.6.1.4.1.24681.1.2.1
BAM! we have the OID.
Lets put in an alert if its over a certain value.
Uh-Oh, the value has a % sign on the end. We can’t use a string object for a number calculation.
It should had been obvious from the definition, SYNTAX DisplayString part defines the output type, we need a number! (Integer)
Searching further into the MIB file I find another definition.
systemCPU-UsageEX OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
“system CPU usage”
::= { systemInfoEx 1 }
This looks more promising, now lets get the OID.
snmptranslate.exe -On NAS-MIB::systemCPU-UsageEX .1.3.6.1.4.1.24681.1.3.1
And there we have it, CPU usage as an integer which we can create a rule for.
… Now for all the other 50 relevant OID’s to find.