add simple monitoring for pagure's celery redis queue

Signed-off-by: Ricky Elrod <codeblock@fedoraproject.org>
This commit is contained in:
Rick Elrod 2017-05-26 23:09:02 +00:00
parent 3a7972233a
commit f207778a0e
4 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,23 @@
#!/usr/bin/env bash
. /usr/lib64/nagios/plugins/utils.sh
if [[ "$#" -ne 3 ]]; then
echo "Arguments: key warn crit"
exit $STATE_UNKNOWN
fi
tasks="$(redis-cli llen "$1" | awk '{print $1}')"
check_range $tasks $2:$3
status=$?
if [[ "$status" == "$STATE_OK" ]]; then
echo "OK: $1 queue has $tasks tasks"
elif [[ "$status" == "$STATE_WARNING" ]]; then
echo "WARNING: $1 queue has $tasks tasks"
elif [[ "$status" == "$STATE_CRITICAL" ]]; then
echo "CRITICAL: $1 queue has $tasks tasks"
fi
exit $status