systemd
Reference for the `systemd` collector.
systemd· collector · runnanook doc systemdfor the same content in your terminal.
Tracks systemd unit ActiveState and SubState via the system DBus.
Options
| Option | Type | Default | Description |
|---|---|---|---|
units | string | required | list of unit names to monitor (e.g. ["nginx.service", "sshd.service"]) |
Metrics
| Metric | Kind | Unit | Description |
|---|---|---|---|
systemd.active | bool | — | true when the unit's ActiveState is active. Labels: unit. |
systemd.state | enum | — | ActiveState as a labelled enum. Labels: unit. |
systemd.sub_state | enum | — | SubState as a labelled enum. Labels: unit. |
Examples
Watch a single unit
[[]]
= "nginx"
= "systemd"
= 30
[]
= ["nginx.service"]
Alert when a service stops being active
[[]]
= 'nginx::systemd.active == 0'
= 1
= "ops"
Multiple units in one collector
[[]]
= "core"
= "systemd"
[]
= ["sshd.service", "nginx.service", "postgresql.service"]
[[]]
= 'core::systemd.state is "failed"'
= 1
= "ops"