From 42e6b9f0ad91a1b4e4d9c38a0179a70ce3033e50 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 24 Sep 2019 16:00:51 +0200 Subject: Add a basic script to monitor rabbitmq queues --- conf/apache-wsgi.conf | 11 ----------- conf/django.wsgi | 5 ----- conf/rbmq_gen_summary.sh | 23 +++++++++++++++++++++++ 3 files changed, 23 insertions(+), 16 deletions(-) delete mode 100644 conf/apache-wsgi.conf delete mode 100644 conf/django.wsgi create mode 100644 conf/rbmq_gen_summary.sh diff --git a/conf/apache-wsgi.conf b/conf/apache-wsgi.conf deleted file mode 100644 index d1d6672e2..000000000 --- a/conf/apache-wsgi.conf +++ /dev/null @@ -1,11 +0,0 @@ - - ServerName ishtar.example.com - WSGIDaemonProcess ishtar processes=2 maximum-requests=500 threads=1 - WSGIProcessGroup ishtar - WSGIScriptAlias / /var/local/ishtar/ishtar/apache/django.wsgi - - ErrorLog ${APACHE_LOG_DIR}/ishtar/error.log - LogLevel warn - CustomLog ${APACHE_LOG_DIR}/ishtar/access.log combined - - diff --git a/conf/django.wsgi b/conf/django.wsgi deleted file mode 100644 index ca0a2e5ac..000000000 --- a/conf/django.wsgi +++ /dev/null @@ -1,5 +0,0 @@ -import os, sys -sys.path.append('/srv/ishtar/') -os.environ['DJANGO_SETTINGS_MODULE'] = 'ishtar.settings' -import django.core.handlers.wsgi -application = django.core.handlers.wsgi.WSGIHandler() diff --git a/conf/rbmq_gen_summary.sh b/conf/rbmq_gen_summary.sh new file mode 100644 index 000000000..15cdf0f9f --- /dev/null +++ b/conf/rbmq_gen_summary.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +INSTANCES="formation_v3 prod_v3" + +DEST="/srv/www/rabbitmq-queues.json" +CDATE=`date --iso-8601=seconds` +echo '{"date": "'$CDATE'",' > $DEST +echo -n ' "instances": [' >> $DEST + +PREV="" +for INSTANCE in $INSTANCES; do + echo $PREV"" >> $DEST + echo ' {"name": "'$INSTANCE'",' >> $DEST + values=`rabbitmqctl list_queues -p /ishtar$INSTANCE -q messages` + total=0 + for value in $values; do + (( total += value )) + done + echo -n ' "queue": '$total'}' >> $DEST + PREV="," +done +echo "" >> $DEST +echo ' ]}' >> $DEST -- cgit v1.2.3