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

Unexpected errors while generating event definitions from TRAP-TYPE without a DESCRIPTION field

    XMLWordPrintable

    Details

      Description

      The MIB compiler is able to successfully compile MIBs when you have trap definitions like this one:

      gwmonPeriodicTrap TRAP-TYPE
              ENTERPRISE    gwmonTraps
              VARIABLES     {gwmonTrapTime }
              --ManageWise Trap annotation
              --#TYPE       "GroupWise Monitor periodic trap."
              --#SUMMARY    "GroupWise Monitor periodic trap."
              --#ARGUMENTS  { }
              --#SEVERITY   INFORMATIONAL
              --#TIMEINDEX  0
              --#STATE      OPERATIONAL
              ::= 6
      
      END

      Unfortunately, the parser expects to find a DESCRIPTION field on a Notification object, like the following example:

      gwmonThresholdExceededTrap TRAP-TYPE
              ENTERPRISE    gwmonTraps
              VARIABLES     {gwmonTrapTime, gwmonAgentType, gwmonAgentName, gwmonServerName, gwmonServerIPAddress, gwmonThresholdValues, gwmonThresholdSeverity }
              DESCRIPTION   "GroupWise Monitor detects a threshold has been exceeded"
              --ManageWise Trap annotation
              --#TYPE       "GroupWise threshold exceeded."
              --#SUMMARY    "GroupWise Monitor detects a threshold has been exceeded for %s. Threshold: [%s]"
              --#ARGUMENTS  { 3,6 }
              --#SEVERITY   MAJOR
              --#TIMEINDEX  0
              --#STATE      DEGRADED
              ::= 1

      Without code changes, you have to add some description to each trap/notification definition that lacks from it, in order to use the current code.

      I think it would be good to add some defensive code to write something like "No Description" on the Event's description field, and continue parsing the file.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: