[PATCH] Add basset monitoring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Patrick Uiterwijk <puiterwijk@xxxxxxxxxx>
---
 .../client/files/scripts/check_rabbitmq_size       | 22 ++++++++++++++++++
 roles/nagios/client/tasks/main.yml                 |  1 +
 roles/nagios/client/templates/check_basset.cfg.j2  |  4 ++++
 .../nagios/server/files/nagios/hosts/basset01.cfg  |  7 ++++++
 .../nagios/server/files/nagios/services/basset.cfg | 27 ++++++++++++++++++++++
 5 files changed, 61 insertions(+)
 create mode 100644 roles/nagios/client/files/scripts/check_rabbitmq_size
 create mode 100644 roles/nagios/client/templates/check_basset.cfg.j2
 create mode 100644 roles/nagios/server/files/nagios/hosts/basset01.cfg
 create mode 100644 roles/nagios/server/files/nagios/services/basset.cfg

diff --git a/roles/nagios/client/files/scripts/check_rabbitmq_size b/roles/nagios/client/files/scripts/check_rabbitmq_size
new file mode 100644
index 0000000..6527b72
--- /dev/null
+++ b/roles/nagios/client/files/scripts/check_rabbitmq_size
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+QUEUE=$1
+
+QUEUESIZE=`rabbitmqctl list_queues | grep $QUEUE | awk '{print $2}'`
+
+CRITICAL=20
+WARNING=15
+
+
+if [ $QUEUESIZE -gt $CRITICAL ]
+then
+    echo "queuesize: CRITICAL Queue size: $QUEUESIZE"
+    exit 2
+elif [ $QUEUESIZE -gt $WARNING ]
+then
+    echo "queuesize: WARNING Queue size: $QUEUESIZE"
+    exit 1
+else
+    echo "queuesize: OK Queue size: $QUEUESIZE"
+    exit 0
+fi
diff --git a/roles/nagios/client/tasks/main.yml b/roles/nagios/client/tasks/main.yml
index 325a1e2..5124850 100644
--- a/roles/nagios/client/tasks/main.yml
+++ b/roles/nagios/client/tasks/main.yml
@@ -118,6 +118,7 @@
   - check_datanommer_history.cfg
   - check_memcache.cfg
   - check_lock_file_age.cfg
+  - check_basset.cfg
   - check_koschei_polling_proc.cfg
   - check_koschei_resolver_proc.cfg
   - check_koschei_scheduler_proc.cfg
diff --git a/roles/nagios/client/templates/check_basset.cfg.j2 b/roles/nagios/client/templates/check_basset.cfg.j2
new file mode 100644
index 0000000..7dac2c1
--- /dev/null
+++ b/roles/nagios/client/templates/check_basset.cfg.j2
@@ -0,0 +1,4 @@
+command[check_mongo_proc]={{ libdir }}/nagios/plugins/check_procs -s RSD -u mongodb -C mongod -c 1:1
+command[check_rabbitmq_proc]={{ libdir }}/nagios/plugins/check_procs -s RSD -u rabbitmq -C beam.smp -c 1:1
+command[check_worker_proc]={{ libdir }}/nagios/plugins/check_procs -s RSD -u basset-worker -C basset-worker -c 1:1
+command[check_basset_queue]={{ libdir }}/nagios/plugins/checkrabbitmq_size check_submission
diff --git a/roles/nagios/server/files/nagios/hosts/basset01.cfg b/roles/nagios/server/files/nagios/hosts/basset01.cfg
new file mode 100644
index 0000000..e9a6d10
--- /dev/null
+++ b/roles/nagios/server/files/nagios/hosts/basset01.cfg
@@ -0,0 +1,7 @@
+define host {
+  host_name                    basset01
+  alias                        basset01.phx2.fedoraproject.org
+  use                          defaulttemplate
+  address                      basset01.phx2.fedoraproject.org
+  parents                      virthost19
+}
diff --git a/roles/nagios/server/files/nagios/services/basset.cfg b/roles/nagios/server/files/nagios/services/basset.cfg
new file mode 100644
index 0000000..006a92a
--- /dev/null
+++ b/roles/nagios/server/files/nagios/services/basset.cfg
@@ -0,0 +1,27 @@
+define service {
+  host_name             baset01
+  service_description   mongo process
+  check_command         check_by_nrpe!check_mongo_proc
+  use                   defaulttemplate
+}
+
+define service {
+  host_name             basset01
+  service_description   rabbitmq process
+  check_command         check_by_nrpe!check_rabbitmq_proc
+  use                   defaulttemplate
+}
+
+define service {
+  host_name             basset01
+  service_description   basset worker processes
+  check_command         check_by_nrpe!check_worker_proc
+  use                   defaulttemplate
+}
+
+define service {
+  host_name             basset01
+  service_description   basset processing queue
+  check_command         check_by_nrpe!check_basset_queue
+  use                   defaulttemplate
+}
-- 
1.8.3.1
_______________________________________________
infrastructure mailing list
infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
http://lists.fedoraproject.org/admin/lists/infrastructure@xxxxxxxxxxxxxxxxxxxxxxx




[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux