Lenovo WinComputer HW 라이센스 제공자 검색

IBM.WinComputer.HWLicenseProvider.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.WinComputer.HWLicenseProvider.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>IBMWinComputerHWLicense.vbs</ScriptName>
<Arguments/>
<ScriptBody><Script>

Dim featureId
SetLocale("en-us")

EventID = 114

featureId = ""
Call GetHWLicenseStatus()

Sub GetHWLicenseStatus()

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

Call LogDebugString("Entering GetHWLicenseStatus", INFO_LEVEL)

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

End Sub

Function UpdateHWLicenseState(ByRef oBag)
Call LogDebugString("Entering UpdateHWLicenseState", INFO_LEVEL)
UpdateHWLicenseState = -1
Dim oObjectItem, oManagementTargetCollection, oSystemDriver,wql, iResult, I

'LinLin need redifine..................

'iResult = licKeyValidate(featureId)
' 1, if valid but about to expire (in 14 days).
' 0, if valid.
' -1, if no license key is installed.
' -2, if the license key was already expired.
' -3, if the license key is invalid (integrity broken).
' -10, if the IMM-oriented license key was recently changed
' and needs to be reprocessed first.

' If (iResult = 1) Then
' Call oBag.AddValue("State", "Warning")
' Call oBag.AddValue("Description", "License is valid but about to expire (in 14 days)")
' ElseIf (iResult = 0) Then
' Call oBag.AddValue("State", "Healthy")
' Call oBag.AddValue("Description", "License is valid")
' ElseIf (iResult = -1) Then
' Call oBag.AddValue("State", "Error")
' Call oBag.AddValue("Description", "No license key is installed")
' ElseIf (iResult = -2) Then
' Call oBag.AddValue("State", "Error")
' Call oBag.AddValue("Description", "The license key is already expired")
' ElseIf (iResult = -3) Then
' Call oBag.AddValue("State", "Error")
' Call oBag.AddValue("Description", "The license key is invalid (integrity broken)")
' ElseIf (iResult = -10) Then
' Call oBag.AddValue("State", "Error")
' Call oBag.AddValue("Description", "The IMM-oriented license key was recently changed and needs to be reprocessed first")
' Else
' Call oBag.AddValue("State", "Error")
' Call oBag.AddValue("Description", "Unknown error")
' End If

'HungHuynh: will need to update the licKeyValidate function. For now, we use GetEndpointLic to validate the license values
dim level
'dim toke
level = ""
'toke = ""
'iResult = GetEndpointLic(level, toke)
iResult = GetEndpointLic(level)

If (iResult = -1) Then
Call oBag.AddValue("State", "Warning") ' PXB080764: Demote from Error to Warning
Call oBag.AddValue("Description", "No license key is installed")
Else
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description", "License is valid")
End If

Call LogDebugString("GetEndpointLic return: " &amp; iResult, INFO_LEVEL_DETAIL)
'UpdateDriverMissingState = 1 ''' twoffer: possible copy/paste error?
UpdateHWLicenseState = 1

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>