From cff9d7382fed09b7f43add610ff6eadc66e612a6 Mon Sep 17 00:00:00 2001 From: Ludovic Poujol Date: Fri, 19 Aug 2022 12:23:53 +0200 Subject: [PATCH] WIP > Working on some possible munin plugins --- server/misc/munin-plugin/README.md | 14 +++++++++++++ server/misc/munin-plugin/bkctld_incs | 25 +++++++++++++++++++++++ server/misc/munin-plugin/bkctld_jails | 29 +++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 server/misc/munin-plugin/README.md create mode 100644 server/misc/munin-plugin/bkctld_incs create mode 100644 server/misc/munin-plugin/bkctld_jails diff --git a/server/misc/munin-plugin/README.md b/server/misc/munin-plugin/README.md new file mode 100644 index 0000000..4f0a39d --- /dev/null +++ b/server/misc/munin-plugin/README.md @@ -0,0 +1,14 @@ +# Munin plugins for bkctld + +This is a work-in-progress. + +Plugins can be installed in /etc/munin/plugins/bkctld_incs (as executables) +and be run as root : + +~~~ +# cat /etc/munin/plugin-conf.d/bkctld +[bkctld_*] + user root +~~~ + +Don't forget to `systemctl restart munin-node` \ No newline at end of file diff --git a/server/misc/munin-plugin/bkctld_incs b/server/misc/munin-plugin/bkctld_incs new file mode 100644 index 0000000..36434ce --- /dev/null +++ b/server/misc/munin-plugin/bkctld_incs @@ -0,0 +1,25 @@ +#!/bin/bash +# +# + +case $1 in + config) + cat <<'UNLIKELY_EOF' +graph_title bkctld incs +graph_vlabel Number of incs +graph_args --lower-limit 0 + +graph_scale no +graph_category bkctld +graph_info The total number of available incs on the server + +incs.info Number of backup incs available +incs.label incs available + +UNLIKELY_EOF + exit 0;; +esac + +printf "incs.value " +ls -ld /backup/incs/*/* | wc -l + diff --git a/server/misc/munin-plugin/bkctld_jails b/server/misc/munin-plugin/bkctld_jails new file mode 100644 index 0000000..e10b806 --- /dev/null +++ b/server/misc/munin-plugin/bkctld_jails @@ -0,0 +1,29 @@ +#!/bin/bash +# +# + +case $1 in + config) + cat <<'UNLIKELY_EOF' +graph_title bkctld jails +graph_vlabel Number of jails +graph_args --lower-limit 0 + +graph_scale no +graph_category bkctld +graph_info The total number of configured jails on the server + +jails.info Number of backup jails configured +jails.label Jails Configured + +jails_active.info Number of backup jails active (running) +jails_active.label Jails active +UNLIKELY_EOF + exit 0;; +esac + +printf "jails.value " +bkctld list | wc -l + +printf "jails_active.value " +bkctld status all | grep ON | wc -l \ No newline at end of file