Checks for task last run status.
The monitor checks for tasks (jobs) run status and alerts if a job has failed.
The default monitor scheduling is every 30' this can be changed via standard overrides. By default the monitor expects a 0 exit code from the job if it is successful, the exit code can be overridden as well.
A job can fail for several reasons, the most common ones are:
The job runs with invalid credentials, the account password has expired or the account hasn't the appropriate permissions
The job failed to run because of a invoked command failure, this is dependent to the scheduled command
By default a new scheduled job runs in the context of the creating user. This should be avoided and an ad hoc account should be created for the job. Alternatively the Local System Account (SYSTEM) can be used to run jobs in an administrative context.
For failing commands checks the command line from the command prompt using the same credentials the taskscheduler is going to use. PsExec can be useful in this.
You can even try to rerun the task from here: Start Scheduled Task.
Target | Progel.Windows.ScheduledTasks.2008.Job | ||
Parent Monitor | System.Health.AvailabilityState | ||
Category | AvailabilityHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | Warning | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Progel.Windows.ScheduledTasks.2008.Job.MonitorType | ||
Remotable | False | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Default |
<UnitMonitor ID="Progel.Windows.ScheduledTasks.2008.Job.Monitor" Accessibility="Public" Enabled="true" Target="Progel.Windows.ScheduledTasks.2008.Job" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="false" Priority="Normal" TypeID="Progel.Windows.ScheduledTasks.2008.Job.MonitorType" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<AlertSettings AlertMessage="Progel.Windows.ScheduledTasks.2008.Job.Monitor_AlertMessageResourceID">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type="ProgelWindowsScheduledTasksLibrary!Progel.Windows.ScheduledTasks.Job"]/JobName$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='LastRun']$</AlertParameter2>
<AlertParameter3>$Data/Context/Property[@Name='ExitCode']$</AlertParameter3>
<AlertParameter4>$Data/Context/Property[@Name='ExitCodeHex']$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="SUCCESS" MonitorTypeStateID="SUCCESS" HealthState="Success"/>
<OperationalState ID="FAILED" MonitorTypeStateID="FAILED" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<IntervalSeconds>1800</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>300</TimeoutSeconds>
<JobName>$Target/Property[Type="ProgelWindowsScheduledTasksLibrary!Progel.Windows.ScheduledTasks.Job"]/JobName$</JobName>
<ExpectedExitCode>^0$</ExpectedExitCode>
<ManagementGroupName>$Target/ManagementGroup/Id$</ManagementGroupName>
<LogSuccessEvent>true</LogSuccessEvent>
</Configuration>
</UnitMonitor>