From: Peter Palfrader Date: Sun, 11 Feb 2018 10:17:28 +0000 (+0100) Subject: Add dsa-check-systemd-services X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-nagios.git;a=commitdiff_plain;h=86052c3ac0fa5cd3efaf39526fe69d6c4a2e1dbb Add dsa-check-systemd-services --- diff --git a/dsa-nagios-checks/checks/dsa-check-systemd-services b/dsa-nagios-checks/checks/dsa-check-systemd-services new file mode 100755 index 0000000..b1a558f --- /dev/null +++ b/dsa-nagios-checks/checks/dsa-check-systemd-services @@ -0,0 +1,12 @@ +#!/bin/sh + +status=$(/bin/systemctl is-system-running) +rc=$? + +if [ "$rc" != 0 ]; then + extra=": $(systemctl --failed --no-legend | awk '{print $1}' | sed -e ':start; N; $!b start; s/\n/, /g')" +else + extra="" +fi +echo "$status$extra" +exit $rc diff --git a/dsa-nagios-checks/debian/changelog b/dsa-nagios-checks/debian/changelog index d929f7a..55ba4d1 100644 --- a/dsa-nagios-checks/debian/changelog +++ b/dsa-nagios-checks/debian/changelog @@ -1,3 +1,10 @@ +dsa-nagios-checks (113) unstable; urgency=medium + + * Add dsa-check-systemd-services that also prints failed systemd services + when things are degraded. + + -- Peter Palfrader Sun, 11 Feb 2018 11:16:30 +0100 + dsa-nagios-checks (112) unstable; urgency=medium * maintainer scripts: use dpkg-maintscript-helper to clean out