'Detect if Director Agent is running or not
If iReg < 0 Then
iResult = GetWMIObjectCollection(swNameSpace, swClassName, oCollection)
Call LogDebugString(swID & ": iResult=" & iResult, INFO_LEVEL_DETAIL)
If (iResult > 0) Then
'Got the sw's instance
If swID = SW_IBM_IPMILAYER Then
For Each oObjectItem in oCollection
Call LogDebugString(swID & ": 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="& oTargetFile1 & " exist" , INFO_LEVEL_DETAIL)
ElseIf oFso.FileExists(oTargetFile2) Then
oFile = oTargetFile2
UpdateFailedProperty = 1
Call LogDebugString("oTargetFile2="& oTargetFile2 & " exist" , INFO_LEVEL_DETAIL)
End If
If UpdateFailedProperty > 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) <> 0 Then
If StrComp(Trim(oObjectItem.Name), swServiceName,1) = 0 Then
If Instr(oObjectItem.State, "Running") <> 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" & swServiceName, INFO_LEVEL_DETAIL)
'If InStr(oObjectItem.Name, swServiceName) <> 0 Then
If StrComp(Trim(oObjectItem.Name), swServiceName,1) = 0 Then
Call LogDebugString("Entering StrComp: " & oObjectItem.Name, INFO_LEVEL_DETAIL)
If Instr(oObjectItem.State, "Running") <> 0 Then
Call LogDebugString("Entering oObjectItem.State: " & 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 > 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 > 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=" & 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=" & 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() > 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)
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