Netcool/OMNIbus Probe脚本编写例子(1)
在存储设备的管理中,日常事件的处理是非常关键的一个工作,下面列举一些常见设备的TRAP事件处理脚本,事件级别可以根据企业需要自行修改
SUN 存储设备TRAP处理代码:
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($*)
}