|
@@ -12,9 +12,11 @@
|
|
|
# - Removed a duplicate routine, and added more comments
|
|
# - Removed a duplicate routine, and added more comments
|
|
|
# Version 0.4:
|
|
# Version 0.4:
|
|
|
# - Added check for DirectAdmin Core => Rediscovery is required if you had a previous version installed !
|
|
# - 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
|
|
# Current active version of the script
|
|
|
-SCRIPT_VERSION=0.4
|
|
|
|
|
|
|
+SCRIPT_VERSION=0.5
|
|
|
|
|
|
|
|
# Installation:
|
|
# Installation:
|
|
|
# This file should be placed on a/the DirectAdmin host in /usr/lib/check_mk_agent/local
|
|
# 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
|
|
# Check if da command is present
|
|
|
if ! command -v da >/dev/null 2>&1; then
|
|
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
|
|
fi
|
|
|
|
|
|
|
|
# Read installed DirectAdmin (core) version
|
|
# 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
|
|
# Check if a version was returned
|
|
|
if [[ -z "$DA_INSTALLED" ]]; then
|
|
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
|
|
fi
|
|
|
|
|
|
|
|
# Read latest available DirectAdmin (core) version
|
|
# 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
|
|
# Check if a version was returned
|
|
|
if [[ -z "$DA_AVAILABLE" ]]; then
|
|
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
|
|
fi
|
|
|
|
|
|
|
|
# Compare installed DirectAdmin version to available version
|
|
# Compare installed DirectAdmin version to available version
|