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

The node and interface counters of the Evaluation Layer are incorrect

    XMLWordPrintable

    Details

    • HB Backlog Status:
      Backlog

      Description

      When I implemented the evaluation layer, the logic to identify nodes versus interfaces was deterministic:

      https://github.com/OpenNMS/opennms/blob/master/features/timeseries-evaluate/src/main/java/org/opennms/netmgt/collection/persistence/evaluate/EvaluateStats.java#L142

      Unfortunately, that is not the case anymore, as now after all the refactoring made over the years (since the evaluation layer exists), and now "getResource().getParent().getName()" returns something different.

      With the current state of the code, I think the checkNode method should receive the CollectionResource entity. There, check the resource type, decide if the resource belongs to Pollerd (interface) or Collectd (node), and increase the appropriate counter.

      Currently, both nodes and interfaces are counted as interfaces, and here is how they appear in memory:

      2021-05-07 13:35:50,656 INFO  [pool-2-thread-1] EvaluationMetrics: interface: 127.0.0.1
      2021-05-07 13:35:50,656 INFO  [pool-2-thread-1] EvaluationMetrics: interface: 192.168.0.40
      2021-05-07 13:35:50,656 INFO  [pool-2-thread-1] EvaluationMetrics: interface: 192.168.205.1
      2021-05-07 13:35:50,656 INFO  [pool-2-thread-1] EvaluationMetrics: interface: 192.168.75.1
      2021-05-07 13:35:50,656 INFO  [pool-2-thread-1] EvaluationMetrics: interface: 192.168.75.47
      2021-05-07 13:35:50,656 INFO  [pool-2-thread-1] EvaluationMetrics: interface: agalue-mbp
      2021-05-07 13:35:50,656 INFO  [pool-2-thread-1] EvaluationMetrics: interface: fd13:ea9b:d4e4:4fc9:c87a:6cff:fe63:ca2c
      2021-05-07 13:35:50,656 INFO  [pool-2-thread-1] EvaluationMetrics: interface: opennms
      

      The nodes should be agalue-mbp and opennms. The rest are, as you can see, interfaces. Note that "fs/snmp" is not part of the node path identifier anymore. That leads to show the counters as:

      2021-05-07 13:46:50,653 INFO  [metrics-logger-reporter-1-thread-1] EvaluationMetrics: type=GAUGE, name=evaluate.groups, value=82
      2021-05-07 13:46:50,653 INFO  [metrics-logger-reporter-1-thread-1] EvaluationMetrics: type=GAUGE, name=evaluate.interfaces, value=8
      2021-05-07 13:46:50,654 INFO  [metrics-logger-reporter-1-thread-1] EvaluationMetrics: type=GAUGE, name=evaluate.nodes, value=0
      2021-05-07 13:46:50,654 INFO  [metrics-logger-reporter-1-thread-1] EvaluationMetrics: type=GAUGE, name=evaluate.numeric-attributes, value=287
      2021-05-07 13:46:50,654 INFO  [metrics-logger-reporter-1-thread-1] EvaluationMetrics: type=GAUGE, name=evaluate.resources, value=44
      2021-05-07 13:46:50,654 INFO  [metrics-logger-reporter-1-thread-1] EvaluationMetrics: type=GAUGE, name=evaluate.string-attributes, value=66
      2021-05-07 13:46:50,656 INFO  [metrics-logger-reporter-1-thread-1] EvaluationMetrics: type=METER, name=evaluate.samples, count=10854, mean_rate=8.614191587123628, m1=8.993287964895432, m5=8.694628203336677, m15=6.564777659036456, rate_unit=events/second
      

      Note that "node" has zero, whereas "interfaces" contains the total number of interfaces plus nodes.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:
                HB Grooming Date:

                  Git Integration