Lenovo WinSw HwMgmt MissingProvider Probe

IBM.WinSw.HwMgmt.MissingProvider.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.MissingProvider.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>IBMHwMgmtSoftwareMissing.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 = 108

Call GetSoftwareMissingStatus()


Sub GetSoftwareMissingStatus()

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

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

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

End Sub

Function UpdateMissingProperty(ByRef oBag)
Call LogDebugString("Entering UpdateMissingProperty", INFO_LEVEL_FUNCTION)
Dim swNameSpace, swClassName, iResult, oObjectItem, oCollection, swID, swServiceName, osVersion, spVersion, iRSAState, iMSIPMIState, oSystemDrive, oTargetFile1, oTargetFile2, oTargetFile, oFso, oFile, iReg, strNormal, strAbnormal

UpdateMissingProperty = -1
iReg = -1
strNormal = "Unknown"
strAbnormal = "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 present and enabled" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_IBM_DA + ": ""wmicimserver"" service missing or disabled" ' [d504936/byou: updated]
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 present and enabled" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_OSA_IPMI + ": driver missing or disabled" ' [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"" present" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_IBM_IPMILAYER + ": ""ibmsp6w.dll"" missing" ' [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 present and enabled" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_MS_IPMI + ": driver missing or disabled" ' [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 present and enabled" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_IBM_RSA + ": ""ibmspsvc"" service missing or disabled" ' [d504936/byou: updated]
ElseIf Instr(Name, INTERNAL_ID_IBM_SERVERAID) &lt;&gt; 0 Then
swID = SW_IBM_SERVERAID
strNormal = INTERNAL_ID_IBM_SERVERAID + ": present and accessible" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_IBM_SERVERAID + ": missing or inaccessible" ' [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 + ": present and accessible" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_IBM_MEGARAID + ": missing or inaccessible" ' [d504936/byou: updated]
iReg = 1
End If

If iReg &lt; 0 Then
iResult = GetWMIObjectCollection(swNameSpace, swClassName, oCollection)
If (iResult &gt; 0) Then
'Got the sw instances
If swID = SW_IBM_IPMILAYER Then
For Each oObjectItem in oCollection
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
UpdateMissingProperty = 1
Call LogDebugString("oFile = " &amp; oTargetFile1, INFO_LEVEL_DETAIL)
ElseIf oFso.FileExists(oTargetFile2) Then
oFile = oTargetFile2
UpdateMissingProperty = 1
Call LogDebugString("oFile = " &amp; oTargetFile2, INFO_LEVEL_DETAIL)
End If
If UpdateMissingProperty &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_IBM_DA or 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 daemon,
' however, it is still OK for the RSA-II daemon to be running.]
For Each oObjectItem in oCollection
'If InStr(oObjectItem.Name, swServiceName) &lt;&gt; 0 Then
If StrComp(Trim(oObjectItem.Name), swServiceName,1) = 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)
UpdateMissingProperty = 1
Exit For
End If
Next
End If
End If
Else
'iReg &gt; 0, updating ServeRAID and MegaRAID provider's status
Dim oReg, RC_Code, dir, oRegKey, extName, installPath, 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)


'Const SOFTWARE_NODE_X86 = "SOFTWARE\Wow6432Node\"
'Const SOFTWARE_NODE = "SOFTWARE\"
'Const DA_INFO_KEY_5_10 = "IBM\Director\ExtInfo\ServeRAID Manager Agent"
'Const DA_INFO_KEY_5_20 = "IBM\Director\ExtInfo\ServeRAID Manager Level-1 Agent"
'Const DA_INFO_KEY_SR_6 = "IBM\Director\Platform\Extension\ServeRAID Manager Level-1 Agent"
'Const DA_EXTENSION_NAME = "ExtensionName"
' [HKEY_LOCAL_MACHINE\SOFTWARE\IBM\Director\Platform\CurrentVersion]

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
RC_Code = oReg.GetStringValue(HKEY_LOCAL_MACHINE, oRegKey, sRegValueName, extName)
If NOT IsNull(extName) Then
'ServeRAID Manager Agent installed
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL_DETAIL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description",strNormal)
UpdateMissingProperty = 1
End If

ElseIf swID = SW_IBM_MEGARAID then
'Const DA_INFO_KEY_MR = "IBM\SBMA_MR"
'Const DA_LIBLOCATION = "LibLocation"
'[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\IBM\Director\Platform\Extension\IBM SBMA SMI Provider]
'"Version"="80.07.0559"
'"ProductCode"="{E6FA3E06-5865-4BD2-9DB5-BBD883B42B73}"
'"Uninstall"="msiexec -x {E6FA3E06-5865-4BD2-9DB5-BBD883B42B73}"
'"InstallLocation"="C:\\Program Files (x86)\\Common Files\\IBM\\ICC\\cimom"
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
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description",strNormal)
UpdateMissingProperty = 1
End If
End If
End If
End If
If UpdateMissingProperty = -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)
UpdateMissingProperty = 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)
UpdateMissingProperty = 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>