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

Threshold expression can't handle metric names with leading zero

    XMLWordPrintable

    Details

      Description

      We noticed that a expression based threshold didn't work when the metric name has a leading "0" (zero) in its name. Thanks to @pioto who had the idea to check this: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html

      Normal thresholds are not affected!

      Example:

      expression="0SessionCnt - 0DevicesKnownCnt"
      

      Collectd.log had this WARN (why WARN and not ERROR?) log:

      2017-11-28 15:59:42,333 WARN  [DefaultUDPTransportMapping_0.0.0.0/0] o.s.Snmp: Received response that cannot be matched to any outstanding request, address=10.10.2.38/161, requestID=132099038
      2017-11-28 16:00:04,446 WARN  [collectd-Thread] o.o.n.t.DefaultThresholdsDao: fillThresholdStateMap: Could not parse threshold expression
      org.opennms.netmgt.threshd.ThresholdExpressionException: Could not parse threshold expression:0@1:15 parsing error near '... statement, ...'
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              ranger Benjamin Reed
              Reporter:
              fuhrmann Marcel Fuhrmann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration