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

thresholdFilter is ignored if value is null, despite AND condition

    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

      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

            • Assignee:
              agalue Alejandro Galue
              Reporter:
              jankeir Jan Keirse
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: