From 150f3712397feca925cef46a88e0ba6ec349bbf8 Mon Sep 17 00:00:00 2001 From: Ludovic Poujol Date: Fri, 19 Aug 2022 14:35:08 +0200 Subject: [PATCH] WIP > Adding more graphs --- server/misc/munin-plugin/bkctld_incs | 2 +- server/misc/munin-plugin/bkctld_ops | 34 +++++++++++++++++++++++ server/misc/munin-plugin/bkctld_rsyncs | 38 ++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 server/misc/munin-plugin/bkctld_ops create mode 100644 server/misc/munin-plugin/bkctld_rsyncs diff --git a/server/misc/munin-plugin/bkctld_incs b/server/misc/munin-plugin/bkctld_incs index 36434ce..e11c4ef 100644 --- a/server/misc/munin-plugin/bkctld_incs +++ b/server/misc/munin-plugin/bkctld_incs @@ -14,7 +14,7 @@ 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 +incs.label Incs available UNLIKELY_EOF exit 0;; diff --git a/server/misc/munin-plugin/bkctld_ops b/server/misc/munin-plugin/bkctld_ops new file mode 100644 index 0000000..0857858 --- /dev/null +++ b/server/misc/munin-plugin/bkctld_ops @@ -0,0 +1,34 @@ +#!/bin/bash +# +# + +case $1 in + config) + cat <<'UNLIKELY_EOF' +graph_title bkctld operations running +graph_vlabel Number of bkctld operations curently running +graph_args --lower-limit 0 + +graph_scale no +graph_category bkctld +graph_info The total number of bkctld operations curently running (being an bkctld inc or rm) + +bkctld_rm.info bkctld rm running +bkctld_rm.label Number of delete operation currently running + +bkctld_inc.info bkctld inc running +bkctld_inc.label Number of inc operation currently running + + +UNLIKELY_EOF + exit 0;; +esac + +bkctld_rm=$(ps aux | grep "bkctld-rm" | grep -v grep | wc -l) +bkctld_inc=$(ps aux | grep "bkctld-inc" | grep -v grep | wc -l) + +printf "bkctld_rm.value %s\n" $bkctld_rm +printf "bkctld_inc.value %s\n" $bkctld_inc + + + diff --git a/server/misc/munin-plugin/bkctld_rsyncs b/server/misc/munin-plugin/bkctld_rsyncs new file mode 100644 index 0000000..fce3cd6 --- /dev/null +++ b/server/misc/munin-plugin/bkctld_rsyncs @@ -0,0 +1,38 @@ +#!/bin/bash +# +# + +case $1 in + config) + cat <<'UNLIKELY_EOF' +graph_title bkctld rsync +graph_vlabel Number of rsync running in jails +graph_args --lower-limit 0 + +graph_scale no +graph_category bkctld +graph_info The total number of running rsync process running in jails (ecluding the rsync used to delete old incs) + +rsync.info Number of rsync running in jails +rsync.label Rsync running in jails + +UNLIKELY_EOF + exit 0;; +esac + +rsync_count=0 +pid_list=$(ps aux | grep "sh -c rsync" | grep -v grep | awk '{ print $2 }') + +for pid in $pid_list; do + pid_root=$(realpath "/proc/${pid}/root") + + if [[ $pid_root != '/' ]]; then + ((rsync_count++)) + fi + +done + +printf "rsync.value %s\n" $rsync_count + + +