Monitor DB Query Result Three State (powered by Martello)

SavisionCommunityMonitorQueryResultThreeStateTemplate (Template)

Source Code:

<Template ID="SavisionCommunityMonitorQueryResultThreeStateTemplate">
<Configuration>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Name" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Description" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="TemplateIdString" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="UniqueId" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Instance" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Database" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="QueryName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StartDay" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="EndDay" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SyncTime" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IntervalSeconds" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Query" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="DaysOfWeekMask" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="GroupName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Direction" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ErrorMessage" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="MetricType" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Samples" type="xsd:int"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Threshold" type="xsd:double"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="ConnectionString" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="IsMicrosoftSql" type="xsd:boolean"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="PrincipalName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="RunAsAccount" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WarningThreshold" type="xsd:double"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WarningDirection" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="WarningOppositeDirection" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CriticalThreshold" type="xsd:double"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CriticalDirection" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="CriticalOppositeDirection" type="xsd:string"/>
</Configuration>
<References>
<Reference ID="Self"/>
<Reference ID="System"/>
<Reference ID="SC"/>
<Reference ID="SCDW"/>
<Reference ID="Health"/>
<Reference ID="Windows"/>
<Reference ID="Library"/>
</References>
<Implementation>
<TypeDefinitions>
<EntityTypes>
<ClassTypes>
<ClassType ID="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$" Accessibility="Internal" Abstract="false" Base="$Reference/Library$SavisionCommunityMonitorQueryResult" Hosted="true" Singleton="false">
<Property Type="bool" ID="IsMicrosoftSql" Key="false"/>
</ClassType>
</ClassTypes>
</EntityTypes>
<SecureReferences>
<SecureReference ID="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$.SimpleAuthenticationAccount" Accessibility="Public" Context="$Reference/System$System.Entity"/>
</SecureReferences>
<MonitorTypes>
<UnitMonitorType Accessibility="Public" ID="SavisionCommunityMonitorQueryResult.ThreeStateConsecutive.UnitMonitorType">
<MonitorTypeStates>
<MonitorTypeState ID="OK"/>
<MonitorTypeState ID="WARNING"/>
<MonitorTypeState ID="ERROR"/>
</MonitorTypeStates>
<Configuration>
<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="0" name="SyncTime" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ConnectionString" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="Query" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="StartDay" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="EndDay" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="DaysOfWeekMask" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="QueryName" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="Threshold" type="xsd:double"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="Direction" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="NumSamples" type="xsd:integer"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="MetricType" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="ErrorMessage" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="WarningThreshold" type="xsd:double"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="WarningDirection" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="WarningOppositeDirection" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="CriticalThreshold" type="xsd:double"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="CriticalDirection" type="xsd:string"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" minOccurs="1" name="CriticalOppositeDirection" type="xsd:string"/>
</Configuration>
<OverrideableParameters>
<OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int"/>
<OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string"/>
</OverrideableParameters>
<MonitorImplementation>
<MemberModules>
<DataSource ID="Scheduler" TypeID="System!System.SimpleScheduler">
<IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
<SyncTime>$Config/SyncTime$</SyncTime>
</DataSource>
<ProbeAction TypeID="Library!SavisionCommunityMonitorQueryResultPerformanceCollectionProbe" ID="DS">
<ConnectionString>$Config/ConnectionString$</ConnectionString>
<Query>$Config/Query$</Query>
<QueryName>$Config/QueryName$</QueryName>
</ProbeAction>
<ProbeAction TypeID="Library!SavisionCommunityMonitorQueryResultPerformanceCollectionProbe" ID="ProbeOnDemand">
<ConnectionString>$Config/ConnectionString$</ConnectionString>
<Query>$Config/Query$</Query>
<QueryName>$Config/QueryName$</QueryName>
</ProbeAction>
<ConditionDetection ID="TimeFilter" TypeID="System!System.SchedulerFilter">
<SchedulerFilter>
<ProcessDataMode>OnSchedule</ProcessDataMode>
<Schedule>
<WeeklySchedule>
<Windows>
<Daily>
<Start>$Config/StartDay$</Start>
<End>$Config/EndDay$</End>
<DaysOfWeekMask>$Config/DaysOfWeekMask$</DaysOfWeekMask>
</Daily>
</Windows>
</WeeklySchedule>
<ExcludeDates/>
</Schedule>
<UseCurrentTime>true</UseCurrentTime>
</SchedulerFilter>
</ConditionDetection>
<ConditionDetection TypeID="Perf!System.Performance.ConsecutiveSamplesCondition" ID="Consecutive">
<Threshold>$Config/Threshold$</Threshold>
<Direction>$Config/Direction$</Direction>
</ConditionDetection>
<ConditionDetection ID="ErrorFilter" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Value</XPathQuery>
</ValueExpression>
<Operator>GreaterEqual</Operator>
<ValueExpression>
<Value Type="Integer">$Config/NumSamples$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Double">SampleValue</XPathQuery>
</ValueExpression>
<Operator>$TemplateConfig/CriticalDirection$</Operator>
<ValueExpression>
<Value Type="Double">$Config/CriticalThreshold$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
<ConditionDetection ID="WarningFilter" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Integer">Value</XPathQuery>
</ValueExpression>
<Operator>GreaterEqual</Operator>
<ValueExpression>
<Value Type="Integer">$Config/NumSamples$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Double">SampleValue</XPathQuery>
</ValueExpression>
<Operator>$TemplateConfig/WarningDirection$</Operator>
<ValueExpression>
<Value Type="Double">$Config/WarningThreshold$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Double">SampleValue</XPathQuery>
</ValueExpression>
<Operator>$TemplateConfig/CriticalOppositeDirection$</Operator>
<ValueExpression>
<Value Type="Double">$Config/CriticalThreshold$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
<ConditionDetection ID="SuccessFilter" TypeID="System!System.ExpressionFilter">
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Double">SampleValue</XPathQuery>
</ValueExpression>
<Operator>$TemplateConfig/WarningOppositeDirection$</Operator>
<ValueExpression>
<Value Type="Double">$Config/WarningThreshold$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery Type="Double">SampleValue</XPathQuery>
</ValueExpression>
<Operator>$TemplateConfig/CriticalOppositeDirection$</Operator>
<ValueExpression>
<Value Type="Double">$Config/CriticalThreshold$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</ConditionDetection>
</MemberModules>
<RegularDetections>
<RegularDetection MonitorTypeStateID="OK">
<Node ID="SuccessFilter">
<Node ID="Consecutive">
<Node ID="DS">
<Node ID="Scheduler"/>
</Node>
</Node>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="WARNING">
<Node ID="WarningFilter">
<Node ID="Consecutive">
<Node ID="DS">
<Node ID="TimeFilter">
<Node ID="Scheduler"/>
</Node>
</Node>
</Node>
</Node>
</RegularDetection>
<RegularDetection MonitorTypeStateID="ERROR">
<Node ID="ErrorFilter">
<Node ID="Consecutive">
<Node ID="DS">
<Node ID="TimeFilter">
<Node ID="Scheduler"/>
</Node>
</Node>
</Node>
</Node>
</RegularDetection>
</RegularDetections>
<OnDemandDetections>
<OnDemandDetection MonitorTypeStateID="OK">
<Node ID="SuccessFilter">
<Node ID="Consecutive">
<Node ID="ProbeOnDemand"/>
</Node>
</Node>
</OnDemandDetection>
<OnDemandDetection MonitorTypeStateID="WARNING">
<Node ID="WarningFilter">
<Node ID="Consecutive">
<Node ID="ProbeOnDemand"/>
</Node>
</Node>
</OnDemandDetection>
<OnDemandDetection MonitorTypeStateID="ERROR">
<Node ID="ErrorFilter">
<Node ID="Consecutive">
<Node ID="ProbeOnDemand"/>
</Node>
</Node>
</OnDemandDetection>
</OnDemandDetections>
</MonitorImplementation>
</UnitMonitorType>
</MonitorTypes>
</TypeDefinitions>
<Monitoring>
<Discoveries>
<Discovery ID="SavisionCommunityMonitorQueryResultInitialDiscovery.$TemplateConfig/TemplateIdString$" Enabled="onEssentialMonitoring" Target="$Reference/SC$Microsoft.SystemCenter.AllManagementServersPool" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="$Reference/Library$SavisionCommunityMonitorQueryResult"/>
<DiscoveryClass TypeID="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$"/>
<DiscoveryRelationship TypeID="$Reference/Library$WindowsServerHostsSavisionCommunityMonitorQueryResult"/>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="$Reference/Self$SavisionCommunityMonitorQueryResultDiscoveryDataSource">
<IntervalSeconds>3600</IntervalSeconds>
<ClassId>$MPElement[Name="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$"]$</ClassId>
<ClassInstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResult"]/UniqueId$</Name>
<Value>$TemplateConfig/UniqueId$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResult"]/Instance$</Name>
<Value>$TemplateConfig/Instance$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResult"]/Database$</Name>
<Value>$TemplateConfig/Database$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResult"]/QueryName$</Name>
<Value>$TemplateConfig/QueryName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$"]/IsMicrosoftSql$</Name>
<Value>$TemplateConfig/IsMicrosoftSql$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Windows$Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$TemplateConfig/PrincipalName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/System$System.Entity"]/DisplayName$</Name>
<Value>$TemplateConfig/Name$</Value>
</Setting>
</Settings>
</ClassInstanceSettings>
<RelationshipId>$MPElement[Name="$Reference/Library$WindowsServerHostsSavisionCommunityMonitorQueryResult"]$</RelationshipId>
<SourceTypeId>$MPElement[Name="$Reference/Windows$Microsoft.Windows.Computer"]$</SourceTypeId>
<SourceRoleSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="$Reference/Windows$Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$TemplateConfig/PrincipalName$</Value>
</Setting>
</Settings>
</SourceRoleSettings>
<TargetTypeId>$MPElement[Name="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$"]$</TargetTypeId>
<TargetRoleSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResult"]/UniqueId$</Name>
<Value>$TemplateConfig/UniqueId$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Windows$Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$TemplateConfig/PrincipalName$</Value>
</Setting>
</Settings>
</TargetRoleSettings>
</DataSource>
</Discovery>
<Discovery ID="SavisionCommunityMonitorQueryResultGroupDiscovery.$TemplateConfig/TemplateIdString$" Enabled="onEssentialMonitoring" Target="$Reference/SC$Microsoft.SystemCenter.AllManagementServersPool" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="$Reference/Library$SavisionCommunityMonitorQueryResult"/>
<DiscoveryClass TypeID="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$"/>
<DiscoveryRelationship TypeID="$Reference/Library$SavisionCommunityMonitorQueryResultGroupContainSavisionCommunityMonitorQueryResult"/>
</DiscoveryTypes>
<DataSource ID="DS" TypeID="$Reference/Self$SavisionCommunityMonitorQueryResultDiscoveryDataSource">
<IntervalSeconds>3600</IntervalSeconds>
<ClassId>$MPElement[Name="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$"]$</ClassId>
<ClassInstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResult"]/UniqueId$</Name>
<Value>$TemplateConfig/UniqueId$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResult"]/Instance$</Name>
<Value>$TemplateConfig/Instance$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResult"]/Database$</Name>
<Value>$TemplateConfig/Database$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResult"]/QueryName$</Name>
<Value>$TemplateConfig/QueryName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$"]/IsMicrosoftSql$</Name>
<Value>$TemplateConfig/IsMicrosoftSql$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Windows$Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$TemplateConfig/PrincipalName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/System$System.Entity"]/DisplayName$</Name>
<Value>$TemplateConfig/Name$</Value>
</Setting>
</Settings>
</ClassInstanceSettings>
<RelationshipId>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResultGroupContainSavisionCommunityMonitorQueryResult"]$</RelationshipId>
<SourceTypeId>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResultGroup"]$</SourceTypeId>
<SourceRoleSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResultGroup"]/Name$</Name>
<Value>$TemplateConfig/GroupName$</Value>
</Setting>
</Settings>
</SourceRoleSettings>
<TargetTypeId>$MPElement[Name="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$"]$</TargetTypeId>
<TargetRoleSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="$Reference/Library$SavisionCommunityMonitorQueryResult"]/UniqueId$</Name>
<Value>$TemplateConfig/UniqueId$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="$Reference/Windows$Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$TemplateConfig/PrincipalName$</Value>
</Setting>
</Settings>
</TargetRoleSettings>
</DataSource>
</Discovery>
</Discoveries>
<Rules>
<Rule ID="SavisionCommunityMonitorQueryResult.QueryPerformanceCollection.$TemplateConfig/TemplateIdString$" Target="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$" Enabled="true" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="$Reference/Library$SavisionCommunityMonitorQueryResultPerformanceCollection" RunAs="$Reference/Library$SavisionCommunityMonitorQueryResult.PrivilegedMonitoringAccount">
<IntervalSeconds>$TemplateConfig/IntervalSeconds$</IntervalSeconds>
<SyncTime>$TemplateConfig/SyncTime$</SyncTime>
<ConnectionString>$TemplateConfig/ConnectionString$</ConnectionString>
<Query>$TemplateConfig/Query$</Query>
<QueryName>$TemplateConfig/QueryName$</QueryName>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WA" TypeID="$Reference/SC$Microsoft.SystemCenter.CollectPerformanceData"/>
<WriteAction ID="WADWH" TypeID="$Reference/SCDW$Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData"/>
</WriteActions>
</Rule>
</Rules>
<Monitors>
<UnitMonitor ID="SavisionCommunityMonitorQueryResult.ThreeStateUnitMonitor.$TemplateConfig/TemplateIdString$" Accessibility="Internal" Enabled="true" Target="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$" ParentMonitorID="$Reference/Health$System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="SavisionCommunityMonitorQueryResult.ThreeStateConsecutive.UnitMonitorType" ConfirmDelivery="false" RunAs="$Reference/Library$SavisionCommunityMonitorQueryResult.PrivilegedMonitoringAccount">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="SavisionCommunityMonitorQueryResult.ThreeStateUnitMonitor.AlertMessage.$TemplateConfig/TemplateIdString$">
<AlertOnState>Error</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$TemplateConfig/ErrorMessage$</AlertParameter1>
<AlertParameter2>$Data/Context/SampleValue$</AlertParameter2>
<AlertParameter3>$TemplateConfig/MetricType$</AlertParameter3>
<AlertParameter4>$TemplateConfig/Direction$</AlertParameter4>
<AlertParameter5>$TemplateConfig/Threshold$</AlertParameter5>
<AlertParameter6>$TemplateConfig/QueryName$</AlertParameter6>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="OK" MonitorTypeStateID="OK" HealthState="Success"/>
<OperationalState ID="WARNING" MonitorTypeStateID="WARNING" HealthState="Warning"/>
<OperationalState ID="ERROR" MonitorTypeStateID="ERROR" HealthState="Error"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>$TemplateConfig/IntervalSeconds$</IntervalSeconds>
<SyncTime>$TemplateConfig/SyncTime$</SyncTime>
<ConnectionString>$TemplateConfig/ConnectionString$</ConnectionString>
<Query>$TemplateConfig/Query$</Query>
<StartDay>$TemplateConfig/StartDay$</StartDay>
<EndDay>$TemplateConfig/EndDay$</EndDay>
<DaysOfWeekMask>$TemplateConfig/DaysOfWeekMask$</DaysOfWeekMask>
<QueryName>$TemplateConfig/QueryName$</QueryName>
<Threshold>$TemplateConfig/Threshold$</Threshold>
<Direction>$TemplateConfig/Direction$</Direction>
<NumSamples>$TemplateConfig/Samples$</NumSamples>
<MetricType>$TemplateConfig/MetricType$</MetricType>
<ErrorMessage>$TemplateConfig/ErrorMessage$</ErrorMessage>
<WarningThreshold>$TemplateConfig/WarningThreshold$</WarningThreshold>
<WarningDirection>$TemplateConfig/WarningDirection$</WarningDirection>
<WarningOppositeDirection>$TemplateConfig/WarningOppositeDirection$</WarningOppositeDirection>
<CriticalThreshold>$TemplateConfig/CriticalThreshold$</CriticalThreshold>
<CriticalDirection>$TemplateConfig/CriticalDirection$</CriticalDirection>
<CriticalOppositeDirection>$TemplateConfig/CriticalOppositeDirection$</CriticalOppositeDirection>
</Configuration>
</UnitMonitor>
<DependencyMonitor ID="SavisionCommunityMonitorQueryResult.SavisionCommunityMonitorQueryResultGroupDependencyMonitor" Accessibility="Internal" Enabled="true" Target="$Reference/Library$SavisionCommunityMonitorQueryResultGroup" ParentMonitorID="$Reference/Health$System.Health.EntityState" Remotable="true" Priority="Normal" RelationshipType="$Reference/Library$SavisionCommunityMonitorQueryResultGroupContainSavisionCommunityMonitorQueryResult" MemberMonitor="$Reference/Health$System.Health.EntityState">
<Category>AvailabilityHealth</Category>
<Algorithm>WorstOf</Algorithm>
</DependencyMonitor>
</Monitors>
<Overrides>
<SecureReferenceOverride ID="SavisionCommunityMonitorQueryResult.SimpleAuthenticationAccount.$TemplateConfig/TemplateIdString$.Override" Context="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$" Enforced="false" SecureReference="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$.SimpleAuthenticationAccount">
<Value>$TemplateConfig/RunAsAccount$</Value>
</SecureReferenceOverride>
</Overrides>
</Monitoring>
<Presentation>
<StringResources>
<StringResource ID="SavisionCommunityMonitorQueryResult.ThreeStateUnitMonitor.AlertMessage.$TemplateConfig/TemplateIdString$"/>
</StringResources>
</Presentation>
<LanguagePacks>
<LanguagePack ID="ENU" IsDefault="true">
<DisplayStrings>
<DisplayString ElementID="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$" SubElementID="IsMicrosoftSql">
<Name>Microsoft SQL query?</Name>
</DisplayString>
<DisplayString ElementID="SavisionCommunityMonitorQueryResult.ThreeStateUnitMonitor.$TemplateConfig/TemplateIdString$">
<Name>DB query result monitor (three states)</Name>
</DisplayString>
<DisplayString ElementID="SavisionCommunityMonitorQueryResult.ThreeStateUnitMonitor.AlertMessage.$TemplateConfig/TemplateIdString$">
<Name>Attention! The query $TemplateConfig/QueryName$ - returned a suspicious result</Name>
<Description>
Attention!
Description: {0}.
The return value {1} {2} is {3} then {4} {2}.
</Description>
</DisplayString>
<DisplayString ElementID="SavisionCommunityMonitorQueryResult.ThreeStateUnitMonitor.$TemplateConfig/TemplateIdString$" SubElementID="OK">
<Name>OK</Name>
<Description>OK</Description>
</DisplayString>
<DisplayString ElementID="SavisionCommunityMonitorQueryResult.ThreeStateUnitMonitor.$TemplateConfig/TemplateIdString$" SubElementID="ERROR">
<Name>ERROR</Name>
<Description>ERROR</Description>
</DisplayString>
<DisplayString ElementID="SavisionCommunityMonitorQueryResult.ThreeStateUnitMonitor.$TemplateConfig/TemplateIdString$" SubElementID="WARNING">
<Name>WARNING</Name>
<Description>WARNING</Description>
</DisplayString>
<DisplayString ElementID="SavisionCommunityMonitorQueryResult.QueryPerformanceCollection.$TemplateConfig/TemplateIdString$">
<Name>Query - $TemplateConfig/QueryName$ Result Collection</Name>
<Description>Description for the new rule</Description>
</DisplayString>
<DisplayString ElementID="SavisionCommunityMonitorQueryResult.SavisionCommunityMonitorQueryResultGroupDependencyMonitor">
<Name>Monitor Query Result Group Dependency Monitor</Name>
<Description/>
</DisplayString>
<DisplayString ElementID="SavisionCommunityMonitorQueryResult.$TemplateConfig/TemplateIdString$.SimpleAuthenticationAccount">
<Name>$TemplateConfig/Name$ ODBC monitoring Simple Authentication Profile</Name>
<Description>If specified, this login name and password can be referenced in the connection string to connect to $TemplateConfig/Name$ for alternative authentication model.</Description>
</DisplayString>
</DisplayStrings>
</LanguagePack>
</LanguagePacks>
</Implementation>
</Template>