Skip to main content

Description

The service_mon probe checks the state of an OS service (systemd unit on Linux, Windows service on Windows). Supports expecting running or stopped state.

Config fields

FieldTypeRequiredDefaultDescription
typestringYesMust be "service_mon"
managerstringYes"systemd" (Linux) or "windows_service" (Windows)
serviceNamestringYesService/unit name to check
expectedStatestringNo"running"Expected state: "running" or "stopped"

Metrics

MetricTypeDescription
vms.service_mon.statusstatusup (matches) or down
vms.service_mon.restart_countcounterRestart count (systemd .service units only)

Example config

{
  "type": "service_mon",
  "manager": "systemd",
  "serviceName": "nginx",
  "expectedState": "running"
}

Notes

  • manager must match the host OS. Cross-OS (e.g. systemd on Windows) fails at construction.
  • restart_count is only available for systemd .service units.