WIP > Adding more graphs
continuous-integration/drone/push Build is passing Details
gitea/evobackup/pipeline/head This commit looks good Details

This commit is contained in:
Ludovic Poujol 2022-08-19 14:35:08 +02:00
parent cff9d7382f
commit 150f371239
3 changed files with 73 additions and 1 deletions

View File

@ -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;;

View File

@ -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

View File

@ -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