Accept MIB labels for genpdu enumerated values
With PDU2-MIB loaded, SNMP.pm returns an enumerated INTEGER as its label rather than its number: a PX4 answers inletSensorUnits with "amp" rather than "2". That failed the numeric test, fell back to none(-1) and dropped the unit suffix from every rvitals reading. Add pdu2_enum, which accepts the number, the label, or the label(value) form Net-SNMP produces with quick printing off, and use it for the sensor units and for outletSwitchingState. Also stop requiring the switching probe to read on or off. An outlet can be in any SensorStateEnumeration state, and pdu2_get has already ruled out an absent instance, so any answer proves the outlet is switchable. Signed-off-by: Kilian Cavalotti <kilian@stanford.edu>
K
Kilian Cavalotti committed
0b4695eef232e9a333284d1d2bba9f062ea338a9
Parent: daef2d7