2
#--------------------------------------------
3
# This file is managed by Juju
4
#--------------------------------------------
6
# Copyright 2009,2012 Canonical Ltd.
9
# These should be config options at some stage
13
AUTH=$(grep -r "stats auth" /etc/haproxy | head -1 | awk '{print $4}')
15
HAPROXYSTATS=$(/usr/lib/nagios/plugins/check_http -a ${AUTH} -I 127.0.0.1 -p 8888 -u '/;csv' -v)
17
for BACKEND in $(echo $HAPROXYSTATS| xargs -n1 | grep BACKEND | awk -F , '{print $1}')
19
CURRQ=$(echo "$HAPROXYSTATS" | grep $BACKEND | grep BACKEND | cut -d , -f 3)
20
MAXQ=$(echo "$HAPROXYSTATS" | grep $BACKEND | grep BACKEND | cut -d , -f 4)
22
if [[ $CURRQ -gt $CURRQthrsh || $MAXQ -gt $MAXQthrsh ]] ; then
23
echo "CRITICAL: queue depth for $BACKEND - CURRENT:$CURRQ MAX:$MAXQ"
28
echo "OK: All haproxy queue depths looking good"