sys-ctl-hlth-journalctlΒΆ
DescriptionΒΆ
Scans journalctl over the last day for βerrorβ entries outside container logs and alerts if any are found.
OverviewΒΆ
This role searches the systemd journal for errors over the past day and alerts if any are found. Container output is skipped, because every compose service logs to journald and application errors would otherwise trigger the host check. Docker daemon and system errors are still reported.
CosmosΒΆ
The diagram places sys-ctl-hlth-journalctl in the Infinito.Nexus cosmos: the components it deploys (capabilities), the central services it consumes (dependencies), and its outward reach (federation and bridged external networks).
flowchart LR
subgraph role [sys-ctl-hlth-journalctl π»]
svc_journalctl["journalctl"]
end
Solid 1:1 edges are fixed relationships; dashed 0..1 edges are conditional (enabled only in matching deployments); red 0..0 edges are turned off in this role. Node markers show the roleβs deploy modes (π» host, π³ compose, π swarm); β marks a service that is explicitly turned off, and βοΈ an Ansible role dependency declared in meta/main.yml.
FeaturesΒΆ
Reads the last day of the journal as JSON with every field in full (
--all) and drops every entry that carries aCONTAINER_IDfield.Joins a repeated
MESSAGEfield into one line before matching.Matches the remaining messages case-insensitively against
error.Prints one
source: messageline per match, naming the systemd unit or, without one, the syslog identifier, so alerts show who logged the error.Exits non-zero on matches, and also when
journalctlitself fails, so a broken check never passes silently.Scheduled via systemd timer.
Alerts via
sys-ctl-alm-composeon detection.
UsageΒΆ
Include the role; set on_calendar_health_journalctl for your preferred schedule.
CreditsΒΆ
Implemented by Kevin Veen-Birkenbach. Part of the Infinito.Nexus Project and maintained by Kevin Veen-Birkenbach. Licensed under the Infinito.Nexus Community License (Non-Commercial).