PowerShell Script Three State Monitor (Community)
Community.PowerShellMonitoring.UnitMonitors.PowerShellThreeState (UnitMonitorType)
A three state monitor powered by a PowerShell script. Remember when setting the alert settings to raise an alert on critical or warning state, and to set the severity to "match monitor severity".
Element properties: Member Modules:
Overrideable Parameters:
Source Code: <UnitMonitorType ID="Community.PowerShellMonitoring.UnitMonitors.PowerShellThreeState" Accessibility="Public">
<MonitorTypeStates>
<MonitorTypeState ID="Healthy"/>
<MonitorTypeState ID="Warning"/>
<MonitorTypeState ID="Unhealthy"/>
</MonitorTypeStates>
<Configuration>
<IncludeSchemaTypes>
<SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
</IncludeSchemaTypes>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IntervalSeconds" type="xsd:int" minOccurs="1" maxOccurs="1"/>
<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="ScriptName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ScriptBody" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="0" name="Arguments" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="TimeoutSeconds" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="UnhealthyExpression" type="ExpressionType"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="WarningExpression" type="ExpressionType"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="HealthyExpression" type="ExpressionType"/>
</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"/>
<OverrideableParameter ID="Arguments" Selector="$Config/Arguments$" ParameterType="string"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource ID="Timer" TypeID="System!System.SimpleScheduler">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<SyncTime>$Config/SyncTime$</SyncTime>
</DataSource>
<ProbeAction ID="Probe" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe">
<ScriptName>$Config/ScriptName$</ScriptName>
<ScriptBody><Script> $Config/ScriptBody$</Script> </ScriptBody>
<Parameters>
<Parameter>
<Name>Arguments</Name>
<Value>$Config/Arguments$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>$Config/TimeoutSeconds$</TimeoutSeconds>
</ProbeAction>
<ConditionDetection ID="HealthyFilter" TypeID="System!System.ExpressionFilter">
<Expression>$Config/HealthyExpression$</Expression>
</ConditionDetection>
<ConditionDetection ID="UnhealthyFilter" TypeID="System!System.ExpressionFilter">
<Expression>$Config/UnhealthyExpression$</Expression>
</ConditionDetection>
<ConditionDetection ID="WarningFilter" TypeID="System!System.ExpressionFilter">
<Expression>$Config/WarningExpression$</Expression>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="Healthy">
<Node ID="HealthyFilter">
<Node ID="Probe">
<Node ID="Timer"/>
</Node>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="Warning">
<Node ID="WarningFilter">
<Node ID="Probe">
<Node ID="Timer"/>
</Node>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="Unhealthy">
<Node ID="UnhealthyFilter">
<Node ID="Probe">
<Node ID="Timer"/>
</Node>
</Node>
</RegularDetection>
</RegularDetections>
</MonitorImplementation>
</UnitMonitorType>