Lenovo WinSw HwMgmt IncompatibleProvider Probe

IBM.WinSw.HwMgmt.IncompatibleProvider.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.IncompatibleProvider.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>IBMHwMgmtSoftwareIncompatible.vbs</ScriptName>
<Arguments>"$Target/Property[Type="IBM.WinSw.HwMgmt"]/Name$"</Arguments>
<ScriptBody><Script>

SetLocale("en-us")
Dim oArgs
Set oArgs = WScript.Arguments
WScript.Echo oArgs.Count
if oArgs.Count &lt; 1 Then
'Wscript.Quit -1
End If

Dim Name

Name = oArgs(0)
EventID = 110
Call GetSoftwareIncompatibleStatus()


Sub GetSoftwareIncompatibleStatus()

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

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

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

End Sub

Function UpdateIncompatibleProperty(ByRef oBag)
Call LogDebugString("Entering UpdateIncompatibleProperty", INFO_LEVEL_DETAIL)
Dim swNameSpace, swClassName, swName, swVersion, iResult, oCollection, oObjectItem, osVersion, spVersion, iIncompatible

UpdateIncompatibleProperty = -1
osVersion = -1
spVersion = -1
swVersion = -1
strNormal = "Unknown"
strAbnormal = "Unknown"

If Instr(Name, INTERNAL_ID_IBM_DA) &lt;&gt; 0 Then
strNormal = INTERNAL_ID_IBM_DA + ": no compatibility issue" ' [d504936/byou: updated]
strAbnormal = INTERNAL_ID_IBM_DA + ": incompatible" ' [d504936/byou: updated]
swID = SW_IBM_DA
ElseIf Instr(Name, INTERNAL_ID_OSA_IPMI) &lt;&gt; 0 Then
strNormal = INTERNAL_ID_OSA_IPMI + ": no compatible issue"
strAbnormal = INTERNAL_ID_OSA_IPMI + ": incompatible"
swID = SW_OSA_IPMI
ElseIF Instr(Name, INTERNAL_ID_IBM_IPMILAYER) &lt;&gt; 0 Then
strNormal = INTERNAL_ID_IBM_IPMILAYER + ": no compatible issue"
strAbnormal = INTERNAL_ID_IBM_IPMILAYER + ": incompatible"
swID = SW_IBM_IPMILAYER
ElseIF Instr(Name, INTERNAL_ID_MS_IPMI) &lt;&gt; 0 Then
strNormal = INTERNAL_ID_MS_IPMI + ": no compatible issue"
strAbnormal = INTERNAL_ID_MS_IPMI + ": incompatible"
swID = SW_MS_IPMI
ElseIF Instr(Name, INTERNAL_ID_IBM_RSA) &lt;&gt; 0 Then
strNormal = INTERNAL_ID_IBM_RSA + ": no compatible issue"
strAbnormal = INTERNAL_ID_IBM_RSA + ": incompatible"
swID = SW_IBM_RSA
ElseIF Instr(Name, INTERNAL_ID_IBM_SERVERAID) &lt;&gt; 0 Then
strNormal = INTERNAL_ID_IBM_SERVERAID + ": no compatible issue"
strAbnormal = INTERNAL_ID_IBM_SERVERAID + ": incompatible"
swID = SW_IBM_SERVERAID
ElseIF Instr(Name, INTERNAL_ID_IBM_MEGARAID) &lt;&gt; 0 Then
strNormal = INTERNAL_ID_IBM_MEGARAID + ": no compatible issue"
strAbnormal = INTERNAL_ID_IBM_MEGARAID + ": incompatible"
swID = SW_IBM_MEGARAID
End If

swVersion = GetCurrentSWVersion()
If GetOSInfo(osVersion, spVersion) &lt; 0 Then
Call LogDebugString("Could not get OS Info", INFO_LEVEL_DETAIL)
End If

If swVersion &lt;&gt; -1 and osVersion &lt;&gt; -1 Then
Call AddIncompatibleBag(swVersion, osVersion, spVersion)
End If

End Function

