Windows 2008 클러스터 리소스 그룹 검색 프로브
Microsoft.Windows.2008.Cluster.ResourceGroups.Discovery.ScriptProbe (ProbeActionModuleType)
Element properties: Member Modules:
Overrideable Parameters:
Source Code: <ProbeActionModuleType ID="Microsoft.Windows.2008.Cluster.ResourceGroups.Discovery.ScriptProbe" Accessibility="Internal" RunAs="Cluster!Microsoft.Windows.Cluster.PrivilegedAccount" Batching="false" PassThrough="false">
<Configuration>
<xsd:element minOccurs="1" name="DiscoverySourceId" type="xsd:string"/>
<xsd:element minOccurs="1" name="ClusterName" type="xsd:string"/>
<xsd:element minOccurs="1" name="Timeout" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="Timeout" Selector="$Config/Timeout$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<ProbeAction ID="Script" TypeID="Windows!Microsoft.Windows.ScriptDiscoveryProbe">
<ScriptName>DiscoverWindows2008ResourceGroups.vbs</ScriptName>
<Arguments>$Target/Host/Property[Type='Windows!Microsoft.Windows.Computer']/PrincipalName$ $Config/ClusterName$ $Config/DiscoverySourceId$ $Target/Id$</Arguments>
<ScriptBody><Script>
'Copyright (c) Microsoft Corporation. All rights reserved.
Option Explicit
SetLocale("en-us")
Dim healthServiceName
Dim clusterName
Dim groups
Dim wmi
Dim sourceId
Dim managedEntityId
Dim oAPI, oDiscoveryData, group, coreClustGroupInst, availableStorageGroupInst
healthServiceName = WScript.Arguments(0)
clusterName = WScript.Arguments(1)
sourceId = WScript.Arguments(2)
managedEntityId = WScript.Arguments(3)
Set wmi = GetObject("winmgmts:\\" + healthServiceName & "\root\mscluster")
Set groups = wmi.ExecQuery("SELECT Name FROM MSCluster_ResourceGroup")
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oDiscoveryData = oAPI.CreateDiscoveryData(0, sourceId, managedEntityId)
For Each group in groups
Dim groupType
'This method is only available on Windows 2008
groupType = group.ExecMethod_("GetGroupType").ReturnValue
If groupType = 1 Then
Set coreClustGroupInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Windows.2008.Cluster.CoreClusterGroup']$")
coreClustGroupInst.AddProperty "$MPElement[Name='ClusLibrary!Microsoft.Windows.Cluster.Component']/ClusterName$",clusterName
coreClustGroupInst.AddProperty "$MPElement[Name='ClusLibrary!Microsoft.Windows.Cluster.Component']/ObjectName$",group.Name
oDiscoveryData.AddInstance coreClustGroupInst
ElseIf groupType = 2 then
Set availableStorageGroupInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='Microsoft.Windows.2008.Cluster.AvailableStorageGroup']$")
availableStorageGroupInst.AddProperty "$MPElement[Name='ClusLibrary!Microsoft.Windows.Cluster.Component']/ClusterName$",clusterName
availableStorageGroupInst.AddProperty "$MPElement[Name='ClusLibrary!Microsoft.Windows.Cluster.Component']/ObjectName$",group.Name
oDiscoveryData.AddInstance availableStorageGroupInst
End If
Next
oAPI.Return(oDiscoveryData)
</Script> </ScriptBody>
<TimeoutSeconds>$Config/Timeout$</TimeoutSeconds>
</ProbeAction>
</MemberModules>
<Composition>
<Node ID="Script"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.Discovery.Data</OutputType>
<InputType>System!System.BaseData</InputType>
</ProbeActionModuleType>