SNMP: Mistake of Using Tabular OID in Practice
Recently, I retrieve rectifier-related SNMP data from Eltek’s Smartpack Controller. This one has the following rear type where we can connect to the ethernet plug (see the purple area).
It is presumably in its default configuration and I can snmpwalk
through its corporate specific OIDs (under 12148 tree) to find i.e. output voltage, current, battery temperature, etc. Doing it without translating against the MIB will retrieve all the values perfectly fine. However, I want to show you a mistake in practice related to how the MIB is written and put to place, which is a version 4 by the name of ELTEK-DISTRIBUTED-PLANTV4-MIB. It has tabular part as clipped in the following tree (see previous post on how to write such part in your own MIB):
| +--eltek(12148) | | | +--eltekDistributedPlantV4(9) ... | | | | | | | +--rectifierStatusTable(2) | | | | | +--rectifierStatusEntry(1) | | | Index: rectifierStatusID | | | | | +-- -R-- Integer32 rectifierStatusID(1) | | | Range: 1..100 ... | | +-- -R-- Integer32 rectifierStatusOutputVoltage(4) | | | Range: 0..65535
Looking at the above rectifierStatusEntry
branch, it marks a tabular entry expected to range from 1 to 100 as defined by rectifierStatusID
. Hence, putting 0 as one of the output voltage index will confuse the OID reported by GET
as
- belong to the scalar type (a misconception that is)
- belong to the tabular type but out of index range
GET
against the MIB will return the following error
$ sudo snmpget -m +ELTEK-DISTRIBUTED-PLANTV4-MIB -v 1 -c public raddlex ELTEK-DISTRIBUTED-PLANTV4-MIB::rectifierStatusOutputCurrent.0 ELTEK-DISTRIBUTED-PLANTV4-MIB::rectifierStatusOutputCurrent.0: Unknown Object Identifier (Index out of range: 0 (rectifierStatusID))
while the item (output current) actually has value in it as found below
$ sudo snmpget -v 1 -c public raddlex .1.3.6.1.4.1.12148.9.5.5.2.1.3.0 SNMPv2-SMI::enterprises.12148.9.5.5.2.1.3.0 = INTEGER: 1
By this time the MIB is already the latest to be used with firmware version 4.3.
About
+Arif Kusbandono
Recently
Et Cetera
© logIt. Powered by WordPress using the DePo Skinny Tweaked Theme.