diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-11-05 18:16:25 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-11-05 18:16:25 +0100 |
commit | 18ce3106fd6a70b0d8a494d17730217b91e72eac (patch) | |
tree | 71b0df44aef01654171bcf5a9ec71d50c387269a | |
parent | aabcd0ac01339d6cb65f4b7607a697a2fe52043d (diff) | |
download | monitoring_custom-18ce3106fd6a70b0d8a494d17730217b91e72eac.tar.gz |
check_systemd
-rwxr-xr-x | check_systemd | 10 |
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 |