Trigger IB Event

IBM.BladeCenter.Trigger.IBEvent (WriteActionModuleType)

Trigger for generating in-band BladeCenter event

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
InputTypeSystem.BaseData
OutputTypeSystem.CommandOutput

Member Modules:

ID Module Type TypeId RunAs 
WA WriteAction Microsoft.Windows.ScriptWriteAction Default

Source Code:

<WriteActionModuleType ID="IBM.BladeCenter.Trigger.IBEvent" Accessibility="Public">
<Configuration>
<xsd:element name="IPAddress" type="xsd:string"/>
<xsd:element name="EventID" type="xsd:string"/>
<xsd:element name="EventType" type="xsd:string"/>
<xsd:element name="EventSource" type="xsd:string"/>
<xsd:element name="EventDescription" type="xsd:string"/>
</Configuration>
<ModuleImplementation>
<Composite>
<MemberModules>
<WriteAction ID="WA" TypeID="Windows!Microsoft.Windows.ScriptWriteAction">
<ScriptName>IBMBladeCenterIBEventTrigger.vbs</ScriptName>
<Arguments>"$Config/IPAddress$" "$Config/EventID$" "$Config/EventType$" "$Config/EventSource$" "$Config/EventDescription$"</Arguments>
<ScriptBody><Script>

SetLocale("en-us")

Dim EventID, IPAddress, EventType, EventSource, EventDescription
Dim oReg, RC_Code, debug
Const INFO_LEVEL = 4
Const HKEY_LOCAL_MACHINE = &amp;H80000002
Const DEBUG_INFO_KEY = "SOFTWARE\Lenovo\Lenovo SCOM MP\Debug"
Const DEBUG_LEVEL_NAME = "Level"

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 &lt;&gt;0) Then
debug = -1
End If
End If

If (WScript.Arguments.Count &lt; 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_") &gt; 0 Then
WScript.quit 0
ElseIf InStr (EventSource, "Stor_") &gt; 0 Then
EventID = "372"
ElseIf InStr (EventSource, "IOMod_") &gt; 0 Then
EventID = "373"
ElseIf InStr (EventSource, "Cool_") &gt; 0 Then
EventID = "374"
ElseIf InStr (EventSource, "Power_") &gt; 0 Then
EventID = "375"
Else
EventID = "376"
End If

EventDescription = "IBM MP BladeCenter/Blade Event. Event ID: " + EventID + ". Event Source: " + EventSource + ". Event Description: " + EventDescription + "."

Call LogDebugString("Calling GeneratePlatformOOBEvent.", INFO_LEVEL)

Call LogDebugString("Parms - IP: " + IPAddress + " EventID: " + EventID + " Source: " + EventSource + "Description: " + EventDescription, INFO_LEVEL)


Set SCOMServer = WScript.CreateObject("IBM.SystemsManagement.SCOMHelper.SCOMServer")

Call SCOMServer.GeneratePlatformOOBEvent(IPAddress, EventID, EventType, EventDescription)

WScript.Quit 0

'-----------------------------------------------------------------------------
' End of Main
'-----------------------------------------------------------------------------

Sub LogDebugString(debugString, debugLevel)
If (Int(debug) &gt;= Int(debugLevel)) Then
Call oAPI.LogScriptEvent("IBMBladeCenterIBEventTrigger.vbs", 301, debugLevel, debugString)
End If

End Sub


</Script></ScriptBody>
<TimeoutSeconds>300</TimeoutSeconds>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="WA"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.CommandOutput</OutputType>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>