add simple monitoring for pagure's celery redis queue
Signed-off-by: Ricky Elrod <codeblock@fedoraproject.org>
This commit is contained in:
parent
3a7972233a
commit
f207778a0e
4 changed files with 32 additions and 0 deletions
23
roles/nagios_client/files/scripts/check_redis_queue.sh
Normal file
23
roles/nagios_client/files/scripts/check_redis_queue.sh
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue