summaryrefslogtreecommitdiff
path: root/bytemark/bin/custodian-queue-monitor
blob: 0b32370165c0e33e7f7e3708f7b44e5a1647562d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.
#


#
# Maximum queue size.
#
max=5000


if ( custodian-queue --monitor=$max ) ; then
    mauvesend alert.bytemark.co.uk -i custodian -c now -s "Our custodian 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
    mauvesend alert.bytemark.co.uk -i custodian -r now -s "Our custodian 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