diff --git a/check_systemd_unit b/check_systemd_unit index 85a108a..289c640 100755 --- a/check_systemd_unit +++ b/check_systemd_unit @@ -14,11 +14,11 @@ service="$1" # If the service is null, be critical if [ -z "$service" ]; then echo "UNIT CRITICAL - Service is undefined" - exit 1 + exit 2 # If systemctl is not present, be critical elif ! command -v systemctl > /dev/null 2>&1; then echo "UNIT CRITICAL - systemctl missing from PATH" - exit 1 + exit 2 # If the service is failed, be critical elif systemctl is-failed --quiet "$service" > /dev/null 2>&1; then echo "UNIT CRITICAL - $service is failed" @@ -33,7 +33,7 @@ else ;; 1|2) echo "UNIT CRITICAL - $service is dead" - exit 3 + exit 2 ;; 3) # In this case, the unit is not running. Whether this is an issue depends on the type of service @@ -42,12 +42,12 @@ else exit 0 else echo "UNIT CRITICAL - $service is not running" - exit 4 + exit 2 fi ;; 4) echo "UNIT CRITICAL - $service is not present on this machine" - exit 50 + exit 2 ;; esac fi