If iReg < 0 Then
iResult = GetWMIObjectCollection(swNameSpace, swClassName, oCollection)
If (iResult > 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 = " & oTargetFile1, INFO_LEVEL_DETAIL)
ElseIf oFso.FileExists(oTargetFile2) Then
oFile = oTargetFile2
UpdateMissingProperty = 1
Call LogDebugString("oFile = " & oTargetFile2, INFO_LEVEL_DETAIL)
End If
If UpdateMissingProperty > 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) <> 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 > 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)
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=" & 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() > 0) Then
If (swID = SW_OSA_IPMI or swID = SW_MS_IPMI or swID = SW_IBM_IPMILAYER) and _
(IsRSAIIDaemonHealthy() > 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