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

Threshold filters based on numeric values are not working when they are not part of the expression or ds-name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.12.1
    • Fix Version/s: 1.12.2
    • Component/s: Thresholding
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None

      Description

      Let's suppose that we define a threshold like the following:

      <threshold type="high" ds-name="ns-dskPercent" ds-type="dskIndex" ds-label="ns-dskPath" value="90.0" rearm="88.0" trigger="2"
                  triggeredUEI="uei.opennms.org/threshold/diskPercentGBExceeded"
                  rearmedUEI="uei.opennms.org/threshold/diskPercentGBRearmed">
                  <resource-filter field="ns-dskTotal">^\d{1,9}\.\d+$</resource-filter> <!-- 0 to ~1tb-1 -->
      </threshold>
      

      As you can see, the filter is based on a numeric field, in this case ns-dskTotal. Here is how those metrics are defined:

      <group name="net-snmp-disk" ifType="all">
              <mibObj oid=".1.3.6.1.4.1.2021.9.1.2" instance="dskIndex" alias="ns-dskPath"    type="string" />
              <mibObj oid=".1.3.6.1.4.1.2021.9.1.6" instance="dskIndex" alias="ns-dskTotal"   type="gauge" />
              <mibObj oid=".1.3.6.1.4.1.2021.9.1.7" instance="dskIndex" alias="ns-dskAvail"   type="gauge" />
              <mibObj oid=".1.3.6.1.4.1.2021.9.1.8" instance="dskIndex" alias="ns-dskUsed"    type="gauge" />
              <mibObj oid=".1.3.6.1.4.1.2021.9.1.9" instance="dskIndex" alias="ns-dskPercent" type="gauge" />
      </group>
      

      The expected result is that if the amount of digits on ns-dskTotal is less than 10, apply the threshold, but:

      2013-11-11 15:53:24,747 DEBUG [LegacyScheduler-Thread-12-of-50] SnmpAttribute: Visiting attribute node[101].dskIndex[1].ns-dskTotal[.1.3.6.1.4.1.2021.9.1.6] = 33027952...
      2013-11-11 15:53:40,204 DEBUG [LegacyScheduler-Thread-12-of-50] ThresholdingSet: applyThresholds: Applying thresholds on node[101].dskIndex[1] using 2 attributes....
      2013-11-11 15:53:40,204 TRACE [LegacyScheduler-Thread-12-of-50] ThresholdingSet: getEntityMap: checking if the resourceType 'dskIndex' exists on threshold group netsnmp={node:{[]}; iface:{[]}; dskIndex:{[[{evaluator=high, dsName=ns-dskPercentNode, dsType=dskIndex, evaluators=[{ds=ns-dskPercentNode, value=90.0, rearm=85.0, trigger=2}]}], [{evaluator=high, dsName=ns-dskPercent, dsType=dskIndex, evaluators=[{ds=ns-dskPercent, value=90.0, rearm=88.0, trigger=2}]}, {evaluator=high, dsName=ns-dskPercent, dsType=dskIndex, evaluators=[{ds=ns-dskPercent, value=95.0, rearm=88.0, trigger=2}]}]]}}...
      2013-11-11 15:53:40,205 INFO  [LegacyScheduler-Thread-12-of-50] ThresholdingSet: applyThresholds: All values found, evaluating
      2013-11-11 15:53:40,205 DEBUG [LegacyScheduler-Thread-12-of-50] ThresholdEntity: evaluate: value= 8.0 against threshold: {evaluator=high, dsName=ns-dskPercentNode, dsType=dskIndex, evaluators=[{ds=ns-dskPercentNode, value=90.0, rearm=85.0, trigger=2}]}
      2013-11-11 15:53:40,205 DEBUG [LegacyScheduler-Thread-12-of-50] ThresholdingSet: passedThresholdFilters: applying 1 filters to resource node[101].dskIndex[1]
      2013-11-11 15:53:40,205 DEBUG [LegacyScheduler-Thread-12-of-50] ThresholdingSet: passedThresholdFilters: filter #1: field=ns-dskTotal, regex='^\d{1,9}$'
      2013-11-11 15:53:40,205 DEBUG [LegacyScheduler-Thread-12-of-50] CollectionResourceWrapper: getLabelValue: Getting Value for dskIndex::ns-dskTotal
      2013-11-11 15:53:40,205 DEBUG [LegacyScheduler-Thread-12-of-50] DefaultCollectionAgent:  getStorageDir: isStoreByForeignSource = false, foreignSource = null, foreignId = null, dir = 101
      2013-11-11 15:53:40,205 DEBUG [LegacyScheduler-Thread-12-of-50] GenericIndexResource: getResourceDir: /opt/opennms/share/rrd/snmp/101/dskIndex/_root_fs
      2013-11-11 15:53:40,205 DEBUG [LegacyScheduler-Thread-12-of-50] CollectionResourceWrapper: getLabelValue: The field ns-dskTotal is not a string property. Trying to parse it as numeric metric.
      2013-11-11 15:53:40,205 WARN  [LegacyScheduler-Thread-12-of-50] CollectionResourceWrapper: getAttributeValue: can't find attribute called ns-dskTotal on node[101].dskIndex[1]
      

      As you can see, the threshold processor can't find the value of ns-dskTotal, and the value is being collected properly.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: