Parcourir la source

Updated localchecks/directadmin.sh to v0.5

Michael Honkoop il y a 3 jours
Parent
commit
80be48a22c
1 fichiers modifiés avec 6 ajouts et 4 suppressions
  1. 6 4
      localchecks/directadmin.sh

+ 6 - 4
localchecks/directadmin.sh

@@ -12,9 +12,11 @@
 # - Removed a duplicate routine, and added more comments
 # Version 0.4:
 # - Added check for DirectAdmin Core => Rediscovery is required if you had a previous version installed !
+# Version 0.5:
+# - Updates status to be reported in CheckMK when prerequisites are missing.
 
 # Current active version of the script
-SCRIPT_VERSION=0.4
+SCRIPT_VERSION=0.5
 
 # Installation:
 # This file should be placed on a/the DirectAdmin host in /usr/lib/check_mk_agent/local
@@ -42,7 +44,7 @@ SERVICE="DirectAdmin"
 
 # Check if da command is present
 if ! command -v da >/dev/null 2>&1; then
-    echo "2 \"$SERVICE Core\" - $SERVICE executable was not found."
+    echo "3 \"$SERVICE Core\" - $SERVICE executable was not found."
 fi
 
 # Read installed DirectAdmin (core) version
@@ -50,7 +52,7 @@ DA_INSTALLED=$(da version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+(\.[0-9]+)?' | h
 
 # Check if a version was returned
 if [[ -z "$DA_INSTALLED" ]]; then
-    echo "2 \"$SERVICE Core\" - Unable to determine DirectAdmin Core version"
+    echo "3 \"$SERVICE Core\" - Unable to determine DirectAdmin Core version"
 fi
 
 # Read latest available DirectAdmin (core) version
@@ -58,7 +60,7 @@ DA_AVAILABLE=$(da update --check 2>&1 | grep -oE '[0-9]+\.[0-9]+(\.[0-9]+)?' | h
 
 # Check if a version was returned
 if [[ -z "$DA_AVAILABLE" ]]; then
-    echo "2 \"$SERVICE Core\" - Unable to determine available $SERVICE Core version"
+    echo "3 \"$SERVICE Core\" - Unable to determine available $SERVICE Core version"
 fi
 
 # Compare installed DirectAdmin version to available version