summaryrefslogtreecommitdiff
path: root/bytemark
diff options
context:
space:
mode:
Diffstat (limited to 'bytemark')
-rwxr-xr-xbytemark/bin/custodian-enqueue-parse-test16
-rw-r--r--bytemark/cron/custodian-enqueue-parse-test6
2 files changed, 22 insertions, 0 deletions
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