evobackup/server/misc/munin-plugin/bkctld_rsyncs
Ludovic Poujol 150f371239
All checks were successful
continuous-integration/drone/push Build is passing
gitea/evobackup/pipeline/head This commit looks good
WIP > Adding more graphs
2022-08-19 14:35:08 +02:00

39 lines
717 B
Bash

#!/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