Tipo di monitoraggio stato connessione scheda di rete

Microsoft.Windows.Server.10.0.NetworkAdapter.Monitortype (UnitMonitorType)

Element properties:

RunAsDefault
AccessibilityInternal
Support Monitor RecalculateTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Windows.EventProvider Default
PassThrough ProbeAction System.PassThroughProbe Default
ProbeActionGoodDS ProbeAction Microsoft.Windows.PowerShellPropertyBagProbe Default
FilterNotOK ConditionDetection System.ExpressionFilter Default
FilterOK ConditionDetection System.ExpressionFilter Default

Overrideable Parameters:

IDParameterTypeSelectorDisplay NameDescription
MonitorHardwareMalfunctionbool$Config/MonitorHardwareMalfunction$Esegue il monitoraggio del malfunzionamento hardware della scheda di rete
MonitorDisconnectionbool$Config/MonitorDisconnection$Tipo di monitoraggio stato connessione scheda di reteQuesto tipo di monitoraggio viene utilizzato come base per il monitoraggio che consente di rilevare lo stato di connessione delle schede di rete.
MonitorMediaDisconnectionbool$Config/MonitorMediaDisconnection$Esegue il monitoraggio della disconnessione dei supporti della scheda di rete
TimeoutSecondsint$Config/TimeoutSeconds$Timeout (secondi)

Source Code:

<UnitMonitorType ID="Microsoft.Windows.Server.10.0.NetworkAdapter.Monitortype" Accessibility="Internal">
<MonitorTypeStates>
<MonitorTypeState ID="Good"/>
<MonitorTypeState ID="Bad"/>
</MonitorTypeStates>
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ComputerName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DeviceName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TimeoutSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MonitorMediaDisconnection" type="xsd:boolean"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MonitorDisconnection" type="xsd:boolean"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MonitorHardwareMalfunction" type="xsd:boolean"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="TimeoutSeconds" ParameterType="int" Selector="$Config/TimeoutSeconds$"/>
<OverrideableParameter ID="MonitorMediaDisconnection" ParameterType="bool" Selector="$Config/MonitorMediaDisconnection$"/>
<OverrideableParameter ID="MonitorDisconnection" ParameterType="bool" Selector="$Config/MonitorDisconnection$"/>
<OverrideableParameter ID="MonitorHardwareMalfunction" ParameterType="bool" Selector="$Config/MonitorHardwareMalfunction$"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.EventProvider">
<ComputerName>$Config/ComputerName$</ComputerName>
<LogName>System</LogName>
<Expression>
<Or>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventSourceName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>Tcpip</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<Or>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>4201</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>4202</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</Or>
</Expression>
</And>
</Expression>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventSourceName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>Microsoft-Windows-Iphlpsvc</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<Or>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>4200</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>4201</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</Or>
</Expression>
</And>
</Expression>
</Or>
</Expression>
</DataSource>
<ProbeAction ID="PassThrough" TypeID="System!System.PassThroughProbe"/>
<ProbeAction ID="ProbeActionGoodDS" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagProbe">
<ScriptName>NetworkAdapterCheck.ps1</ScriptName>
<ScriptBody><Script>

param ($TargetComputer, $MediaDisconnectionFlag, $DisconnectionFlag, $HardwareFlag)

$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
if ($null -eq $momAPI)
{
exit -1
}

Function Load-CimModules
{
$ErrorActionPreference = 'SilentlyContinue'
$error.Clear()

$CimModule = Get-Module CimCmdlets

if ($null -eq $CimModule)
{
Import-Module CimCmdlets

}
}

Load-CimModules
# WMI Constant
$wbemCimtypeUseDefault = 0 #Use Default Type CIM type - Custom
$wbemCimtypeSint16 = 2 #Signed 16-bit integer
$wbemCimtypeSint32 = 3 #Signed 32-bit integer
$wbemCimtypeReal32 = 4 #32-bit real number
$wbemCimtypeReal64 = 5 #64-bit real number
$wbemCimtypeString = 8 #String
$wbemCimtypeBoolean = 11 #Boolean value
$wbemCimtypeObject = 13 #CIM object
$wbemCimtypeSint8 = 16 #Signed 8-bit integer
$wbemCimtypeUint8 = 17 #Unsigned 8-bit integer
$wbemCimtypeUint16 = 18 #Unsigned 16-bit integer
$wbemCimtypeUint32 = 19 #Unsigned 32-bit integer
$wbemCimtypeSint64 = 20 #Signed 64-bit integer
$wbemCimtypeUint64 = 21 #Unsigned 64-bit integer
$wbemCimtypeDatetime = 101 #Date/time value
$wbemCimtypeReference = 102 #Reference to a CIM object
$wbemCimtypeChar16 = 103 #16-bit character

$ErrAction_None = 0
$ErrAction_Trace = 1
$ErrAction_ThrowError = 16
$ErrAction_Abort = 32
$ErrAction_ThrowErrorAndAbort = 48

$DISKSIZE_BYTES_IN_MB = 1048576

$g_ErrorEventNumber = 4001
$g_TraceEventNumber = 4002
$g_DebugFlag = $false

#---------------------------------------------------------------------------
# Returns WMI Instance requested. Tries to execute WMI query a N times.
#---------------------------------------------------------------------------
Function WMIGetInstanceExTryN
{
param ([string]$sTargetComputer,
[string]$sNamespace,
[string]$sInstanceQuery,
[int]$N)

for ($i = 0; $i -lt $N; $i++)
{
$error.Clear();
$oInstance = Get-CimInstance -ComputerName $sTargetComputer -Namespace $sNamespace -Query ("Select * from "+$sInstanceQuery) -ErrorAction SilentlyContinue
if ($error.Count -gt 0)
{
if ($i -eq ($N-1))
{
ThrowScriptError ("The class name '" + $sInstanceQuery + "' returned no instances. Please check to see if this is a valid WMI class name.") $error[0]
}
}
else
{
break;
}
sleep -m 1000
}

return $oInstance
}

#---------------------------------------------------------------------------
# Returns WMI Instance requested.
#---------------------------------------------------------------------------
Function WMIGetInstanceEx
{
param ([string]$sTargetComputer,
[string]$sNamespace,
[string]$sInstanceQuery)

$error.Clear();
$oInstance = Get-CimInstance -ComputerName $sTargetComputer -Namespace $sNamespace -Query ("Select * from "+$sInstanceQuery) -ErrorAction SilentlyContinue
if ($error.Count -gt 0)
{
ThrowScriptError ("The class name '" + $sInstanceQuery + "' returned no instances. Please check to see if this is a valid WMI class name.") $error[0]
}

return $oInstance
}

#---------------------------------------------------------------------------
# Connect to WMI.
#---------------------------------------------------------------------------
Function WMIConnect
{
param ([string]$sTargetComputer,
[string]$sNamespace)

$error.Clear()

# !!! Refactoring comment:
# Original VBScript only tries to connect to the namespace. Piping to get only the first one saves time.
$oWMI = Get-CimClass -ComputerName $sTargetComputer -Namespace $sNamespace -ErrorAction SilentlyContinue | select -First 1
if ($error.Count -gt 0)
{
$msg = "Unable to open WMI Namespace 'winmgmts:\\" + $sTargetComputer + "\" + $sNamespace + "'. Check to see if the WMI service is enabled and running, and ensure this WMI namespace exists."
ThrowScriptError $msg $error[0]
}
}

#---------------------------------------------------------------------------
# Returns WMI Instance requested.
#---------------------------------------------------------------------------
Function WMIGetInstance
{
param ([string]$sTargetComputer,
[string]$sNamespace,
[string]$sInstanceQuery)

WMIConnect $sTargetComputer $sNamespace
$oInstance = WMIGetInstanceEx $sTargetComputer $sNamespace $sInstanceQuery
return $oInstance
}

#---------------------------------------------------------------------------
# Returns WMI Instance requested.
#---------------------------------------------------------------------------
Function WMIGetInstanceNoAbort
{
param ([string]$sTargetComputer,
[string]$sNamespace,
[string]$sInstanceQuery)

$oInstance = Get-CimInstance -ComputerName $sTargetComputer -Namespace $sNamespace -Query ("Select * from "+$sInstanceQuery) -ErrorAction SilentlyContinue

return $oInstance
}

#---------------------------------------------------------------------------
# Executes the WMI query and returns the result set.
#---------------------------------------------------------------------------
Function WMIExecQuery
{
param ([string]$sTargetComputer,
[string]$sNamespace,
[string]$sQuery)

$error.Clear()

# !!! Refactoring comment:
# Original VBScript only tries to connect to the namespace. Piping to get only the first one saves time.
$oWMI = Get-CimClass -ComputerName $sTargetComputer -Namespace $sNamespace -ErrorAction SilentlyContinue | select -First 1
if ($error.Count -gt 0)
{
$msg = "Unable to open WMI Namespace 'winmgmts:\\" + $sTargetComputer + "\" + $sNamespace + "'. Check to see if the WMI service is enabled and running, and ensure this WMI namespace exists."
ThrowScriptError $msg, $error[0]
}

$oQuery = Get-CimInstance -ComputerName $sTargetComputer -Namespace $sNamespace -Query $sQuery -ErrorAction SilentlyContinue
if ($error.Count -gt 0)
{
ThrowScriptError ("The Query '" + $sQuery + "' returned an invalid result set. Please check to see if this is a valid WMI Query.") $error[0]
}

return $oQuery
}

#---------------------------------------------------------------------------
# Executes the WMI query and returns the result set, no abort version.
#---------------------------------------------------------------------------
Function WMIExecQueryNoAbort
{
param ([string]$sTargetComputer,
[string]$sNamespace,
[string]$sQuery)

$oQuery = Get-CimInstance -ComputerName $sTargetComputer -Namespace $sNamespace -Query $sQuery -ErrorAction SilentlyContinue

return $oQuery
}

#---------------------------------------------------------------------------
# Creates an event and sends it back to the mom server.
#---------------------------------------------------------------------------
Function ThrowScriptErrorNoAbort
{
param ([string]$sMessage,
[System.Management.Automation.ErrorRecord]$oErr)
# Retrieve the name of this (running) script
$ScriptFileName = $MyInvocation.ScriptName

if ($oErr -ne $null)
{
$sMessage = $sMessage + ". " + $oErr.ErrorDetails
}

$momAPI.LogScriptEvent($ScriptFileName, $g_ErrorEventNumber, $EVENT_TYPE_ERROR, $sMessage)

Write-Host $sMessage
}

#---------------------------------------------------------------------------
# Creates an event and sends it back to the mom server.
#---------------------------------------------------------------------------
Function ThrowScriptError
{
param ([string]$sMessage,
[System.Management.Automation.ErrorRecord]$oErr)
ThrowScriptErrorNoAbort $sMessage $oErr
exit
}

#---------------------------------------------------------------------------
# Verifies that number of arguments is correct
#---------------------------------------------------------------------------
Function VerifyNumberOfArguments
{
param ($NumberOfArguments)

if ($args.Length -ne $NumberOfArguments)
{
$sArgs = ""
foreach ($argument in $args)
{
$sArgs += " {" + $argument + "}"
}
ThrowScriptError ("Invalid number of arguments (" + $args.Length + " instead of " + $NumberOfArguments + "). Arguments:" + $sArgs) $null
}
}

#---------------------------------------------------------------------------
# Outputs to file and echo for debugging purposes
#---------------------------------------------------------------------------
Function TraceLogMessage
{
param ([string]$sMessage)

Write-Host $sMessage

If ($g_DebugFlag -eq $true)
{
# Retrieve the name of this (running) script
$ScriptFileName = $MyInvocation.ScriptName

$momAPI.LogScriptEvent($ScriptFileName, $g_TraceEventNumber, $EVENT_TYPE_INFORMATION, $sMessage)
}
}

#---------------------------------------------------------------------------
# Verifies the expression. If equals to False then generates an error and quits the script
# Usage:
# Verify Not WMISet Is Nothing, "WMISet is invalid!"
# Verify WMISet.Count = 1, "Invalid quantity of services with name 'Server' (qty = " &amp; WMISet.Count &amp; ")."
#---------------------------------------------------------------------------
Function Verify
{
param ([bool]$bBool,
[string]$sMessage)

If ($bBool -eq $false)
{
ThrowScriptError $sMessage $null
}
}

Function GetRegistryKeyValue
{
param ([string]$keyPath,
[string]$key)

$error.Clear()

$strKeyValue = Get-ItemProperty -Path $keyPath -Name $key -ErrorAction SilentlyContinue
if ($error.Count -gt 0)
{
ThrowScriptError ("An error occurred while reading the registry: '" + $keyPath + $key + "'") $error[0]
}
return $strKeyValue.$key
}


#---------------------------------------------------------------------------
# Function: ExpressedInMB
# Usage:
# Parameter (SizeInBytes)
# Returns the Size Expressed in MBytes
#---------------------------------------------------------------------------
Function ExpressedInMB
{
param ($SizeInBytes)

$NumberSizeExpInMB = [math]::Round($SizeInBytes / $DISKSIZE_BYTES_IN_MB, 0)
return $NumberSizeExpInMB
}

Function Is_Win32_Volume_Supported($TargetComputer)
{
$blnRet = $false
$ErrorActionPreference="SilentlyContinue"
$error.Clear()
$IsNano = Is_NanoServer

if ($true -eq $IsNano)
{
return $blnRet #NanoServer does not support Win32_Volume
}

$objWMISet = WMIGetInstance $TargetComputer "root\cimv2" "Win32_OperatingSystem"
foreach ($objWMIOS in $objWMISet)
{
if ([int]$objWMIOS.BuildNumber -ge 3624)
{
$blnRet = $true
}
}

return $blnRet
}

Function Get_System_Drive($TargetComputer)
{
$objWMISet = WMIGetInstance $TargetComputer "root\cimv2" "Win32_OperatingSystem"
foreach ($objWMIOS in $objWMISet)
{
return $objWMIOS.SystemDirectory.SubString(0,2)
}
}

Function Is_NanoServer
{
$ErrorActionPreference="SilentlyContinue"
$error.Clear()
$IsNano = (Get-Item "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Server\ServerLevels").GetValue("NanoServer")

$IsNano = $IsNano -eq 1

$error.Clear()

return $IsNano

}

#---------------------------------------------------------------------------
# Function: StripEndChar
# Usage:
# Parameter (sName)
# Returns the sName without last special Character "\"
#---------------------------------------------------------------------------
Function StripEndChar([string]$sName)
{
if ([string]::IsNullOrEmpty($sName))
{
return [string]::Empty
}
else
{
return $sName.Substring(0, $sName.Length-1)
}
}

Function Load-Module ([string] $ModuleName)
{
if ([string]::IsNullOrEmpty($ModuleName) )
{
return $false
}

$ErrorActionPreference="SilentlyContinue"
$error.Clear()

$retval = $false
$cim = Get-Module -Name $ModuleName

########Check for powershell 1.0
if ($error.Count -ne 0)
{
$type = $error[0].Exception.GetType()
if ([System.Management.Automation.CommandNotFoundException] -eq $type)
{
$error.Clear()
return $retval
}

$error.Clear()
}

if ($null -eq $cim)
{
Import-Module $ModuleName
if ($error.Count -eq 0)
{
$retval = $true
}

$error.Clear()
}
else
{
$retval = $true
}

return $retval


}

Function Get-Volumes([bool]$IsNano,[bool]$IsVolumeSupported,[string] $TargetComputer)
{
$ErrorActionPreference="SilentlyContinue"
$error.Clear()

$oVolumes = $null

if ($true -eq $IsNano)
{
$bLoadModule = Load-Module -ModuleName "Storage"
if($false -eq $bLoadModule)
{
return $null
}

$oVolumes = Get-Volume | where {$_.DriveType -eq "Fixed" -and $false -eq [string]::IsNullOrEmpty($_.FileSystem )}
}
else
{
if ($true -eq $IsVolumeSupported)
{
$oVolumes = WMIGetInstanceNoAbort $TargetComputer "root\cimv2" "Win32_Volume where (DriveType=3) and FileSystem!=null"
}
else
{
$oVolumes = WMIGetInstanceNoAbort $TargetComputer "root\cimv2" "Win32_LogicalDisk where (DriveType=3) and FileSystem!=null"
}
}

return $oVolumes
}

Function Get-VolumeId([bool]$IsNano,[bool]$IsVolumeSupported,$Volume)
{
$ErrorActionPreference="SilentlyContinue"
$error.Clear()

if ($null -eq $Volume)
{
return $null
}

if ($true -eq $IsVolumeSupported)
{
$VolumeId = $Volume.DriveLetter
if([string]::IsNullOrEmpty($VolumeId) )
{
$VolumeId = StripEndChar -sName $Volume.Name
}
}
else
{
if ($true -eq $IsNano )
{
$VolumeId = $Volume.DriveLetter
if([string]::IsNullOrEmpty($VolumeId) )
{
$VolumeId = StripEndChar -sName $Volume.UniqueId
}
else
{
if (1 -eq $VolumeId.Length)
{
$VolumeId = $VolumeId + ":"
}
}
}
else
{
$VolumeId = $Volume.DeviceId
}

}

return $VolumeId
}

Function CreatePerformanceCounterData($strObjectName, $strCounterName, $strInstanceName, $varValue)
{

return @{ "PerfObject" = $strObjectName;
"PerfCounter" = $strCounterName;
"PerfInstance" = $strInstanceName;
"PerfValue" = $varValue;
}
}

Function Create-PerformancePropertyBag ($strObjectName, $strCounterName, $strInstanceName, $varValue,$objMomScriptAPI)
{
$ErrorActionPreference = "SilentlyContinue"
$error.Clear()

if ([string]::IsNullOrEmpty($varValue))
{
$varValue = 0
}

if ($null -eq $objMomScriptAPI)
{
return
}

$objTypedPropertyBag = $objMomScriptAPI.CreateTypedPropertyBag($PROPERTY_TYPE_PERFORMANCE)

$objTypedPropertyBag.AddValue("PerfObject" ,$strObjectName)
$objTypedPropertyBag.AddValue("PerfCounter" ,$strCounterName)
$objTypedPropertyBag.AddValue("PerfInstance" ,$strInstanceName)
$objTypedPropertyBag.AddValue("PerfValue" ,$varValue)
$objTypedPropertyBag


}

Function Create-EmptyPerfData ($objMomScriptAPI)
{
if ($null -eq $objMomScriptAPI)
{
return

}

$ErrorActionPreference = 'SilentlyContinue' # Scoped only to function
$error.Clear()
$objTypedPropertyBag = $objMomScriptAPI.CreateTypedPropertyBag($PROPERTY_TYPE_PERFORMANCE)

$objTypedPropertyBag.AddValue("PerfObject" ,"EMPTY")
$objTypedPropertyBag.AddValue("PerfCounter" ,"EMPTY")
$objTypedPropertyBag.AddValue("PerfInstance" ,"EMPTY")
$objTypedPropertyBag.AddValue("PerfValue" ,"EMPTY")

#Add the property bag to the script#s XML output
$objTypedPropertyBag

$error.Clear()
}

Function Convert-ToBoolean([string] $sBool)
{
[bool] $result = $false
[bool] $iresult = $false

if ($false -eq [string]::IsNullOrEmpty($sBool) )
{
$result = $sBool.Equals("true",[System.StringComparison]::InvariantCultureIgnoreCase)
$iresult = $sBool.Equals("1",[System.StringComparison]::InvariantCultureIgnoreCase)
$result = $result -or $iresult
}

return $result
}

