Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-5185

Handle numbers with units when configuring the XML Collector

    Details

    • Type: Enhancement
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.10.0
    • Fix Version/s: 1.10.1
    • Component/s: Data Collection - XML
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None

      Description

      When defining the numeric attributes to be extracted from the source XML, if the value is not 100% numeric like a value with units, it will produce errors when updating the JRBs/RRDs.

      Take a look at this XML:

      <stats>
      <cpu-usage>65%</cpu-usage>
      <temperature>42 celsius</cpu-usage>
      </stats>

      Of course, the configuration to retrieve the data should looks like this:

      <xml-source url="http://

      {ipaddr}

      /stats">
      <xml-group name="stats" resource-type="node" resource-xpath="/stats">
      <xml-object name="cpu" type="GAUGE" xpath="cpu-usage" />
      <xml-object name="temp" type="GAUGE" xpath="temperature" />
      </xml-group>
      </xml-source>

      The system will use the value "65%" and "42 celsius" in the rrd-update command which is not valid.

      A tweak is required inside getNumericValue() from XmlCollectionAttribute to deal with this situation.

        Attachments

          Activity

            People

            • Assignee:
              agalue Alejandro Galue
              Reporter:
              agalue Alejandro Galue
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: