Этот модуль получает статистические данные, собранные для IPV4 суперобласти членами группы DHCP-серверов 2016 версии 1709 и более поздних версий с именем "Группа DHCP-серверов 2016 версии 1709 и более поздних версий" с экземплярами сервера, запущенными в операционной системе Microsoft Windows Server 2016 версии 1709 и более поздних версий с включенной функцией DHCP.
Интервал (в секундах): частота (в секундах) проверки значения.
Время синхронизации: Время синхронизации для выполнения модуля.
Время ожидания (в секундах): Время ожидания модулем (в секундах) завершения выполнения.
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.10.0.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>DHCPSuperScopes.10.0.Probe.ps1</ScriptName>
<ScriptBody>
param ([String] $PrincipalName)
$SCRIPT_NAME = "DHCPSuperScopes.10.0.Probe"
$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 2016 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>