|
@@ -16,10 +16,11 @@
|
|
|
# - Restructured and refined variables, also added additional comments per line of code
|
|
# - Restructured and refined variables, also added additional comments per line of code
|
|
|
# v1.7 CHANGES:
|
|
# v1.7 CHANGES:
|
|
|
# - Updated logic to also deal with higher installed version compared to release-url
|
|
# - 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
|
|
# Current active version of the script
|
|
|
-SCRIPT_VERSION=1.7
|
|
|
|
|
|
|
+SCRIPT_VERSION=1.8
|
|
|
|
|
|
|
|
# Installation:
|
|
# Installation:
|
|
|
# This file should be place on a/the nextcloud host in /usr/lib/check_mk_agent/local
|
|
# 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
|
|
# Check availabillity of required commands or packages
|
|
|
for COMMAND in sudo php jq curl; do
|
|
for COMMAND in sudo php jq curl; do
|
|
|
if ! command -v "$COMMAND" >/dev/null 2>&1; then
|
|
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
|
|
exit 0
|
|
|
fi
|
|
fi
|
|
|
done
|
|
done
|
|
|
|
|
|
|
|
# Check if configured apache user exists
|
|
# Check if configured apache user exists
|
|
|
if ! id -u "$APACHEUSER" >/dev/null 2>&1; then
|
|
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
|
|
exit 0
|
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
# Check if configured basepath exists
|
|
# Check if configured basepath exists
|
|
|
if [ ! -d "$BASEPATH" ]; then
|
|
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
|
|
exit 0
|
|
|
fi
|
|
fi
|
|
|
|
|
|