Function GetCurrentSWVersion()
Call LogDebugString("Entering GetCurrentSWVersion", INFO_LEVEL_FUNCTION)
Dim iResult, oServiceCollection, oObjectItem, svTargetFile, oFso, oFile, svNamespace, svClass, svServiceName, isvFlag, oSystemDrive, oTargetFile1, oTargetFile2
isvFlag = -1
GetCurrentSWVersion = -1
If Instr(Name, INTERNAL_ID_IBM_DA) &lt;&gt; 0 Then
svNamespace = CIMV2_NAMESPACE
svClass = SERVICE_CIMV2_CLASS
svServiceName = "wmicimserver"
swID = SW_IBM_DA
ElseIf Instr(Name, INTERNAL_ID_OSA_IPMI) &lt;&gt; 0 Then
svNamespace = CIMV2_NAMESPACE
svClass = DRIVER_CIMV2_CLASS
svServiceName = "IPMI"
swID = SW_OSA_IPMI
ElseIF Instr(Name, INTERNAL_ID_IBM_IPMILAYER) &lt;&gt; 0 Then
svNamespace = CIMV2_NAMESPACE
svClass = OS_CIMV2_CLASS
swID = SW_IBM_IPMILAYER
ElseIF Instr(Name, INTERNAL_ID_MS_IPMI) &lt;&gt; 0 Then
svNamespace = CIMV2_NAMESPACE
svClass = DRIVER_CIMV2_CLASS
svServiceName = "IPMIDRV"
swID = SW_MS_IPMI
ElseIF Instr(Name, INTERNAL_ID_IBM_RSA) &lt;&gt; 0 Then
svNamespace = CIMV2_NAMESPACE
svClass = SERVICE_CIMV2_CLASS
svServiceName = "ibmspsvc"
swID = SW_IBM_RSA
ElseIF Instr(Name, INTERNAL_ID_IBM_SERVERAID) &lt;&gt; 0 Then
'No ServeRAID Agent's version info available
GetCurrentSWVersion = 1
swID = SW_IBM_SERVERAID
Exit Function
End If

'Search for the IBM Director Agent WIM CIM Server process
iResult = GetWMIObjectCollection(svNamespace, svClass, oServiceCollection)
If (iResult &gt; 0) Then
If Instr(Name, INTERNAL_ID_IBM_IPMILAYER) &lt;&gt; 0 Then
For Each oObjectItem in oServiceCollection
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
isvFlag = 1
ElseIf oFso.FileExists(oTargetFile2) Then
oFile = oTargetFile2
isvFlag = 1
End If
If isvFlag &gt; 0 Then
GetCurrentSWVersion = oFso.GetFileVersion(oFile)
Call LogDebugString(Name + " 's Version:" + GetCurrentSWVersion, INFO_LEVEL_DETAIL)
Exit For
End If
Next
Else
For Each oObjectItem in oServiceCollection
If InStr(oObjectItem.Name, svServiceName) &lt;&gt; 0 Then
isvFlag = 1
svTargetFile = oObjectItem.PathName
If Instr(svTargetFile, """") &lt;&gt; 0 Then
oFile = GetAccurateName(svTargetFile)
Else
oFile = svTargetFile
End If
Set oFso = CreateObject("Scripting.FileSystemObject")
If oFso.FileExists(oFile) Then
GetCurrentSWVersion = oFso.GetFileVersion(oFile)
Else
GetCurrentSWVersion =""
End If
Call LogDebugString(Name + " 's Version:" + GetCurrentSWVersion, INFO_LEVEL_DETAIL)
Exit For
End If
Next
End If
End If
If GetCurrentSWVersion = -1 Then
Call LogDebugString(svServiceName + " Service not Presented", INFO_LEVEL)
End If
End Function

Function DirectorServiceUpdate()
'HKEY_LOCAL_MACHINE\SOFTWARE\IBM\Director\DirectorPE\Patches
''[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\IBM\Director
DirectorServiceUpdate = -1
Dim oReg, RC_Code,subkeys
Set oReg = GetObject("winmgmts://localhost/root/default:StdRegProv")
If (not(oReg is nothing)) Then
RC_Code = oReg.EnumKey(HKEY_LOCAL_MACHINE,"SOFTWARE\Wow6432Node\IBM\Director\DirectorPE\Patches" , subkeys)

if RC_code &lt;&gt; 0 then 'failed
RC_Code = oReg.EnumKey(HKEY_LOCAL_MACHINE,"SOFTWARE\IBM\Director\DirectorPE\Patches" , subkeys)
end if
if RC_code = 0 then' success
DirectorServiceUpdate = 1

else
DirectorServiceUpdate = -1

end if

End If
Wscript.echo "DirectorServiceUpdate " &amp; DirectorServiceUpdate
End Function
Sub AddIncompatibleBag(ByVal swVersion, ByVal osVersion, ByVal spVersion)
Call LogDebugString("Entering AddIncompatibleBag", INFO_LEVEL_FUNCTION)

' XB047042/byou: report an error for any reason that we cannot locate the version of the driver or the service.
If InStr(LCase(swVersion), "undetermined") &lt;&gt; 0 Then
Call LogDebugString(Name + " Error added into property bag (verison undermined)", INFO_LEVEL)
Call oBag.AddValue("State", "Error")
Call oBag.AddValue("Description", Name + ": " + swVersion)
Exit Sub
End If

If Instr(Name, INTERNAL_ID_IBM_DA) &lt;&gt; 0 Then
'Director Agent --- 5.20.3 su1 or later required for WS08 or later
If ((StrComp(swVersion, "5.20.3.00") &lt; 0) and (StrComp(osVersion, "6.0.0000") &gt;= 0)) Then
Call LogDebugString(Name + " Error added into property bag", INFO_LEVEL)
Call oBag.AddValue("State", "Error")
' [d504936/byou: updated]...
Call oBag.AddValue("Description", strAbnormal + _
" with Windows Server 2008 or later -- 5.20.3 su1 or later needed!!")
ElseIf ((IsRegExpMatched(swVersion, "^5\.20\.3"))and (DirectorServiceUpdate() &lt;0) and (StrComp(osVersion, "6.0.0000") &gt;= 0)) then
Call LogDebugString(Name + " Error added into property bag", INFO_LEVEL)
Call oBag.AddValue("State", "Error")
Call oBag.AddValue("Description", strAbnormal + _
" with Windows Server 2008 or later -- 5.20.3 su1 or later needed!!")
Else
' [d504936/byou: Dir Agent 6.x or higher no longer talks to the RSA-II,
' so flag the incompatible error on Director Agent, only for systems that have
' RSA-II, but no BMC/IMM, regardless if RSA-II daemon is running or not.]
'As 6.1.1 is not supporting RSA, we flag an incompatible error on RSA daemon, or Director Agent, or both -- if they both run on the same system
'Only systems that have only RSA and don't have BMC/IMM are not supported by the IBM Platform agent version 6.1.2.
'Systems with BMC, regardless of having RSA, are supported by the IBM Platform agent version 6.1.2.
If (Not(IsRegExpMatched(swVersion, "^5\.")) and (RSAPresented() &gt; 0) and (BMCPresented() &lt; 0)) Then
Call LogDebugString(Name + " Error added into property bag", INFO_LEVEL)
Call oBag.AddValue("State", "Error")
Call oBag.AddValue("Description", strAbnormal + _
" of Platform Agent 6.x or higher with systems that has only RSA-II and no BMC.")
Else
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL_DETAIL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description", strNormal)
End If
End If
ElseIf Instr(Name, INTERNAL_ID_OSA_IPMI) &lt;&gt; 0 Then
'OSA IPMI --- when Microsoft IPMI Stack also present or if on WS08 or later
If (IsSoftwareRunning(INTERNAL_ID_MS_IPMI) &gt; 0) or (StrComp(osVersion, "6.0.0000") &gt;= 0) Then
' [d504936/byou: either condition is critical, regardless RSA-II daemon running or not]...
' If SoftwareRunning(INTERNAL_ID_IBM_RSA) &gt; 0 Then
' Call LogDebugString(Name + " Warning added into property bag", INFO_LEVEL)
' Call oBag.AddValue("State", "Warning")
' Call oBag.AddValue("Description", strAbnormal)
' Else
Call LogDebugString(Name + " Error added into property bag", INFO_LEVEL)
Call oBag.AddValue("State", "Error")
Call oBag.AddValue("Description", strAbnormal + _
" with Windows Server 2008 or higher;" + _
" nor with Microsoft IPMI driver present at the same time.")
' End If
Else
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL_DETAIL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description", strNormal)
End If
ElseIF Instr(Name, INTERNAL_ID_IBM_IPMILAYER) &lt;&gt; 0 Then
'IBM Mapping Layer --- special version needed for multi-node systems with Microsoft IPMI Stack
ElseIF Instr(Name, INTERNAL_ID_MS_IPMI) &lt;&gt; 0 Then
'Microsoft IPMI --- when OSA/Avocent IPMI Driver also present, or if on earlier than WS03 R2
If (IsSoftwareRunning(INTERNAL_ID_OSA_IPMI) &gt; 0) or (StrComp(osVersion, "5.2.0000") &lt; 0) or (IsRegExpMatched(osVersion, "^5\.2") and (1 &lt;&gt; IsWin2k3r2())) Then
' [d504936/byou: either condition is critical, regardless RSA-II daemon running or not]...
' If IsSoftwareRunning(INTERNAL_ID_IBM_RSA) &gt; 0 Then
' Call LogDebugString(Name + " Warning added into property bag", INFO_LEVEL)
' Call oBag.AddValue("State", "Warning")
' Call oBag.AddValue("Description", strAbnormal)
' Else
Call LogDebugString(Name + " Error added into property bag", INFO_LEVEL)
Call oBag.AddValue("State", "Error")
Call oBag.AddValue("Description", strAbnormal + _
" with Windows that is earlier than Windows Server 2003 R2;" + _
" nor with Avocent/OSA IPMI driver present at the same time.")
' End If
Else
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL_DETAIL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description", strNormal)
End If
ElseIF Instr(Name, INTERNAL_ID_IBM_RSA) &lt;&gt; 0 Then
'RSA Daemon --- no known cause yet
' [d504936/byou: Dir Agent 6.x or higher no longer talks to the RSA-II; but
' there is no harm leaving the RSA daemon running]...
'tempName = Name
'Name = INTERNAL_ID_IBM_DA '"Director Core Services"
'daVersion= GetCurrentSWVersion()
'Name = tempName
''As 6.1.1 is not supporting RSA, we flag an incompatible error on RSA daemon, or Director Agent, or both -- if they both run on the same system
''Only systems that have only RSA and don't have BMC/IMM are not supported by the IBM Platform agent version 6.1.x.
''Systems with BMC, regardless of having RSA, are supported by the IBM Platform agent version 6.1.1 and later.
''The net: systems with RSA and no BMC are supported only by Director agent 5.x.
'If ((Not(IsRegExpMatched(daVersion, "^5\."))) and (IsSoftwareRunning(INTERNAL_ID_IBM_RSA) &gt; 0) and (BMCPresented() &lt; 0)) then
' Call LogDebugString(Name + " Error added into property bag", INFO_LEVEL)
' Call oBag.AddValue("State", "Error")
' Call oBag.AddValue("Description", strAbnormal)
'Else
Call LogDebugString(Name + " Healthy added into property bag", INFO_LEVEL)
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description", strNormal)
'End If

ElseIF Instr(Name, INTERNAL_ID_IBM_SERVERAID) &lt;&gt; 0 Then
'ServeRAID Agent --- 9.00.0.0+ required for
'But no ServeRAID Agent's version info available
End If

End Sub

Function IsSoftwareRunning(ByVal swID)
Call LogDebugString("Entering IsSoftwareRunning", INFO_LEVEL_FUNCTION)
IsSoftwareRunning = -1

Dim iResult, oSWCollection, swNamespace, swClass, oObjectItem, swServiceName, swName

If Instr(swID, INTERNAL_ID_OSA_IPMI) &lt;&gt; 0 Then
swNamespace = CIMV2_NAMESPACE
swClass = DRIVER_CIMV2_CLASS
swServiceName = "IPMI"
swName = "OSA IPMI Driver"
ElseIf Instr(swID, INTERNAL_ID_MS_IPMI) &lt;&gt; 0 Then
swNamespace = CIMV2_NAMESPACE
swClass = DRIVER_CIMV2_CLASS
swServiceName = "IPMIDRV"
swName = "Microsoft IPMI Stack"
ElseIf Instr(swID, INTERNAL_ID_IBM_RSA) &lt;&gt; 0 Then
swNamespace = CIMV2_NAMESPACE
swClass = SERVICE_CIMV2_CLASS
swServiceName = "ibmspsvc"
swName = "IBM RSA Daemon"
End If

'Detect if Director Agent presents or not
iResult = GetWMIObjectCollection(swNamespace, swClass, oSWCollection)
If (iResult &gt; 0) Then
For Each oObjectItem in oSWCollection
If StrComp(Trim(oObjectItem.Name), swServiceName,1) = 0 Then
If Instr(oObjectItem.State, "Running") &lt;&gt; 0 Then
Call LogDebugString(swName + " Running!", INFO_LEVEL_DETAIL)
IsSoftwareRunning = 1
Exit For
End If
End If
Next
End If

If IsSoftwareRunning = -1 Then
Call LogDebugString(swName + " not Presented!", INFO_LEVEL)
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>