From cb6563c1ccb219eaa40f93f9d486ddf99961859d Mon Sep 17 00:00:00 2001 From: Brad Marshall Date: Tue, 17 Feb 2015 16:30:22 +1000 Subject: [PATCH] [bradm] Removed haproxy nrpe checks --- files/nrpe/check_haproxy.sh | 32 ------------------------- files/nrpe/check_haproxy_queue_depth.sh | 30 ----------------------- hooks/hooks.py | 10 -------- 3 files changed, 72 deletions(-) delete mode 100755 files/nrpe/check_haproxy.sh delete mode 100755 files/nrpe/check_haproxy_queue_depth.sh diff --git a/files/nrpe/check_haproxy.sh b/files/nrpe/check_haproxy.sh deleted file mode 100755 index eb8527f..0000000 --- a/files/nrpe/check_haproxy.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -#-------------------------------------------- -# This file is managed by Juju -#-------------------------------------------- -# -# Copyright 2009,2012 Canonical Ltd. -# Author: Tom Haddon - -CRITICAL=0 -NOTACTIVE='' -LOGFILE=/var/log/nagios/check_haproxy.log -AUTH=$(grep -r "stats auth" /etc/haproxy | head -1 | awk '{print $4}') - -for appserver in $(grep ' server' /etc/haproxy/haproxy.cfg | awk '{print $2'}); -do - output=$(/usr/lib/nagios/plugins/check_http -a ${AUTH} -I 127.0.0.1 -p 8888 --regex="class=\"(active|backup)(2|3).*${appserver}" -e ' 200 OK') - if [ $? != 0 ]; then - date >> $LOGFILE - echo $output >> $LOGFILE - /usr/lib/nagios/plugins/check_http -a ${AUTH} -I 127.0.0.1 -p 8888 -v | grep $appserver >> $LOGFILE 2>&1 - CRITICAL=1 - NOTACTIVE="${NOTACTIVE} $appserver" - fi -done - -if [ $CRITICAL = 1 ]; then - echo "CRITICAL:${NOTACTIVE}" - exit 2 -fi - -echo "OK: All haproxy instances looking good" -exit 0 diff --git a/files/nrpe/check_haproxy_queue_depth.sh b/files/nrpe/check_haproxy_queue_depth.sh deleted file mode 100755 index 3ebb532..0000000 --- a/files/nrpe/check_haproxy_queue_depth.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -#-------------------------------------------- -# This file is managed by Juju -#-------------------------------------------- -# -# Copyright 2009,2012 Canonical Ltd. -# Author: Tom Haddon - -# These should be config options at some stage -CURRQthrsh=0 -MAXQthrsh=100 - -AUTH=$(grep -r "stats auth" /etc/haproxy | head -1 | awk '{print $4}') - -HAPROXYSTATS=$(/usr/lib/nagios/plugins/check_http -a ${AUTH} -I 127.0.0.1 -p 8888 -u '/;csv' -v) - -for BACKEND in $(echo $HAPROXYSTATS| xargs -n1 | grep BACKEND | awk -F , '{print $1}') -do - CURRQ=$(echo "$HAPROXYSTATS" | grep $BACKEND | grep BACKEND | cut -d , -f 3) - MAXQ=$(echo "$HAPROXYSTATS" | grep $BACKEND | grep BACKEND | cut -d , -f 4) - - if [[ $CURRQ -gt $CURRQthrsh || $MAXQ -gt $MAXQthrsh ]] ; then - echo "CRITICAL: queue depth for $BACKEND - CURRENT:$CURRQ MAX:$MAXQ" - exit 2 - fi -done - -echo "OK: All haproxy queue depths looking good" -exit 0 - diff --git a/hooks/hooks.py b/hooks/hooks.py index f4e6b2f..1c400e8 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -618,16 +618,6 @@ def update_nrpe_config(): apt_install('python-dbus') - # haproxy checks - nrpe_setup.add_check( - shortname='haproxy_servers', - description='Check HAProxy {%s}' % current_unit, - check_cmd='check_haproxy.sh') - nrpe_setup.add_check( - shortname='haproxy_queue', - description='Check HAProxy queue depth {%s}' % current_unit, - check_cmd='check_haproxy_queue_depth.sh') - # corosync/crm checks nrpe_setup.add_check( shortname='corosync_rings',