Explorar el Código

Added case for failed services

check_service returns OK for stopped systemd services where the active attribute is failed
shyam hace 10 años
padre
commit
6fbd6dc0b9
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      check_service.sh

+ 4 - 0
check_service.sh

@@ -252,6 +252,10 @@ case $STATUS_MSG in
         echo "Error in command: $STATUS_MSG"
         echo "Error in command: $STATUS_MSG"
         exit $CRITICAL
         exit $CRITICAL
         ;;
         ;;
+*[fF]ailed*)
+        echo "$STATUS_MSG"
+        exit $CRITICAL
+        ;;
 *[eE]nable*)
 *[eE]nable*)
         echo "$STATUS_MSG"
         echo "$STATUS_MSG"
         exit $OK
         exit $OK