mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 14:16:00 +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:
parent
a7d44887e4
commit
12cb113403
1 changed files with 4 additions and 2 deletions
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
# shellcheck shell=dash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@ env.username <nexcloud_user>
|
||||||
env.password <nextcloud_password>
|
env.password <nextcloud_password>
|
||||||
env.api_path <default: /ocs/v2.php/apps/serverinfo/api/v1/info>
|
env.api_path <default: /ocs/v2.php/apps/serverinfo/api/v1/info>
|
||||||
env.timeout <default: 2s>
|
env.timeout <default: 2s>
|
||||||
|
env.updates_warning <default: 1>
|
||||||
|
|
||||||
It's advised to set an app password (for this plugin) in your nextcloud
|
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.
|
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"
|
API_PATH="${api_path:-/ocs/v2.php/apps/serverinfo/api/v1/info}?format=json"
|
||||||
DOMAIN="${0##*nextcloud_}"
|
DOMAIN="${0##*nextcloud_}"
|
||||||
TIMEOUT="${timeout:-2}"
|
TIMEOUT="${timeout:-2}"
|
||||||
|
UPDATES_WARNING="${updates_warning:-1}"
|
||||||
CLEANDOMAIN="$(clean_fieldname "$DOMAIN")"
|
CLEANDOMAIN="$(clean_fieldname "$DOMAIN")"
|
||||||
USERNAME="${username:-}"
|
USERNAME="${username:-}"
|
||||||
PASSWORD="${password:-}"
|
PASSWORD="${password:-}"
|
||||||
|
|
||||||
print_json_data() {
|
print_json_data() {
|
||||||
# shellcheck disable=SC2039
|
|
||||||
local FIRST="$1"
|
local FIRST="$1"
|
||||||
[ -z "$FIRST" ] && exit 0
|
[ -z "$FIRST" ] && exit 0
|
||||||
shift 1
|
shift 1
|
||||||
|
@ -202,7 +204,7 @@ graph_category cloud
|
||||||
num_updates_available.label available app updates
|
num_updates_available.label available app updates
|
||||||
num_updates_available.info number of available app updates
|
num_updates_available.info number of available app updates
|
||||||
num_updates_available.min 0
|
num_updates_available.min 0
|
||||||
num_updates_available.warning 1
|
num_updates_available.warning ${UPDATES_WARNING}
|
||||||
num_installed.label installed apps
|
num_installed.label installed apps
|
||||||
num_installed.info number of installed apps
|
num_installed.info number of installed apps
|
||||||
num_installed.min 0
|
num_installed.min 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue