Lenovo WinSw HwMgmt FailedProvider Probe

IBM.WinSw.HwMgmt.FailedProvider.Probe (ProbeActionModuleType)

Element properties:

TypeProbeActionModuleType
IsolationAny
AccessibilityPublic
RunAsDefault
OutputTypeSystem.PropertyBagData

Member Modules:

ID Module Type TypeId RunAs 
PassThrough ProbeAction System.PassThroughProbe Default
Script ProbeAction IBM.WinComputer.PropertyBagBase.Repository Default

Source Code:

<ProbeActionModuleType ID="IBM.WinSw.HwMgmt.FailedProvider.Probe" Accessibility="Public" Batching="false" PassThrough="false">
<Configuration>
<xsd:element name="TimeoutSeconds" type="xsd:integer"/>
</Configuration>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<ProbeAction ID="PassThrough" TypeID="System!System.PassThroughProbe"/>
<ProbeAction ID="Script" TypeID="IBM.WinComputer.PropertyBagBase.Repository">
<ScriptName>IBMHwMgmtSoftwareFailed.vbs</ScriptName>
<Arguments>"$Target/Property[Type="IBM.WinSw.HwMgmt"]/Name$" "$Target/Host/Property[Type="IBM.WinComputer"]/PlatformAgentInfo$"</Arguments>
<ScriptBody><Script>

SetLocale("en-us")

Dim oArgs
Set oArgs = WScript.Arguments
WScript.Echo oArgs.Count
if oArgs.Count &lt; 2 Then
'Wscript.Quit -1
End If

Dim Name, DAVersion

Name = oArgs(0)
DAVersion = oArgs(1)
EventID = 109

Call GetSoftwareRunningStatus()


Sub GetSoftwareRunningStatus()

'Set oAPI = SCOMCreateObject("MOM.ScriptAPI")

Call LogDebugString("Entering GetSoftwareRunningStatus", INFO_LEVEL_FUNCTION)
Call LogDebugString("Management Software Instance:" + Name, INFO_LEVEL_DETAIL)

Set oBag= oAPI.CreatePropertyBag()
Call UpdateFailedProperty(oBag)
Call oAPI.Return(oBag)

End Sub

Function UpdateFailedProperty(ByRef oBag)
Call LogDebugString("Entering UpdateFailedProperty", INFO_LEVEL_FUNCTION)
Dim swNameSpace, swClassName, iResult, oCollection, oObjectItem, swID, swServiceName, oSystemDrive, oTargetFile1, oTargetFile2, oFso, oFile, iReg, strNormal, strAbnormal, strQueryAbnormal, iResultCH, oCollectionCH, oObjectItemCH

iReg = -1
UpdateFailedProperty = -1
strNormal = "Unknown"
strAbnormal = "Unknown"
strQueryAbnormal = "Unknown"

If Instr(Name, INTERNAL_ID_IBM_DA) &lt;&gt; 0 Then
swNameSpace = CIMV2_NAMESPACE
swClassName = SERVICE_CIMV2_CLASS
swID = SW_IBM_DA
swServiceName = "wmicimserver"
strNormal = INTERNAL_ID_IBM_DA + ": ""wmicimserver"" service running" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_IBM_DA + ": ""wmicimserver"" service not running" ' [d504936/byou: updated]
strQueryAbnormal = "No instances exist in root\ibmsd:IBMPSG_ComponentHealth or the WMI query failed"
ElseIf Instr(Name, INTERNAL_ID_OSA_IPMI) &lt;&gt; 0 Then
swNamespace = CIMV2_NAMESPACE
swClassName = DRIVER_CIMV2_CLASS
swID = SW_OSA_IPMI
swServiceName = "IPMI"
strNormal = INTERNAL_ID_OSA_IPMI + ": driver running" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_OSA_IPMI + ": driver not running" ' [d504936/byou: updated]
ElseIf Instr(Name, INTERNAL_ID_IBM_IPMILAYER) &lt;&gt; 0 Then
swNamespace = CIMV2_NAMESPACE
swClassName = OS_CIMV2_CLASS
swID = SW_IBM_IPMILAYER
strNormal = INTERNAL_ID_IBM_IPMILAYER + ": ""ibmsp6w.dll"" functional" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_IBM_IPMILAYER + ": ""ibmsp6w.dll"" not functional" ' [d504936/byou: updated]
ElseIf Instr(Name, INTERNAL_ID_MS_IPMI) &lt;&gt; 0 Then
swNamespace = CIMV2_NAMESPACE
swClassName = DRIVER_CIMV2_CLASS
swID = SW_MS_IPMI
swServiceName = "IPMIDRV"
strNormal = INTERNAL_ID_MS_IPMI + ": driver running" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_MS_IPMI + ": driver not running" ' [d504936/byou: updated]
ElseIf Instr(Name, INTERNAL_ID_IBM_RSA) &lt;&gt; 0 Then
swNamespace = CIMV2_NAMESPACE
swClassName = SERVICE_CIMV2_CLASS
swID = SW_IBM_RSA
swServiceName = "ibmspsvc"
strNormal = INTERNAL_ID_IBM_RSA + ": ""ibmspsvc"" service running" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_IBM_RSA + ": ""ibmspsvc"" service not running" ' [d504936/byou: updated]
ElseIf Instr(Name, INTERNAL_ID_IBM_SERVERAID) &lt;&gt; 0 Then
swID = SW_IBM_SERVERAID
strNormal = INTERNAL_ID_IBM_SERVERAID + ": functional" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_IBM_SERVERAID + ": not functional" ' [d504936/byou: updated]
iReg = 1
ElseIf Instr(Name, INTERNAL_ID_IBM_MEGARAID) &lt;&gt; 0 Then
swID = SW_IBM_MEGARAID
strNormal = INTERNAL_ID_IBM_MEGARAID + ": functional" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_IBM_MEGARAID + ": not functional" ' [d504936/byou: updated]
iReg = 1
End If
Call LogDebugString(swID &amp; ": iReg=" &amp; iReg &amp;",UpdateFailedProperty=" &amp; UpdateFailedProperty, INFO_LEVEL_DETAIL)

'Detect if Director Agent is running or not
If iReg &lt; 0 Then
iResult = GetWMIObjectCollection(swNameSpace, swClassName, oCollection)
Call LogDebugString(swID &amp; ": iResult=" &amp; iResult, INFO_LEVEL_DETAIL)
If (iResult &gt; 0) Then
'Got the sw's instance
If swID = SW_IBM_IPMILAYER Then
For Each oObjectItem in oCollection
Call LogDebugString(swID &amp; ": entering foreach" , INFO_LEVEL_DETAIL)
oSystemDrive = oObjectItem.SystemDrive
oTargetFile1 = oSystemDrive + "\WINDOWS\system32\ibmsp6w.dll"
oTargetFile2 = oSystemDrive + "\WINDOWS\SysWOW64\ibmsp6w.dll"
Set oFso = CreateObject("Scripting.FileSystemObject")
If oFso.FileExists(oTargetFile1) Then
oFile = oTargetFile1
UpdateFailedProperty = 1
Call LogDebugString("oTargetFile1="&amp; oTargetFile1 &amp; " exist" , INFO_LEVEL_DETAIL)
ElseIf oFso.FileExists(oTargetFile2) Then
oFile = oTargetFile2
UpdateFailedProperty = 1
Call LogDebugString("oTargetFile2="&amp; oTargetFile2 &amp; " exist" , INFO_LEVEL_DETAIL)
End If
If UpdateFailedProperty &gt; 0 Then
'Got the instance
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL_DETAIL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description", strNormal)
Exit For
End If
Next
ElseIf swID = SW_OSA_IPMI or swID = SW_MS_IPMI or swID = SW_IBM_RSA Then
' [d504936/byou: Dir Agent 6.x or higher no longer talks to the RSA-II;
' yet there is no harm leaving the code as is.]
For Each oObjectItem in oCollection
'If InStr(oObjectItem.Name, swServiceName) &lt;&gt; 0 Then
If StrComp(Trim(oObjectItem.Name), swServiceName,1) = 0 Then
If Instr(oObjectItem.State, "Running") &lt;&gt; 0 Then
UpdateFailedProperty = 1
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL_DETAIL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description", strNormal)
End If
Exit For
End If
Next
ElseIf swID = SW_IBM_DA Then
For Each oObjectItem in oCollection
Call LogDebugString("Entering foreach" &amp; swServiceName, INFO_LEVEL_DETAIL)
'If InStr(oObjectItem.Name, swServiceName) &lt;&gt; 0 Then
If StrComp(Trim(oObjectItem.Name), swServiceName,1) = 0 Then
Call LogDebugString("Entering StrComp: " &amp; oObjectItem.Name, INFO_LEVEL_DETAIL)
If Instr(oObjectItem.State, "Running") &lt;&gt; 0 Then
Call LogDebugString("Entering oObjectItem.State: " &amp; oObjectItem.State, INFO_LEVEL_DETAIL)
UpdateFailedProperty = 1
'service for Director CS is running, then try to query the root\ibmsd:IBMPSG_ComponentHealth
iResultCH = GetWMIObjectCollection(IBMSD_NAMESPACE, COMPONENTHEALTH_IBMSD_CALSS, oCollectionCH)
If (iResultCH &gt; 0) Then
'Got instances in root\ibmsd:IBMPSG_ComponentHealth
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL_DETAIL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description", strNormal)
Else
'no instances in root\ibmsd:IBMPSG_ComponentHealth
Call LogDebugString(Name + " Error added into property bag", INFO_LEVEL)
Call oBag.AddValue("State", "Error")
Call oBag.AddValue("Description", strQueryAbnormal)
End If
End If
Exit For
End If
Next
End If
End If
Else
'iReg &gt; 0, updating ServeRAID Agent's status
Dim oReg, RC_Code, dir, oRegKey, extName,intallPath, sRegValueName
Set oReg = GetObject("winmgmts://localhost/root/default:StdRegProv")
If (not(oReg is nothing)) Then
RC_Code = oReg.GetStringValue(HKEY_LOCAL_MACHINE, WINDOWS_INFO_KEY, WINDOWS_PROGRAMFILE_DIR_X86, dir)
If swID = SW_IBM_SERVERAID Then
If IsNull(dir) Then
'32 bit system
If (IsRegExpMatched(DAVersion, "^5\.1")) Then
'Director Core Service 5.10.x
oRegKey = SOFTWARE_NODE+DA_INFO_KEY_5_10
sRegValueName = DA_EXTENSION_NAME
ElseIF(IsRegExpMatched(DAVersion, "^5\.2")) then
'Director Core Service 5.20.x
oRegKey = SOFTWARE_NODE+DA_INFO_KEY_5_20
sRegValueName = DA_EXTENSION_NAME
Else
'6.1.1 or later (as being part of the platform agent)
oRegKey = SOFTWARE_NODE + DA_INFO_KEY_SR_6
sRegValueName = "InstallLocation"
End If
Else
'64 bit system
If (IsRegExpMatched(DAVersion, "^5\.1")) Then
'Director Core Service 5.10.x
oRegKey = SOFTWARE_NODE_X86+DA_INFO_KEY_5_10
sRegValueName = DA_EXTENSION_NAME
ElseIF(IsRegExpMatched(DAVersion, "^5\.2")) then
'Director Core Service 5.20.x
oRegKey = SOFTWARE_NODE_X86+DA_INFO_KEY_5_20
sRegValueName = DA_EXTENSION_NAME
Else
'6.1.1 or later (as being part of the platform agent)
oRegKey = SOFTWARE_NODE_X86 + DA_INFO_KEY_SR_6
sRegValueName = "InstallLocation"
End If
End If
Call LogDebugString("oRegKey=" &amp; oRegKey, INFO_LEVEL_DETAIL)
RC_Code = oReg.GetStringValue(HKEY_LOCAL_MACHINE, oRegKey, sRegValueName, extName)
If NOT IsNull(extName) Then
'ServeRAID Manager Agent installed and runnig
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL_DETAIL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description", strNormal)
UpdateFailedProperty = 1
End If

ElseIf swID = SW_IBM_MEGARAID then

If IsNull(dir) Then
'32 bit system
If (IsRegExpMatched(DAVersion, "^5\.2")) Then
oRegKey = SOFTWARE_NODE+DA_INFO_KEY_MR
installPath = DA_LIBLOCATION
Else
oRegKey = SOFTWARE_NODE+"IBM\Director\Platform\Extension\IBM SBMA SMI Provider"
installPath = "InstallLocation"
End If
Else
'64 bit system
If (IsRegExpMatched(DAVersion, "^5\.2")) Then
oRegKey = SOFTWARE_NODE_X86+DA_INFO_KEY_MR
installPath = DA_LIBLOCATION
Else
oRegKey =SOFTWARE_NODE_X86+"IBM\Director\Platform\Extension\IBM SBMA SMI Provider"
installPath = "InstallLocation"
End If
End If
Call LogDebugString("oRegKey=" &amp; oRegKey, INFO_LEVEL_DETAIL)
RC_Code = oReg.GetStringValue(HKEY_LOCAL_MACHINE, oRegKey, installPath, extName)
If NOT IsNull(extName) Then
'MegaRAID provider installed and running
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL_DETAIL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description",strNormal)
UpdateFailedProperty = 1
End If
End If 'swID
End If' oReg
End If

If UpdateFailedProperty = -1 Then
' [d504936/byou: Dir Agent 6.x or higher no longer talks to the RSA-II daemon,
' so it is a critical error for Dir Agent 6.x or higher to run w/o an IPMI
' stack, but only a warning for 5.x to run with only the RSA-II daemon.]
'If (swID = SW_OSA_IPMI or swID = SW_MS_IPMI or swID = SW_IBM_IPMILAYER) and (IsRSAIIDaemonHealthy() &gt; 0) Then
If (swID = SW_OSA_IPMI or swID = SW_MS_IPMI or swID = SW_IBM_IPMILAYER) and _
(IsRSAIIDaemonHealthy() &gt; 0 and IsRegExpMatched(DAVersion, "^5\.")) Then
'Warning
Call LogDebugString(Name + " Warning added into property bag", INFO_LEVEL)
Call oBag.AddValue("State", "Warning")
Call oBag.AddValue("Description", strAbnormal)
UpdateFailedProperty = 1
ElseIf (swID = SW_IBM_RSA) and Not(IsRegExpMatched(DAVersion, "^5\.")) Then
' [d504936/byou: Dir Agent 6.x or higher no longer talks to the RSA-II daemon.]
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description", INTERNAL_ID_IBM_RSA + _
": no longer needed for Director Platform Agent 6.x or higher")
UpdateMissingProperty = 1
Else
'Error
Call LogDebugString(Name + " Error added into property bag", INFO_LEVEL)
Call oBag.AddValue("State", "Error")
Call oBag.AddValue("Description", strAbnormal)
UpdateFailedProperty = 1
End If
End If

End Function

</Script></ScriptBody>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="Script">
<Node ID="PassThrough"/>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.PropertyBagData</OutputType>
<TriggerOnly>true</TriggerOnly>
</ProbeActionModuleType>