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
|
|
@ -73,6 +73,7 @@
|
|||
- check_osbs_builds.py
|
||||
- check_osbs_api.py
|
||||
- check_ipa_replication
|
||||
- check_redis_queue.sh
|
||||
when: not inventory_hostname.startswith('noc')
|
||||
tags:
|
||||
- nagios_client
|
||||
|
@ -146,6 +147,7 @@
|
|||
- check_koschei_watcher_proc.cfg
|
||||
- check_testcloud.cfg
|
||||
- check_mirrorlist_docker_proxy.cfg
|
||||
- check_celery_redis_queue.cfg
|
||||
notify:
|
||||
- restart nrpe
|
||||
tags:
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
command[check_celery_redis_queue]=/usr/lib64/nagios/plugins/check_redis_queue.sh celery 5 10
|
|
@ -0,0 +1,6 @@
|
|||
define service {
|
||||
host_name pagure01.fedoraproject.org
|
||||
service_description Redis/celery queue
|
||||
check_command check_by_nrpe!check_celery_redis_queue
|
||||
use defaulttemplate
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue