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

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.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Alejandro Galue October 27, 2017 at 3:37 PM

Fixed

Details

Assignee

Reporter

Affects versions

Priority

PagerDuty

Created October 27, 2017 at 3:28 PM
Updated October 31, 2017 at 1:40 PM
Resolved October 31, 2017 at 1:40 PM

Flag notifications