이 모듈은 Microsoft Windows Server 2012 운영 체제를 실행 중이고 DHCP 기능을 사용하도록 설정된 서버의 인스턴스를 사용하여 “DHCP 2012 R2 Server 그룹”이라는 DHCP 2012 R2 Server 그룹 구성원의 대범위 IPV4에 대해 수집한 통계 데이터를 가져옵니다.
간격(초): 값을 확인해야 하는 빈도(초)입니다.
동기화 시간: 모듈 실행에 대한 동기화 시간입니다.
제한 시간(초): 모듈 실행이 종료되는 데 걸리는 시간(초)입니다.
Type | DataSourceModuleType |
Isolation | Any |
Accessibility | Public |
RunAs | Default |
OutputType | System.Performance.Data |
ID | Module Type | TypeId | RunAs |
---|---|---|---|
DS | DataSource | System.SimpleScheduler | Default |
PS | ProbeAction | Microsoft.Windows.PowerShellDiscoveryProbe | Default |
InstanceFilter | ConditionDetection | System.ExpressionFilter | Default |
PerfMapper | ConditionDetection | System.Performance.DataGenericMapper | Default |
ID | ParameterType | Selector | Display Name | Description |
---|---|---|---|---|
IntervalSeconds | int | $Config/IntervalSeconds$ | 간격(초) | 값을 샘플링해야 하는 빈도(초)입니다. |
SyncTime | string | $Config/SyncTime$ | 동기화 시간 | 모듈 실행에 대한 동기화 시간입니다. |
TimeoutSeconds | int | $Config/TimeoutSeconds$ | 제한 시간(초) | 모듈 실행이 종료되는 데 걸리는 시간(초)입니다. |
<DataSourceModuleType ID="Microsoft.Windows.DHCPServer.2012.R2.FilteredSuperScopeStats.DS" Accessibility="Public" Batching="false">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="SuperScope" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="CounterName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ComputerName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="IntervalSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="SyncTime" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="TimeoutSeconds" type="xsd:integer"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string"/>
<OverrideableParameter ID="TimeoutSeconds" Selector="$Config/TimeoutSeconds$" ParameterType="int"/>
</OverrideableParameters>
<ModuleImplementation Isolation="Any">
<Composite>
<MemberModules>
<DataSource ID="DS" TypeID="System!System.SimpleScheduler">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<SyncTime>$Config/SyncTime$</SyncTime>
</DataSource>
<ProbeAction ID="PS" TypeID="Windows!Microsoft.Windows.PowerShellDiscoveryProbe">
<ScriptName>DHCPSuperScopes2012R2Probe</ScriptName>
<ScriptBody>
param ([String] $PrincipalName)
$SCRIPT_NAME = "DHCPSuperScopes2012R2Probe"
$ErrorActionPreference = "Stop"
# Event type constants
$EVENT_TYPE_LOG = 0
$EVENT_TYPE_ERROR = 1
$EVENT_TYPE_WARNING = 2
$EVENT_TYPE_INFORMATION = 4
# Typed property bag constants
$PROPERTY_TYPE_ALERT = 0
$PROPERTY_TYPE_EVENT = 1
$PROPERTY_TYPE_PERFORMANCE = 2
$PROPERTY_TYPE_STATE = 3
# State type constants
$STATE_SUCCESS = "Success"
$STATE_WARNING = "Warning"
$STATE_ERROR = "Error"
$momAPI = new-object -comObject MOM.ScriptAPI
Write-Host "$SCRIPT_NAME - Executing DHCP Super Scope 2012 R2 Probe Powershell Script"
try
{
$SuperScopes = Get-DhcpServerv4SuperscopeStatistics -ComputerName $PrincipalName
if($SuperScopes.Length -eq $null)
{
$SuperScopeCount = 1
}
else
{
$SuperScopeCount = $SuperScopes.Length
}
for ($itmSupScp=0; $itmSupScp -lt $SuperScopeCount; $itmSupScp++)
{
if($SuperScopes.Length -eq $null)
{
$ObjSuperScope = $SuperScopes
}
else
{
if($SuperScopes.Get($itmSupScp) -ne $null)
{
$ObjSuperScope = $SuperScopes.Get($itmSupScp)
}
}
if($ObjSuperScope.Name.Length -gt 0)
{
$PercSupScopeInUse = $ObjSuperScope.PercentageInUse
$PercSupScopeAvail = 100-$PercSupScopeInUse
[system.double] $DbldSupScopeInUse = [System.Convert]::ToDouble($ObjSuperScope.InUse)
[system.double] $DbldSupScopeInFree = [System.Convert]::ToDouble($ObjSuperScope.Available)
[System.String] $CounterAddInUse = "AddressesInUse"
[System.String] $CounterAddFree = "AddressesAvailable"
[System.String] $CounterPrcInUse = "PercentageInUse"
[System.String] $CounterPrcFree = "PercentageAvailable"
$PerformancePropertyBag = $momAPI.CreatePropertyBag()
$PerformancePropertyBag.AddValue("PerfCounter", $CounterAddInUse)
$PerformancePropertyBag.AddValue("PerfInstance", $ObjSuperScope.Name)
$PerformancePropertyBag.AddValue("PerfValue", $DbldSupScopeInUse)
$PerformancePropertyBag
$PerformancePropertyBag = $momAPI.CreatePropertyBag()
$PerformancePropertyBag.AddValue("PerfCounter", $CounterAddFree)
$PerformancePropertyBag.AddValue("PerfInstance", $ObjSuperScope.Name)
$PerformancePropertyBag.AddValue("PerfValue", $DbldSupScopeInFree)
$PerformancePropertyBag
$PerformancePropertyBag = $momAPI.CreatePropertyBag()
$PerformancePropertyBag.AddValue("PerfCounter", $CounterPrcInUse)
$PerformancePropertyBag.AddValue("PerfInstance", $ObjSuperScope.Name)
$PerformancePropertyBag.AddValue("PerfValue", $PercSupScopeInUse)
$PerformancePropertyBag
$PerformancePropertyBag = $momAPI.CreatePropertyBag()
$PerformancePropertyBag.AddValue("PerfCounter", $CounterPrcFree)
$PerformancePropertyBag.AddValue("PerfInstance", $ObjSuperScope.Name)
$PerformancePropertyBag.AddValue("PerfValue", $PercSupScopeAvail)
$PerformancePropertyBag
Write-Host "$SCRIPT_NAME - Super Scope Performance Data Added"
}
}
}
catch [System.Exception]
{
$Description = $_.ToString()
Write-Warning "$SCRIPT_NAME - $Description"
$PerformancePropertyBag = $momAPI.CreatePropertyBag()
$PerformancePropertyBag.AddValue("AddressesInUse", 0)
$PerformancePropertyBag.AddValue("AddressesAvailable", 0)
$PerformancePropertyBag.AddValue("PercentageInUse", 0)
$PerformancePropertyBag.AddValue("PercentageAvailable", 0)
$PerformancePropertyBag
}
finally
{
Write-Host "$SCRIPT_NAME - multiple performance property bag returned"
}
</ScriptBody>
<Parameters>
<Parameter>
<Name>PrincipalName</Name>
<Value>$Config/ComputerName$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
</ProbeAction>
<ConditionDetection ID="PerfMapper" TypeID="Performance!System.Performance.DataGenericMapper">
<ObjectName>Scopes</ObjectName>
<CounterName>$Data/Property[@Name='PerfCounter']$</CounterName>
<InstanceName>$Data/Property[@Name='PerfInstance']$</InstanceName>
<Value>$Data/Property[@Name='PerfValue']$</Value>
</ConditionDetection>
<ConditionDetection ID="InstanceFilter" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='PerfCounter']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/CounterName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="String">Property[@Name='PerfInstance']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value Type="String">$Config/SuperScope$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
</MemberModules>
<Composition>
<Node ID="PerfMapper">
<Node ID="InstanceFilter">
<Node ID="PS">
<Node ID="DS"/>
</Node>
</Node>
</Node>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>Performance!System.Performance.Data</OutputType>
</DataSourceModuleType>