From 18ce3106fd6a70b0d8a494d17730217b91e72eac Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Thu, 5 Nov 2020 18:16:25 +0100 Subject: check_systemd --- check_systemd | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'check_systemd') diff --git a/check_systemd b/check_systemd index b2b140c..ef09146 100755 --- a/check_systemd +++ b/check_systemd @@ -5,11 +5,6 @@ FAILED=() -if ! systemctl is-system-running > /dev/null; then - echo systemd CRITICAL: System state degraded. - exit 2 -fi - for unit in "$@"; do if ! systemctl is-active "$unit" > /dev/null; then FAILED+=("$unit") @@ -21,5 +16,10 @@ if [ ${#FAILED[@]} -gt 0 ]; then exit 2 fi +if ! systemctl is-system-running > /dev/null; then + echo systemd WARNING: System state degraded. + exit 1 +fi + echo "systemd OK: $# units checked" exit 0 -- cgit v1.2.3