Dim oBaseSystemInstance
If IsDirAgentRunning() > 0 Then
Set oBaseSystemInstance = oDiscoveryData.CreateClassInstance("$MPElement[Name='IBM.SystemX.BaseSystem']$")
Call oDiscoveryData.AddInstance(oBaseSystemInstance)
CreateBaseSystemInstances = 1
Call LogDebugString("CreateBaseSystemInstances successfully.", INFO_LEVEL)
End If
End Function
Function UpdateBaseSystemProperty(ByRef oBaseSystemInstance)
Call LogDebugString("Entering UpdateSystemProperty", INFO_LEVEL_FUNCTION)
Dim oPropertyValue
'Detect if Director Agent is running or not
iResult = GetWMIObjectCollection(swNamespace, swClass, oSWCollection)
If (iResult > 0) Then
For Each oObjectItem in oSWCollection
If InStr(oObjectItem.Name, swServiceName) <> 0 Then
If Instr(oObjectItem.State, "Running") <> 0 Then
Call LogDebugString(swName + " is running!", INFO_LEVEL)
IsDirAgentRunning = 1
Exit For
End If
End If
Next
End If
If IsDirAgentRunning = -1 Then
Call LogDebugString(swName + " is not running!", INFO_LEVEL)
End If
End Function
Sub GetBIOSType(ByRef sBIOSType)
sBIOSType = UNKNOWN
Dim I
For I = 0 To UBound(HardwareCapacityTable)
If InStr(UCase(machineType), HardwareCapacityTable(I)(MACHINE_TYPE)) <> 0 Then
sBIOSType = HardwareCapacityTable(I)(BIOS_TYPE)
Exit Sub
End If
Next
End Sub
Sub GetProcessorSocketCapacity(ByRef sCapacityValue)
sCapacityValue = UNKNOWN
Dim I
For I = 0 To UBound(HardwareCapacityTable)
If InStr(machineType, HardwareCapacityTable(I)(MACHINE_TYPE)) <> 0 Then
sCapacityValue = HardwareCapacityTable(I)(PROCESSORSOCKET_MAX)
Exit Sub
End If
Next
End Sub
Sub GetMemorySlotCapacity(ByRef sCapacityValue)
sCapacityValue = UNKNOWN
Dim I
For I = 0 To UBound(HardwareCapacityTable)
If InStr(machineType, HardwareCapacityTable(I)(MACHINE_TYPE)) <> 0 Then
sCapacityValue = HardwareCapacityTable(I)(DIMMSLOT_MAX)
Exit Sub
End If
Next
End Sub
Sub GetExpansionSlotCapacity(ByRef sCapacityValue)
sCapacityValue = UNKNOWN
Dim I
For I = 0 To UBound(HardwareCapacityTable)
If InStr(machineType, HardwareCapacityTable(I)(MACHINE_TYPE)) <> 0 Then
sCapacityValue = HardwareCapacityTable(I)(EXPANSIONSLOT_MAX)
Exit Sub
End If
Next
End Sub
Sub GetPowerSupplyCapacity(ByRef sCapacityValue)
sCapacityValue = UNKNOWN
Dim I
For I = 0 To UBound(HardwareCapacityTable)
If InStr(machineType, HardwareCapacityTable(I)(MACHINE_TYPE)) <> 0 Then
sCapacityValue = HardwareCapacityTable(I)(POWERSUPPLY_MAX)
Exit Sub
End If
Next
End Sub
Sub GetFirmwareVersion(ByRef sFirmwareVersion)
Call LogDebugString("Entering GetFirmwareVersion", INFO_LEVEL_FUNCTION)
sFirmwareVersion = UNKNOWN
Dim iResult, oBIOSCollection, oObjectItem
' Use root/cimv2:Win32_BIOS.SMBIOSBIOSVersion instead of root/ibmsd:IBMPSG_BIOS.Version.
' Win32_BIOS.SMBIOSBIOSVersion is a more reliable source; see data collected at
' \\byou-gate54.kirkland.ibm.com\SCOM\MP_V2.3\logs\Defect504362\all_bios_detail.log
' Note the convention of the value: "-[" + BuildLevel + "-" + Version + "]-"
iResult = GetWMIObjectCollection(CIMV2_NAMESPACE, "Win32_BIOS", oBIOSCollection)
If (iResult > 0) Then
Dim sRawVersion, iPosStart, iPosEnd, sTemp
For Each oObjectItem in oBIOSCollection
' OK to pass up as the raw value as is, since it is more complete for troubleshoot firmware problems.
sFirmwareVersion = oObjectItem.SMBIOSBIOSVersion
Call LogDebugString("Firmware verison: '" + sFirmwareVersion + "')", INFO_LEVEL)
' [Code to parse the version value according to the convention]...
' ' Parse the value of SMBIOSBIOSVersion, according to the convention.
' sRawVersion = oObjectItem.SMBIOSBIOSVersion
' iPosStart = InStr( sRawVersion, "-[" )
' iPosEnd = InStrRev( sRawVersion, "]-" )
' If (iPosStart <> 0) and (iPosEnd <> 0) and (iPosEnd > (iPosStart+2)) Then
' sTemp = Mid( sRawVersion, iPosStart+2, iPosEnd-(iPosStart+2) )
' iPosStart = InStrRev( sTemp, "-" )
' If (iPosStart <> 0) and (Len(sTemp) > iPosStart) Then
' sFirmwareVersion = Mid( sTemp, iPosStart+1, Len(sTemp)-iPosStart )
' Else
' sFirmwareVersion = sTemp
' End If
' Else
' sFirmwareVersion = sRawVersion
' End If
' Call LogDebugString("Firmware verison: '" + sFirmwareVersion + "' (raw value: '" + sRawVersion + "')", INFO_LEVEL)
Exit For ' we only need one instance
Next
Else
sFirmwareVersion = UNKNOWN
Call LogDebugString("Firmware version unknown (no instance in Win32_BIOS)!!", INFO_LEVEL)
End If
' [Code prior to 504362]...
' 'Const BIOSNAME = "System BIOS"
' Const BIOSNAME = "BIOS"
' 'Search for the Lenovo BIOS CIM Class
' iResult = GetWMIObjectCollection(IBMSD_NAMESPACE, BIOS_IBMSD_CLASS, oBIOSCollection)
' If (iResult > 0) Then
' For Each oObjectItem in oBIOSCollection
' If InStr(1,oObjectItem.Name, BIOSNAME, 1) <> 0 Then
' Call LogDebugString("BIOS Instance Presented", INFO_LEVEL)
' sFirmwareVersion = oObjectItem.Version
' Exit For
' End If
' Next
' Else
' Call LogDebugString("BIOS Instance not Presented", INFO_LEVEL)
' End If
End Sub