Merge ~ec0/charm-helpers:fix-haproxy-check-credentials into charm-helpers:master

Proposed by James Hebden
Status: Needs review
Proposed branch: ~ec0/charm-helpers:fix-haproxy-check-credentials
Merge into: charm-helpers:master
Diff against target: 25 lines (+2/-2)
2 files modified
charmhelpers/contrib/openstack/files/check_haproxy.sh (+1/-1)
charmhelpers/contrib/openstack/files/check_haproxy_queue_depth.sh (+1/-1)
Reviewer Review Type Date Requested Status
James Page (community) Disapprove
VCS imports Pending
Review via email: mp+336083@code.launchpad.net

Description of the change

Fix LP#1743287

These changes fix a regression in the haproxy NRPE checks when gathering credentials for querying the admin haproxy endpoint, to determine haproxy backend server health via the admin API.

To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :
review: Disapprove

Unmerged commits

bec9314... by James Hebden

Fix credential gathering for haproxy NRPE checks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/charmhelpers/contrib/openstack/files/check_haproxy.sh b/charmhelpers/contrib/openstack/files/check_haproxy.sh
2index 7aab129..1df55db 100755
3--- a/charmhelpers/contrib/openstack/files/check_haproxy.sh
4+++ b/charmhelpers/contrib/openstack/files/check_haproxy.sh
5@@ -9,7 +9,7 @@
6 CRITICAL=0
7 NOTACTIVE=''
8 LOGFILE=/var/log/nagios/check_haproxy.log
9-AUTH=$(grep -r "stats auth" /etc/haproxy/haproxy.cfg | awk 'NR=1{print $4}')
10+AUTH=$(grep -r "stats auth" /etc/haproxy/haproxy.cfg | awk 'NR=1{print $3}')
11
12 typeset -i N_INSTANCES=0
13 for appserver in $(awk '/^\s+server/{print $2}' /etc/haproxy/haproxy.cfg)
14diff --git a/charmhelpers/contrib/openstack/files/check_haproxy_queue_depth.sh b/charmhelpers/contrib/openstack/files/check_haproxy_queue_depth.sh
15index 3ebb532..91ce024 100755
16--- a/charmhelpers/contrib/openstack/files/check_haproxy_queue_depth.sh
17+++ b/charmhelpers/contrib/openstack/files/check_haproxy_queue_depth.sh
18@@ -10,7 +10,7 @@
19 CURRQthrsh=0
20 MAXQthrsh=100
21
22-AUTH=$(grep -r "stats auth" /etc/haproxy | head -1 | awk '{print $4}')
23+AUTH=$(grep -r "stats auth" /etc/haproxy/haproxy.cfg | awk 'NR=1{print $3}')
24
25 HAPROXYSTATS=$(/usr/lib/nagios/plugins/check_http -a ${AUTH} -I 127.0.0.1 -p 8888 -u '/;csv' -v)
26

Subscribers

People subscribed via source and target branches

to all changes: