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

Mappings are not correctly handled in the JSON Collection Handler

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • 30.0.0
    • 30.0.2
    • None
    • Security Level: Default (Default Security Scheme)
    • None
    • 2
    • Horizon 22 - July 21 - Aug 4

    Description

      The Mapping values mechanism is not correctly handled in the JSON Collection Handler, the mapped value is always NaN.

       

      How to easily reproduce (accessing to Zoom Service Status for current status):
      ```
      collectd-configuration.xml:

          <service name="Zoom-Status-Service" interval="10000" user-defined="false" status="on">
               <parameter key="collection" value="zoom-stats"/>
               <parameter key="handler-class" value="org.opennms.protocols.json.collector.DefaultJsonCollectionHandler"/>
            </service>

         <collector service="Zoom-Status-Service" class-name="org.opennms.protocols.xml.collector.XmlCollector"/>

      xml-datacollection-config.xml:

          <xml-collection name="zoom-stats">
              <rrd step="10">
                  <rra>RRA:AVERAGE:0.5:1:60480</rra>
                  <rra>RRA:AVERAGE:0.5:360:1488</rra>
                  <rra>RRA:AVERAGE:0.5:8640:366</rra>
                  <rra>RRA:MAX:0.5:8640:366</rra>
                  <rra>RRA:MIN:0.5:8640:366</rra>
              </rrd>
            <xml-source url="https://status.zoom.us/api/v2/summary.json">
                  <xml-group name="zoom-status" resource-type="zoomStatus" resource-xpath="/components" key-xpath="@name" >
                      <xml-object name="componentName" type="string" xpath="@name" />
                      <xml-object name="componentStatus" type="string" xpath="status" />
                      <xml-object name="status" type="GAUGE" xpath="status" >
                          <xml-mapping from="operational" to="5555" />
                          <xml-mapping from="scheduled" to="6666" />
                      </xml-object>
                  </xml-group>
              </xml-source>
           </xml-collection>
      ```

      Attachments

        Activity

          People

            cpape Christian Pape
            fernandl Elizabeth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: