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