Long running task Monitor.
The monitor checks if a scheduled task is taking too long to complete. This monitor is disabled by default.
Use overrides to:
Enable the monitor
Set the threshold (in minutes)
The scheduled task is taking longer to complete than expected.
Consider altering the task so that it terminates faster.
Target | Custom.Windows.ScheduledTask | ||
Parent Monitor | System.Health.PerformanceState | ||
Category | AvailabilityHealth | ||
Enabled | False | ||
Alert Generate | True | ||
Alert Severity | MatchMonitorHealth | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Custom.Windows.ScheduledTask.LongRunningTask.MonitorType | ||
Remotable | False | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Custom.Windows.ScheduledTask.LongRunningTask.Monitor" Accessibility="Public" Enabled="false" Target="Custom.Windows.ScheduledTask" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="false" Priority="Normal" TypeID="Custom.Windows.ScheduledTask.LongRunningTask.MonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Custom.Windows.ScheduledTask.LongRunningTask.Monitor.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="SchTaskLib!Custom.Windows.TaskSchedulerTask"]/TaskName$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='SchTask:$Target/Property[Type="SchTaskLib!Custom.Windows.TaskSchedulerTask"]/TaskName$:LastRun']$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='SchTask:$Target/Property[Type="SchTaskLib!Custom.Windows.TaskSchedulerTask"]/TaskName$:Duration']$</AlertParameter3>
<AlertParameter4>$Target/Property[Type="Custom.Windows.ScheduledTask"]/TaskSchedule$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="UnderThreshold" MonitorTypeStateID="UnderThresh" HealthState="Success"/>
<OperationalState ID="OverThreshold" MonitorTypeStateID="OverThresh" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>68</IntervalSeconds>
<TargetComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</TargetComputerName>
<TimeoutSeconds>59</TimeoutSeconds>
<TaskName>$Target/Property[Type="SchTaskLib!Custom.Windows.TaskSchedulerTask"]/TaskName$</TaskName>
<Threshold>60</Threshold>
<TaskState>$Target/Property[Type="Custom.Windows.ScheduledTask"]/TaskState$</TaskState>
</Configuration>
</UnitMonitor>