server: bkctld-check-setup - Check how many inc operations are running
All checks were successful
gitea/evobackup/pipeline/head This commit looks good

Ok if there's none or one
Critical if theres more than one
This commit is contained in:
Ludovic Poujol 2025-01-14 10:28:45 +01:00
parent 457a4ddcda
commit 8147ba84ee
Signed by: lpoujol
SSH key fingerprint: SHA256:YZbQWfjHONnvIGkFZMs0xRKtqzqGqwtZU+kCOKhZXPA

View file

@ -76,6 +76,21 @@ else
[ "${return}" -le 2 ] && return=2
fi
# Check if there is no more than one inc running
nb_inc_running=$(pgrep --count bkctld-inc)
if [ "${nb_inc_running}" -eq 0 ]; then
output="${output}OK - no inc operations currently running.\n"
nb_ok=$((nb_ok + 1))
elif [ "${nb_inc_running}" -eq 1 ]; then
output="${output}OK - one inc operation currently running.\n"
nb_ok=$((nb_ok + 1))
else
output="${output}CRITICAL - ${nb_inc_running} inc operations currently running (should be 1 or 0)\n"
nb_crit=$((nb_crit + 1))
[ "${return}" -le 2 ] && return=2
fi
[ "${return}" -ge 0 ] && header="OK"
[ "${return}" -ge 1 ] && header="WARNING"
[ "${return}" -ge 2 ] && header="CRITICAL"