title: Alpine Linux: OpenRC Service Status
agents: linux
catalog: os/services
license: GPLv2
distribution: check_mk_alpine_agent
description:
 Reports the status of every service known to OpenRC ({rc-status -a}) as
 one Checkmk service per (non-transient) OpenRC service, based on this
 project's own {openrc_services} agent plugin - not shipped by Checkmk
 upstream, unlike this MKP's other plugins. Fills a real gap: Checkmk's
 built-in {systemd_units} check has no Alpine equivalent, since Alpine
 uses OpenRC rather than systemd.

 The plugin is shipped disabled by default and is enabled per host via
 the "Alpine agent plugins" rule in Setup > Agents, applied by
 {checkmk-agent-poller} on the host itself (not via the Checkmk Agent
 Bakery).

 Services belonging to the {shutdown}, {nonetwork}, or {single} OpenRC
 runlevels are intentionally not discovered at all: these runlevels are
 only active during a system shutdown or a no-network fallback boot, so
 their services show up as "stopped" during entirely normal operation -
 discovering them would just alert forever on an expected state.

 The check is {OK} if the service is reported {started} (or one of the
 similar states {hotplugged}, {coldplugged}, {wasinactive}), {WARN} for a
 transitional state ({inactive}, {starting}, {stopping}, {scheduled}, or
 any status this check doesn't otherwise recognize), and {CRIT} for
 {crashed}, {failed}, or {stopped}.

item:
 The OpenRC service name, e.g. {sshd} or {crond}. If the same service
 name appears under more than one runlevel (uncommon), the last one seen
 wins - a known simplification.

discovery:
 One service is created per distinct OpenRC service name reported by the
 agent, except for services belonging to the {shutdown}, {nonetwork}, or
 {single} runlevels (see above). This check has no discovery-parameter
 ruleset of its own to further narrow that down - not every host's admin
 wants a service per OpenRC entry, but the standard, built-in way to
 trim that down is Checkmk's own generic "Disabled services" rule
 (Setup > Services > Service monitoring rules; ruleset ID
 {ignored_services}), matching on the service name pattern
 {OpenRC service <name>} - no plugin-specific code needed, and it works
 the same way for any other check's services too.
