aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-11-05 18:16:25 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-11-05 18:16:25 +0100
commit18ce3106fd6a70b0d8a494d17730217b91e72eac (patch)
tree71b0df44aef01654171bcf5a9ec71d50c387269a
parentaabcd0ac01339d6cb65f4b7607a697a2fe52043d (diff)
downloadmonitoring_custom-18ce3106fd6a70b0d8a494d17730217b91e72eac.tar.gz
check_systemd
-rwxr-xr-xcheck_systemd10
1 files changed, 5 insertions, 5 deletions
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