opennms

Parse SNMP STRING in datacollection


I have an SNMP device that is return temperature as a string.

SNMPv2-SMI::enterprises.45501.1.3.8.0 = STRING: "+27.3"

Is there a way to parse out the value to persist it for graphing?


Solution

  • Hrm - you should be able to set the type to "octetstring" but I'm not sure about the "+" sign.

    i.e.:

    <group name="micro-instruments-temperature" ifType="all">
          <mibObj oid=".1.3.6.1.4.1.45501.1.3.8" instance="0" alias="microTemp" type="octetstring"/>
    </group>
    

    Assign that group to a systemDef and see if it works. You can also make the instance a generic resource if needed.

    Check out the "hwg.xml" file in the "datacollection" directory for a similar entry for an HWG temperature sensor (although I don't believe they sign the temperature value).