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

The logic to find event definitions confuses the Event Translator when translating SNMP Traps

    Details

      Description

      Eventd, the daemon responsible for handling events, has received several changes to enhance its performance especially when choosing the correct event definition to associate with an incoming event.

      On the other hand, the Event Translator can be used to generate other events based on the information from the incoming events. The Event Translator generates the translated events using a cloned version of the incoming events, overriding some fields based on the translation specification.

      Because the cloned events preserve the SNMP data, Eventd is not going to pick the correct definition.

      A user would expect that Eventd will use the UEI configured on translator-configuration.xml to pick the correct event definition for the translated event. Because the translated event contains the SNMP data associated with the incoming trap, Eventd, will use that instead to match the event definition which has the unwanted effect of having an exact copy of the original event with a different UEI, plus additional changes depending on how the translation has been configured.

      Let's say you have an SNMP Trap that generates an alarm, and you want to also use that trap to set the status of a service using the Passive Status Keeper. The Event Translator seems to be the perfect solution for this. The problem is that the translated event will have the UEI of the passiveServiceStatus, the expected parameters, but all the rest will come from the definition of the original trap, including the alarm-data, which is not expected and will have the undesired effect to have duplicate alarms (with different UEIs) that have to be manually cleared.

      For this reason, I think that we should remove the SNMP object from the cloned event to guarantee that Eventd will use the UEI to find the correct event definition for the translated event.

      If there are some corner cases on which a user requires to preserve the SNMP data on the cloned event for some reason, we can add an optional attribute to the mapping definition inside the event-translation-spec to keep the SNMP data, for example:

      <element name="mapping">
        <annotation>
          <documentation>
            A mapping for a given event. This translation is only
            applied if it is the first that matches
          </documentation>
        </annotation>
        <complexType>
          <sequence>
            <element ref="this:assignment" minOccurs="0" maxOccurs="unbounded"/>
          </sequence>
          <attribute name="preserve-snmp-data" type="boolean" use="optional" default="false"/>
        </complexType>
      </element>
      

        Attachments

          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: