debug = -1
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oReg = GetObject("winmgmts://localhost/root/default:StdRegProv")
If (not(oReg is nothing)) Then
RC_Code = oReg.GetStringValue(HKEY_LOCAL_MACHINE, DEBUG_INFO_KEY, DEBUG_LEVEL_NAME, debug)
If(RC_Code <>0) Then
debug = -1
End If
End If
If (WScript.Arguments.Count < 5) Then
WScript.Quit -1
End If
IPAddress = WScript.Arguments.Item(0)
EventID = WScript.Arguments.Item(1)
EventType = WScript.Arguments.Item(2)
EventSource = WScript.Arguments.Item(3)
EventDescription = WScript.Arguments.Item(4)
If ((EventType = "0") or (EventType = "1")) Then
EventType = "Error"
ElseIf (EventType = "2") Then
EventType = "Warning"
Else
' We only transfer the Error/Warning event.
EventType = "Information"
End If
'Blade event wont be translated to IB blade server.
If InStr (EventSource, "Blade_") > 0 Then
WScript.quit 0
ElseIf InStr (EventSource, "Stor_") > 0 Then
EventID = "372"
ElseIf InStr (EventSource, "IOMod_") > 0 Then
EventID = "373"
ElseIf InStr (EventSource, "Cool_") > 0 Then
EventID = "374"
ElseIf InStr (EventSource, "Power_") > 0 Then
EventID = "375"
Else
EventID = "376"
End If
'-----------------------------------------------------------------------------
' End of Main
'-----------------------------------------------------------------------------
Sub LogDebugString(debugString, debugLevel)
If (Int(debug) >= Int(debugLevel)) Then
Call oAPI.LogScriptEvent("IBMBladeCenterIBEventTrigger.vbs", 301, debugLevel, debugString)
End If