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

Add the ability to define an enumeration to convert collected strings into numeric values

    XMLWordPrintable

Details

    • New Feature
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Fixed
    • None
    • 30.0.0
    • Data Collection
    • Security Level: Default (Default Security Scheme)
    • None
    • 8
    • Horizon - May 11 - 25
    • Backlog
    • NB

    Description

      When collecting some values, especially from REST APIs via an XML Collector, the provided data comes back as a string value.  Sometimes this string value represents a state that we can't currently persist over time.  If we were able to send the value through an enumeration, the value could be persisted as an integer to track over time.

      such as:

      "status": "operational"
      "status": "down"
      "status": "partial_outage"

      If there was an enumeration such as:

      "operational" = 0
      "partial_outage" = 1
      "down" = 2

      these numbers could easily be persisted with our current JRB/RRD models.

       My initial though would be for this to be an extension of resource types, where enumerations could be defined like:

      <resource-types>
          <resourceEnumeration name="myStatus">
              <enumState value=0 string="operational" />
              <enumState value=1 string="partial_outage" />
              <enumState value=2 string="down" />
          </resourceEnumeration>
      </resource-types>

      and then collected as following, assuming the "status" xpath refers to a field that is a string in the source:

      <xml-object name="status" type="GAUGE" xpath="status" enum="myStatus" />
      

       Or I guess as a "ReverseEnumLookupPropertyExtender"

      Attachments

        Issue Links

          Activity

            People

              cpape Christian Pape
              mmahacek Mark Mahacek
              Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: