Kaynağa Gözat

Updated localchecks/nextcloud-updates.sh to v1.8

Michael Honkoop 3 gün önce
ebeveyn
işleme
8ebdda8400
1 değiştirilmiş dosya ile 9 ekleme ve 8 silme
  1. 9 8
      localchecks/nextcloud-updates.sh

+ 9 - 8
localchecks/nextcloud-updates.sh

@@ -16,10 +16,11 @@
 # - Restructured and refined variables, also added additional comments per line of code
 # v1.7 CHANGES:
 # - Updated logic to also deal with higher installed version compared to release-url
-
+# v1.8 CHANGES:
+# - Updated status reporting to CheckMK when base conditions are not met
 
 # Current active version of the script
-SCRIPT_VERSION=1.7
+SCRIPT_VERSION=1.8
 
 # Installation:
 # This file should be place on a/the nextcloud host in /usr/lib/check_mk_agent/local
@@ -65,23 +66,23 @@ VERSION_FIELDS=2
 # Check availabillity of required commands or packages
 for COMMAND in sudo php jq curl; do
     if ! command -v "$COMMAND" >/dev/null 2>&1; then
-        echo "2 \"$SERVICE\" - $SERVICE localcheck requires $COMMAND command to be installed"
-        echo "2 \"$SERVICE Apps\" - $SERVICE localcheck requires $COMMAND command to be installed"
+        echo "3 \"$SERVICE\" - $SERVICE localcheck requires $COMMAND command to be installed"
+        echo "3 \"$SERVICE Apps\" - $SERVICE localcheck requires $COMMAND command to be installed"
         exit 0
     fi
 done
 
 # Check if configured apache user exists
 if ! id -u "$APACHEUSER" >/dev/null 2>&1; then
-    echo "2 \"$SERVICE\" - $SERVICE localcheck webserver user does not exist, check configuration!"
-    echo "2 \"$SERVICE Apps\" - $SERVICE Apps localcheck webserver user does not exist, check configuration!"
+    echo "3 \"$SERVICE\" - $SERVICE localcheck webserver user does not exist, check configuration!"
+    echo "3 \"$SERVICE Apps\" - $SERVICE Apps localcheck webserver user does not exist, check configuration!"
     exit 0
 fi
 
 # Check if configured basepath exists
 if [ ! -d "$BASEPATH" ]; then
-    echo "2 \"$SERVICE\" - $SERVICE localcheck could not find configured basepath, check configuration!"
-    echo "2 \"$SERVICE Apps\" - $SERVICE Apps localcheck could not find configured basepath, check configuration!"
+    echo "3 \"$SERVICE\" - $SERVICE localcheck could not find configured basepath, check configuration!"
+    echo "3 \"$SERVICE Apps\" - $SERVICE Apps localcheck could not find configured basepath, check configuration!"
     exit 0
 fi