1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

[nextcloud_] Allow to control warnings on the number of available updates

Signed-off-by: Olivier Mehani <shtrom@ssji.net>
This commit is contained in:
Olivier Mehani 2020-09-03 22:27:19 +10:00
parent a7d44887e4
commit 12cb113403

View file

@ -1,4 +1,5 @@
#!/bin/sh
# shellcheck shell=dash
set -e
@ -30,6 +31,7 @@ env.username <nexcloud_user>
env.password <nextcloud_password>
env.api_path <default: /ocs/v2.php/apps/serverinfo/api/v1/info>
env.timeout <default: 2s>
env.updates_warning <default: 1>
It's advised to set an app password (for this plugin) in your nextcloud
instance and not to use the "real" password of your nextcloud user.
@ -59,12 +61,12 @@ fi
API_PATH="${api_path:-/ocs/v2.php/apps/serverinfo/api/v1/info}?format=json"
DOMAIN="${0##*nextcloud_}"
TIMEOUT="${timeout:-2}"
UPDATES_WARNING="${updates_warning:-1}"
CLEANDOMAIN="$(clean_fieldname "$DOMAIN")"
USERNAME="${username:-}"
PASSWORD="${password:-}"
print_json_data() {
# shellcheck disable=SC2039
local FIRST="$1"
[ -z "$FIRST" ] && exit 0
shift 1
@ -202,7 +204,7 @@ graph_category cloud
num_updates_available.label available app updates
num_updates_available.info number of available app updates
num_updates_available.min 0
num_updates_available.warning 1
num_updates_available.warning ${UPDATES_WARNING}
num_installed.label installed apps
num_installed.info number of installed apps
num_installed.min 0