summaryrefslogtreecommitdiff
path: root/bytemark
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-12-06 10:25:43 +0000
committerSteve Kemp <steve@steve.org.uk>2012-12-06 10:25:43 +0000
commit2520e3bcf640a435c2865759c2c4e69c9beaa81f (patch)
treee893200bfa20d10d371f7cdd6879a376c3f4372f /bytemark
parent0a6d16fa6e7adf9b41b84ccf6be66584cc9ab560 (diff)
Actually alert via mauve if the queue is too full.
Diffstat (limited to 'bytemark')
-rwxr-xr-xbytemark/bin/custodian-queue-monitor20
1 files changed, 17 insertions, 3 deletions
diff --git a/bytemark/bin/custodian-queue-monitor b/bytemark/bin/custodian-queue-monitor
index 91a0364..2320cc5 100755
--- a/bytemark/bin/custodian-queue-monitor
+++ b/bytemark/bin/custodian-queue-monitor
@@ -1,7 +1,21 @@
#!/bin/sh
+#
+# Use the exit code of:
+#
+# custodian-queue --monitor=3000
+#
+# to determine if the queue is "too full". If so alert, via mauve.
+#
-if ( custodian-queue --monitor ) ; then
- echo "All OK"
+
+#
+# Maximum queue size.
+#
+max=5000
+
+
+if ( custodian-queue --monitor=$max ) ; then
+ mauvesend alert.bytemark.co.uk -i custodian -c now -s "Our queue is too full" --detail="<p>The custodian queue doesn't seem to be emptying [alert threshold is $max].</p><p>Is there a bug, or do we need to add more workers? See https://wiki.bytemark.co.uk/Main/CustodianMonitoring</p>"
else
- echo "Too large a queue"
+ mauvesend alert.bytemark.co.uk -i custodian -r now -s "Our queue is too full" --detail="<p>The custodian queue doesn't seem to be emptying [alert threshold is $max].</p><p>Is there a bug, or do we need to add more workers? See https://wiki.bytemark.co.uk/Main/CustodianMonitoring</p>"
fi