Function Unload-Module([string]$ModuleName)
{
$ErrorActionPreference = 'SilentlyContinue' # Scoped only to function
$error.Clear()

if ([string]::IsNullOrEmpty($ModuleName))
{
return
}

$module = Get-Module $ModuleName
if ($null -eq $module)
{
return
}

Remove-Module -Name $ModuleName -Force
}

#Copyright (c) Microsoft Corporation. All rights reserved.

# Parameters that should be passed to this script
# 0 Computer (FQDN)
# 1 Media Disconnection Flag
# 2 Disconnection Flag
# 3 Hardware Flag

Function Main()
{
$MediaDisconnectionFlag = Convert-ToBoolean -sBool $MediaDisconnectionFlag
$DisconnectionFlag = Convert-ToBoolean -sBool $DisconnectionFlag
$HardwareFlag = Convert-ToBoolean -sBool $HardwareFlag
$ErrorActionPreference="SilentlyContinue"
$error.Clear()
# Win32_NetworkAdapter is deprecated and not returning results on NanoServer
# Need to use MSFT_NetAdapter
$IsModuleLoaded = Load-Module -ModuleName "NetAdapter"
if ($false -eq $IsModuleLoaded)
{
return
}

$error.Clear()

$netAdapters = Get-NetAdapter
foreach ($netAdapter in $netAdapters)
{
$oBag = $momAPI.CreatePropertyBag()

$oBag.AddValue("DeviceName", $netAdapter.DeviceID)
If ( (($MediaDisconnectionFlag -eq $true) -and ($netAdapter.MediaConnectState -eq 2)) -or
(($DisconnectionFlag -eq $true) -and ($netAdapter.MediaConnectState -eq 2)) -or
(($HardwareFlag -eq $true) -and ($netAdapter.MediaConnectState -eq 2)))
{
$oBag.AddValue("State", "BAD")
}
else
{
$oBag.AddValue("State", "GOOD")
}

$oBag
}

Unload-Module -ModuleName "NetAdapter"
}

Main

</Script></ScriptBody>
<Parameters>
<Parameter>
<Name>TargetComputer</Name>
<Value>$Config/ComputerName$</Value>
</Parameter>
<Parameter>
<Name>MediaDisconnectionFlag</Name>
<Value>$Config/MonitorMediaDisconnection$</Value>
</Parameter>
<Parameter>
<Name>DisconnectionFlag</Name>
<Value>$Config/MonitorDisconnection$</Value>
</Parameter>
<Parameter>
<Name>HardwareFlag</Name>
<Value>$Config/MonitorHardwareMalfunction$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
</ProbeAction>
<ConditionDetection ID="FilterOK" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='DeviceName']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$Config/DeviceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery>Property[@Name='State']</XPathQuery>
</ValueExpression>
<Operator>ContainsSubstring</Operator>
<Pattern>GOOD</Pattern>
</RegExExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
<ConditionDetection ID="FilterNotOK" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>Property[@Name='DeviceName']</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$Config/DeviceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<RegExExpression>
<ValueExpression>
<XPathQuery>Property[@Name='State']</XPathQuery>
</ValueExpression>
<Operator>ContainsSubstring</Operator>
<Pattern>BAD</Pattern>
</RegExExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="Good">
<Node ID="FilterOK">
<Node ID="ProbeActionGoodDS">
<Node ID="DS"/>
</Node>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="Bad">
<Node ID="FilterNotOK">
<Node ID="ProbeActionGoodDS">
<Node ID="DS"/>
</Node>
</Node>
</RegularDetection>
</RegularDetections>
<OnDemandDetections>
<OnDemandDetection MonitorTypeStateID="Good">
<Node ID="FilterOK">
<Node ID="ProbeActionGoodDS">
<Node ID="PassThrough"/>
</Node>
</Node>
</OnDemandDetection>
<OnDemandDetection MonitorTypeStateID="Bad">
<Node ID="FilterNotOK">
<Node ID="ProbeActionGoodDS">
<Node ID="PassThrough"/>
</Node>
</Node>
</OnDemandDetection>
</OnDemandDetections>
</MonitorImplementation>
</UnitMonitorType>