blob: ead65be0c5d2429b9b423d50a48182195ae45d37 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
#!/bin/sh
#
# Use the exit code of:
#
# custodian-queue --monitor=3000
#
# to determine if the queue is "too full". If so alert, via mauve.
#
#
# Find the hostname of the mauve-server to alert against
#
if [ -e /etc/custodian/custodian.cfg ] ; then
alert=$(grep ^mauve_target /etc/custodian/custodian.cfg 2>/dev/null | awk -F= '{print $2}' )
fi
#
# If we didn't find one then we'll use the default.
#
if [ -z "$alert" ]; then
alert=alert.bytemark.co.uk
fi
#
# Maximum queue size.
#
max=5000
#
# If the queu is too large.
#
if ( custodian-queue --monitor=$max ) ; then
#
# Raise an alert
#
mauvesend $alert -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
#
# Otherwise clear any prior alert.
#
mauvesend $alert -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
|