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

Handle numbers with units when configuring the XML Collector

    XMLWordPrintable

Details

    • Enhancement
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.10.0
    • 1.10.1
    • Data Collection - XML
    • Security Level: Default (Default Security Scheme)
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: