summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2012-12-06 10:56:47 +0000
committerSteve Kemp <steve@steve.org.uk>2012-12-06 10:56:47 +0000
commit93ca65487449ab491d1503ad3dc6b5044ea98343 (patch)
tree66650bf0f1381bc5d953a90f50f87349d88c50b4
parenta20675f785149a7d328b7439c0bcbf4df580355f (diff)
Added script to report on parse failures.
-rwxr-xr-xbin/custodian-enqueue13
-rwxr-xr-xbytemark/bin/custodian-enqueue-parse-test16
-rw-r--r--bytemark/cron/custodian-enqueue-parse-test6
-rw-r--r--debian/changelog6
4 files changed, 25 insertions, 16 deletions
diff --git a/bin/custodian-enqueue b/bin/custodian-enqueue
index 9e8e9a3..41378e6 100755
--- a/bin/custodian-enqueue
+++ b/bin/custodian-enqueue
@@ -175,19 +175,6 @@ if __FILE__ == $0 then
end
end
-
- #
- # If there were errors then we'll not get this far.
- #
- if ( File.exists?( "/etc/mauvealert/mauvesend.destination" ) )
-
- #
- # Inititate a heartbeat
- #
- system( "mauvesend alert.bytemark.co.uk -i custodian-enqueue -c now -r +10m -s \"heartbeat failed for custodian-enqueue.\" --detail=\"<p>The heartbeat wasn't sent for custodian-enqueue - This means that new tests are not being pushed into the <tt>beanstalkd</tt> queue, and our monitoring is potentially broken</p>\" " )
- end
-
-
end
diff --git a/bytemark/bin/custodian-enqueue-parse-test b/bytemark/bin/custodian-enqueue-parse-test
new file mode 100755
index 0000000..abd90f5
--- /dev/null
+++ b/bytemark/bin/custodian-enqueue-parse-test
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+# Parse the two configuration files we use, and alert if there
+# is a failure.
+#
+
+for file in bytemark.cfg managed-clients.cfg ; do
+
+ if ( ! custodian-enqueue --test --file /etc/custodian/$file >/dev/null 2>/dev/null ); then
+ mauvesend alert.bytemark.co.uk -i custodian-enqueue-$file -r now -s "Parse failure from custodian-enqueue against $file." --detail="<p>The file was not added to the queue successfully due to syntax error. Please fix.</p>"
+ else
+ mauvesend alert.bytemark.co.uk -i custodian-enqueue-$file -c now -s "Parse failure from custodian-enqueue against $file." --detail="<p>The file was not added to the queue successfully due to syntax error. Please fix.</p>"
+
+ fi
+
+done
diff --git a/bytemark/cron/custodian-enqueue-parse-test b/bytemark/cron/custodian-enqueue-parse-test
new file mode 100644
index 0000000..6d71e5c
--- /dev/null
+++ b/bytemark/cron/custodian-enqueue-parse-test
@@ -0,0 +1,6 @@
+#
+# Alert if our custodian parser sees a failure on any file.
+#
+# Run once an hour, during working hours.
+#
+2 09-18 * * 1-5 nobody /usr/bin/custodian-enqueue-parse-test
diff --git a/debian/changelog b/debian/changelog
index 5167462..407e3cd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,9 +2,9 @@ custodian (0.8-1) stable; urgency=low
* Produce a new package custodian-bytemark
- This contains a queue monitor.
- - TODO: This should contain a parser check
- * Don't overwrite the reason for failure when clearing alerts via
- mauve.
+ - This contains a parser check.
+ - Both these scripts are deployed to /usr/bin, and invoked via /etc/cron.d.
+ * Don't overwrite the reason for failure when clearing alerts via mauve.
-- Steve Kemp <steve@bytemark.co.uk> Thu, 6 Dec 2012 10:22:01 +0000