In the management of storage devices, daily event processing is a critical task. The following lists the script for handling trap events of some common devices. The event level can be modified as needed by the enterprise.
Sun Storage Device trap processing code:
Case ". 1.3.6.1.4.1.42.2.225.1.3 ":
@ Agent = "Sun"
$ Option_typefieldusage = "3.6"
Switch ($ specific-trap)
{
Case "1 ":
Switch ($6)
{
Case "minor ":
@ Alertgroup = "alert. AK. test4"
@ Alertkey = "pwentry ."
@ Summary = $3 + "" + $1 + "" + $6
@ Identifier = @ node + "" + @ alertkey + "" + @ alertgroup + "" + @ Summary + "" + @ agent + "" + @ manager + "" + $ specific-trap
@ Severity = 3
Case "Major ":
@ Alertgroup = "alert. AK. test3"
@ Alertkey = "pwentry ."
@ Summary = $3 + "" + $1 + "" + $6
@ Identifier = @ node + "" + @ alertkey + "" + @ alertgroup + "" + @ Summary + "" + @ agent + "" + @ manager + "" + $ specific-trap
@ Severity = 3
Case "critical ":
@ Alertgroup = "alert. AK. Test2"
@ Alertkey = "pwentry ."
@ Summary = $3 + "" + $1 + "" + $6
@ Identifier = @ node + "" + @ alertkey + "" + @ alertgroup + "" + @ Summary + "" + @ agent + "" + @ manager + "" + $ specific-trap
@ Severity = 5
Default:
@ Alertgroup = "alert. AK. test1"
@ Alertkey = "pwentry ."
@ Summary = $3 + "" + $1 + "" + $6
@ Identifier = @ node + "" + @ alertkey + "" + @ alertgroup + "" + @ Summary + "" + @ agent + "" + @ manager + "" + $ specific-trap
@ Severity = 0
}
@ Alertgroup = "alert. AK. test"
@ Alertkey = "pwentry ."
@ Summary = $3 + "" + $1 + "" + $6
@ Identifier = @ node + "" + @ alertkey + "" + @ alertgroup + "" + @ Summary + "" + @ agent + "" + @ manager + "" + $ specific-trap
Details ($ *)
Default:
@ Summary = $3 + "" + $1
@ Severity = 0
@ Identifier = @ node + "" + @ agent + "" + @ manager + "" + $ enterprise + "" + $ generic-trap + "" + $ specific-trap
Details ($ *)
}