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

thresholdFilter is ignored if value is null, despite AND condition

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.12.1
    • 1.12.2
    • Thresholding
    • Security Level: Default (Default Security Scheme)
    • None

    Description

      If I have a filter like this:

      <resource-filter field="oeDbKey">^[a-zA-Z]+$</resource-filter>
      

      The attribute filterOperator has a value of and
      The field oeDbKey is null

      I would expect the filter to fail.

      However, in opennms-services/src/main/java/org/opennms/netmgmt/threshd/ThresholdingSet.java in the method passedThresholdFilters there is only a warning:

      } else {
          LOG.warn("passedThresholdFilters: can't find value of {} for resource {}", f.getField(), resource);
      }
      

      As a result the filter passes.

      I think the warning should be changed like this:

      } else {
          LOG.warn("passedThresholdFilters: can't find value of {} for resource {}", f.getField(), resource);
          if (operator.equals("and"))
              return false;
      }
      

      Attachments

        Activity

          People

            agalue Alejandro Galue
            jankeir Jan Keirse (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: