From ab1e54e54c5bb510d15737a53c002177f15078d2 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Fri, 14 Mar 2014 19:44:56 +0000 Subject: [PATCH] Add some nagios client configuration for the new packages03,4 nodes. --- .../files/scripts/check_fcomm_queue | 23 +++++++++++++++++++ roles/nagios_client/tasks/main.yml | 4 ++++ .../check_fcomm_cache_worker_proc.cfg.j2 | 1 + .../templates/check_fcomm_queue.cfg.j2 | 1 + .../templates/check_redis_proc.cfg.j2 | 1 + 5 files changed, 30 insertions(+) create mode 100644 roles/nagios_client/files/scripts/check_fcomm_queue create mode 100644 roles/nagios_client/templates/check_fcomm_cache_worker_proc.cfg.j2 create mode 100644 roles/nagios_client/templates/check_fcomm_queue.cfg.j2 create mode 100644 roles/nagios_client/templates/check_redis_proc.cfg.j2 diff --git a/roles/nagios_client/files/scripts/check_fcomm_queue b/roles/nagios_client/files/scripts/check_fcomm_queue new file mode 100644 index 0000000000..b38d7f8664 --- /dev/null +++ b/roles/nagios_client/files/scripts/check_fcomm_queue @@ -0,0 +1,23 @@ +#!/usr/bin/env python +import sys + +try: + import retask.queue + + queue = retask.queue.Queue('fedora-packages') + queue.connect() + + items = queue.length + if items > 500: + print "CRITICAL: %i tasks in fcomm queue" % items + sys.exit(2) + elif items > 250: + print "WARNING: %i tasks in fcomm queue" % items + sys.exit(1) + else: + print "OK: %i tasks in fcomm queue" % items + sys.exit(0) + +except Exception as e: + print "UNKNOWN:", str(e) + sys.exit(3) diff --git a/roles/nagios_client/tasks/main.yml b/roles/nagios_client/tasks/main.yml index 60a64dd588..95dc3e1d97 100644 --- a/roles/nagios_client/tasks/main.yml +++ b/roles/nagios_client/tasks/main.yml @@ -23,6 +23,7 @@ - check_postfix_queue - check_raid.py - check_lock + - check_fcomm_queue # create dirs # puppet used to make /var/spool/nagios (owned by nagios.nagios) mode 750 @@ -57,6 +58,9 @@ - check_postfix_queue.cfg - check_lock.cfg - check_fedmsg_hub_proc.cfg + - check_redis_proc.cfg + - check_fcomm_cache_worker_proc.cfg + - check_fcomm_queue.cfg notify: - restart nrpe tags: diff --git a/roles/nagios_client/templates/check_fcomm_cache_worker_proc.cfg.j2 b/roles/nagios_client/templates/check_fcomm_cache_worker_proc.cfg.j2 new file mode 100644 index 0000000000..0709117405 --- /dev/null +++ b/roles/nagios_client/templates/check_fcomm_cache_worker_proc.cfg.j2 @@ -0,0 +1 @@ +command[check_fcomm_cache_worker_proc]=/usr/lib/nagios/plugins/check_procs -c 1:1 -C 'fcomm-cache-wor' -u apache diff --git a/roles/nagios_client/templates/check_fcomm_queue.cfg.j2 b/roles/nagios_client/templates/check_fcomm_queue.cfg.j2 new file mode 100644 index 0000000000..f63fdba511 --- /dev/null +++ b/roles/nagios_client/templates/check_fcomm_queue.cfg.j2 @@ -0,0 +1 @@ +command[check_fcomm_queue]=/usr/lib/nagios/plugins/check_fcomm_queue diff --git a/roles/nagios_client/templates/check_redis_proc.cfg.j2 b/roles/nagios_client/templates/check_redis_proc.cfg.j2 new file mode 100644 index 0000000000..417dfd9060 --- /dev/null +++ b/roles/nagios_client/templates/check_redis_proc.cfg.j2 @@ -0,0 +1 @@ +command[check_redis_proc]=/usr/lib/nagios/plugins/check_procs -c 1:1 -C 'redis-server' -u redis