mirror of
https://github.com/prometheus-community/windows_exporter.git
synced 2026-03-03 00:56:35 +00:00
Added doc for Scheduled Task collector
Signed-off-by: Rahman Mousavian <rahman.mousavian@oracle.com>
This commit is contained in:
@@ -28,6 +28,7 @@ This directory contains documentation of the collectors in the windows_exporter,
|
|||||||
- [`os`](collector.os.md)
|
- [`os`](collector.os.md)
|
||||||
- [`process`](collector.process.md)
|
- [`process`](collector.process.md)
|
||||||
- [`remote_fx`](collector.remote_fx.md)
|
- [`remote_fx`](collector.remote_fx.md)
|
||||||
|
- [`scheduled_task`](collector.scheduled_task.md)
|
||||||
- [`service`](collector.service.md)
|
- [`service`](collector.service.md)
|
||||||
- [`smtp`](collector.smtp.md)
|
- [`smtp`](collector.smtp.md)
|
||||||
- [`system`](collector.system.md)
|
- [`system`](collector.system.md)
|
||||||
|
|||||||
67
docs/collector.scheduled_task.md
Normal file
67
docs/collector.scheduled_task.md
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
# scheduled_task collector
|
||||||
|
|
||||||
|
The scheduled_task collector exposes metrics about Windows Task Scheduler
|
||||||
|
|
||||||
|
|||
|
||||||
|
-|-
|
||||||
|
Metric name prefix | `scheduled_task`
|
||||||
|
Data source | OLE
|
||||||
|
Enabled by default? | No
|
||||||
|
|
||||||
|
## Flags
|
||||||
|
|
||||||
|
### `--collector.scheduled_task.whitelist`
|
||||||
|
|
||||||
|
If given, the path of the task needs to match the whitelist regexp in order for the corresponding metrics to be reported.
|
||||||
|
|
||||||
|
### `--collector.scheduled_task.blacklist`
|
||||||
|
|
||||||
|
If given, the path of the task needs to *not* match the blacklist regexp in order for the corresponding metrics to be reported.
|
||||||
|
|
||||||
|
## Metrics
|
||||||
|
|
||||||
|
Name | Description | Type | Labels
|
||||||
|
-----|-------------|------|-------
|
||||||
|
`windows_scheduled_task_last_result` | The result that was returned the last time the registered task was run | gauge | task
|
||||||
|
`windows_scheduled_task_missed_runs` | The number of times the registered task missed a scheduled run | gauge | task
|
||||||
|
`windows_scheduled_task_state` | The current state of a scheduled task | gauge | task, state
|
||||||
|
|
||||||
|
For the values of the `state` label, see below.
|
||||||
|
|
||||||
|
### State
|
||||||
|
|
||||||
|
A task can be in the following states:
|
||||||
|
- `disabled`
|
||||||
|
- `queued`
|
||||||
|
- `ready`
|
||||||
|
- `running`
|
||||||
|
- `unknown`
|
||||||
|
|
||||||
|
|
||||||
|
### Example metric
|
||||||
|
|
||||||
|
```
|
||||||
|
windows_scheduled_task_last_result{task="/Microsoft/Windows/Chkdsk/SyspartRepair"} 1
|
||||||
|
windows_scheduled_task_missed_runs{task="/Microsoft/Windows/Chkdsk/SyspartRepair"} 0
|
||||||
|
windows_scheduled_task_state{state="disabled",task="/Microsoft/Windows/Chkdsk/SyspartRepair"} 1
|
||||||
|
windows_scheduled_task_state{state="queued",task="/Microsoft/Windows/Chkdsk/SyspartRepair"} 0
|
||||||
|
windows_scheduled_task_state{state="ready",task="/Microsoft/Windows/Chkdsk/SyspartRepair"} 0
|
||||||
|
windows_scheduled_task_state{state="running",task="/Microsoft/Windows/Chkdsk/SyspartRepair"} 0
|
||||||
|
windows_scheduled_task_state{state="unknown",task="/Microsoft/Windows/Chkdsk/SyspartRepair"} 0
|
||||||
|
```
|
||||||
|
|
||||||
|
## Useful queries
|
||||||
|
_This collector does not yet have any useful queries added, we would appreciate your help adding them!_
|
||||||
|
|
||||||
|
## Alerting examples
|
||||||
|
**prometheus.rules**
|
||||||
|
```yaml
|
||||||
|
- alert: "WindowsScheduledTaskFailure"
|
||||||
|
expr: "windows_scheduled_task_last_result == 0"
|
||||||
|
for: "1d"
|
||||||
|
labels:
|
||||||
|
severity: "high"
|
||||||
|
annotations:
|
||||||
|
summary: "Scheduled Task Failed"
|
||||||
|
description: "Scheduled task '{{ $labels.task }}' failed for 1 day"
|
||||||
|
```
|
||||||
@@ -5,6 +5,8 @@ collectors:
|
|||||||
collector:
|
collector:
|
||||||
service:
|
service:
|
||||||
services-where: Name='windows_exporter'
|
services-where: Name='windows_exporter'
|
||||||
|
scheduled_task:
|
||||||
|
blacklist: /Microsoft/.+
|
||||||
log:
|
log:
|
||||||
level: debug
|
level: debug
|
||||||
scrape:
|
scrape:
|
||||||
|
|||||||
Reference in New Issue
Block a user