User Tools

Site Tools


onboarding:snmpmanager:trap_rule_checklist

Trap Rule Checklist

Author: Eoin Joy

For each trap rule, there are certain principles which they must follow for best practices and future maintenance purposes.
The Trap Rule Checklist aims to ensure that these principles are upheld each time a trap rule is worked on.
The Trap Rule Checklist is similar to the Report Checklist.
The Trap Rule Checklist however has not yet been formalised as the Report Checklist has.
The Trap Rule Checklist template can be found here: Google Docs Link.
The checklist has been written from the perspective of new rule creation, but the principles also apply to edits of existing rules.


Trap Rule Do's and Dont's

Author: Colm Carew

DO

  • Use a transaction when saving a domain class (eg. GeneralTrapSummary, DasHub)
  • Find the DasHub by the following order of convention based on available information: IP Address, Name In Trap, Name
  • Handle the situation where you cannot find the affected node by sending a MissingUnitTrap
  • Create a new orphan hub when you cannot find one. This hub should in all cases set the value that you tested for when you could not find it in the first place. i.e. we don't want duplicates
  • Access the trap's varbinds at the beginning of the rule and name the local variables populated from these sensibly
  • Clearly comment your changes, include ticket number where applicable
  • Set the ticket workflow manually if the network element does not have one
  • Use the available trap class to create the General Trap Summary Wrapper (unless this trap class contradicts with the live structure of the system)
  • If not using a trap class, set all possible General Trap Summary fields.
  • Enquire if changes to the NE structure (ie. naming of elements etc.) are possible if you need them to make the rule deterministic
  • Use the same information for GTS, Ticket, and SNMP Trap Form entries
  • Test several situations for alarm and ticket behaviour, including:
    1. Alarm, Clear
    2. Alarm, Manual Acknowledge, Clear
    3. Alarm, Automatic Ack., Clear

DON'T

  • Do not encase the whole rule in a single transaction
  • Do not create a new DasNode if you cannot find one
  • Do not apply the trap to the SPACE_HOLDER element
  • Do not reference specific ip addresses or network elements in the logic of the rule
  • Do not assume naming delimiters will not be used in individual parts of names (eg. SE-FL-HUB-NAME-HOSTNAME-REMOTE-NAME-1 and SE-FL-HUBNAME-HOSTNAME-REMOTENAME-1 should both be accounted for if a regex is used)
  • Do not assume the existing trap class is infallible or still accurate to reality
  • Do not interact with metaclass

Naming Convention for Ticket Summary and SNMP Trap From - ne_name

Author: Yanjun Wang

As the Ticket Summary and some fields of SNMP Trap From will be used for parsing information in Ticketer Groovlet and matching bouncing Tickets, it's important to have them follow the same naming convention.

Ticket Summary:

  • hubName: Link Down
  • hubName:%
  • hubName - nodeName:%

SNMP Trap Form - ne_name:

  • Hub only: hubName
  • Child level: hubName - nodeName

Trap Rule Helper Methods

Author: Andrey Shevyakov

Release: REL-3.5

Methods:

  • TrapUtils.generateTicketValues(String workflow, String cluster, String status, String summary, def priority) - returns the map containing the values required for the ticket creation, replaces the following repeating code in the existing rules:
    HashMap < String, String > ticketValues = new HashMap < String, String > ()
    ticketValues.put("WORKFLOW", workflowName)
    ticketValues.put("MARKET", ne.clusterName)
    ticketValues.put("STATUS", "Alarm Received")
    ticketValues.put("CREATOR", "monitor")
    ticketValues.put("SUMMARY", summaryString)
    ticketValues.put("VISIBILITY", ne.clusterName)
    ticketValues.put("PRIORITY", "5")
  • TrapUtils.generateSnmpTrapFormValues(String neName, GeneralTrapSummary gts) - returns the map containing the values required for the “SNMP Trap” form (attached to the ticket) creation, replaces the following repeating code in the existing rules:
    HashMap < String, String > formValues = new HashMap < String, String > ()
    formValues.put("FORM_NAME_PARAM", "SNMP Trap")
    if (isHub) formValues.put("ne_name", ne.name)
    if (!isHub) formValues.put("ne_name", parentNe.name + " - " + ne.name)
    formValues.put("alarm_id", gtsw.getDomain().id + "")
    formValues.put("trap_name", gtsw.getDomain().trapName)
    formValues.put("trap_severity", gtsw.getDomain().alarmStatus)
    formValues.put("trap_text", gtsw.getDomain().summary)
    formValues.put("source", java.net.InetAddress.localHost.hostName.split("\\.")[0] ?: "")
    formValues.put("context", gtsw.domain.alarmIdentifier)
    formValues.put("received_date", trap.date)
    formValues.put("received_time", new java.sql.Time(trap.date.time))
onboarding/snmpmanager/trap_rule_checklist.txt · Last modified: 2021/06/25 10:09 by 127.0.0.1