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

Live threshold merging fails if threshold with new ds-type added to existing group



    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 1.10.8
    • 1.10.9, 1.11.90
    • Thresholding
    • Security Level: Default (Default Security Scheme)
    • No special environment required


      Steps to reproduce (follow exactly!):

      1. Start with a freshly installed 1.10.8 instance, default versions of all configuration files, and a newly-created database with no nodes. Maybe crank up logging but that's it.
      2. Start OpenNMS
      3. Add a node to the system for which SNMP data collection is easy to set up; the type of node should not matter, just verify that SNMP data is being collected.
      4. Hand-edit thresholds.xml, adding a threshold like the following to the top of the "mib2" group (I know it doesn't make sense, just go with it):

      <threshold type="high" ds-name="ns-dskPercent" ds-type="dskIndex" ds-label="ns-dskPath" value="90.0" rearm="75.0" trigger="2"/>

      5. Tell OpenNMS to do an on-the-fly reload of the thresholds.xml contents:

      send-event.pl -p "daemonName Threshd" -p "configFile thresholds.xml" uei.opennms.org/internal/reloadDaemonConfig

      Expected result: threshold changes are successfully merged

      Actual result: Threshold merge aborts and the following appears in collectd.log:

      2013-02-27 13:00:24,008 DEBUG [OpenNMS.Collectd] DefaultThresholdsDao: fillThresholdStateMap(merge): checking if definitions that are no longer exist for group mib2 using type node
      2013-02-27 13:00:24,011 DEBUG [OpenNMS.Collectd] DefaultThresholdsDao: fillThresholdStateMap(merge): checking if definitions that are no longer exist for group mib2 using type if
      2013-02-27 13:00:24,018 ERROR [OpenNMS.Collectd] Collectd: handleReloadDaemonConfig: Error reloading/processing thresholds configuration: null
      at org.opennms.netmgt.threshd.DefaultThresholdsDao.mergeThresholdStateMap(DefaultThresholdsDao.java:97)
      at org.opennms.netmgt.threshd.DefaultThresholdsDao.mergeType(DefaultThresholdsDao.java:180)
      at org.opennms.netmgt.threshd.DefaultThresholdsDao.get(DefaultThresholdsDao.java:79)
      at org.opennms.netmgt.threshd.DefaultThresholdsDao.merge(DefaultThresholdsDao.java:60)
      at org.opennms.netmgt.threshd.ThresholdingSet.mergeThresholdGroups(ThresholdingSet.java:176)
      at org.opennms.netmgt.threshd.ThresholdingSet.reinitialize(ThresholdingSet.java:125)
      at org.opennms.netmgt.threshd.ThresholdingVisitor.reload(ThresholdingVisitor.java:145)
      at org.opennms.netmgt.collectd.CollectableService.reinitializeThresholding(CollectableService.java:582)
      at org.opennms.netmgt.collectd.Collectd.handleReloadDaemonConfig(Collectd.java:1141)
      at org.opennms.netmgt.collectd.Collectd.onEventInTransaction(Collectd.java:751)
      at org.opennms.netmgt.collectd.Collectd.access$500(Collectd.java:89)
      at org.opennms.netmgt.collectd.Collectd$4.doInTransaction(Collectd.java:716)
      at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
      at org.opennms.netmgt.collectd.Collectd.onEvent(Collectd.java:713)
      at org.opennms.netmgt.eventd.EventIpcManagerDefaultImpl$ListenerThread.run(EventIpcManagerDefaultImpl.java:175)
      at java.lang.Thread.run(Thread.java:722)

      Analysis thus far: there appears to be a bug in or near the DefaultThresholdsDao that causes a null ThresholdResourceType to be passed to the mergeThresholdStateMap. This seems to happen only when an existing group gains a threshold whose ds-type attribute names a generic indexed resource-type that does not already appear on another threshold in the group. The threshold added in step 4 above need not have a ds-type of "dskIndex"; it could be any generic type as long as that type does not already appear in the "mib2" group.

      This issue was created from support ticket https://mynms.opennms.com/Ticket/Display.html?id=1974




            brozow Matt Brozowski (Inactive)
            jeffg Jeff Gehlbach
            1 Vote for this issue
            4 Start watching this issue