diff options
author | Steve Kemp <steve@steve.org.uk> | 2012-12-06 10:56:47 +0000 |
---|---|---|
committer | Steve Kemp <steve@steve.org.uk> | 2012-12-06 10:56:47 +0000 |
commit | 93ca65487449ab491d1503ad3dc6b5044ea98343 (patch) | |
tree | 66650bf0f1381bc5d953a90f50f87349d88c50b4 /bytemark/bin/custodian-enqueue-parse-test | |
parent | a20675f785149a7d328b7439c0bcbf4df580355f (diff) |
Added script to report on parse failures.
Diffstat (limited to 'bytemark/bin/custodian-enqueue-parse-test')
-rwxr-xr-x | bytemark/bin/custodian-enqueue-parse-test | 16 |
1 files changed, 16 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 |