Merge lp:~axino/charms/trusty/haproxy/fix-queue-depth-check into lp:charms/trusty/haproxy

Proposed by Junien F
Status: Merged
Merged at revision: 91
Proposed branch: lp:~axino/charms/trusty/haproxy/fix-queue-depth-check
Merge into: lp:charms/trusty/haproxy
Diff against target: 14 lines (+2/-2)
1 file modified
files/nrpe/check_haproxy_queue_depth.sh (+2/-2)
To merge this branch: bzr merge lp:~axino/charms/trusty/haproxy/fix-queue-depth-check
Reviewer Review Type Date Requested Status
Tom Haddon Approve
Review via email: mp+258896@code.launchpad.net

Description of the change

Fix the queue depth check fix in case multiple backend names begin the same way

Else, we have this error :
/usr/lib/nagios/plugins/check_haproxy_queue_depth.sh: line 22: [[: 0
0: syntax error in expression (error token is "0")

To post a comment you must log in.
Revision history for this message
Tom Haddon (mthaddon) wrote :

Looks good, thanks. Will merge.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'files/nrpe/check_haproxy_queue_depth.sh'
2--- files/nrpe/check_haproxy_queue_depth.sh 2014-07-22 21:13:48 +0000
3+++ files/nrpe/check_haproxy_queue_depth.sh 2015-05-12 15:16:25 +0000
4@@ -16,8 +16,8 @@
5
6 for BACKEND in $(echo $HAPROXYSTATS| xargs -n1 | grep BACKEND | awk -F , '{print $1}')
7 do
8- CURRQ=$(echo "$HAPROXYSTATS" | grep $BACKEND | grep BACKEND | cut -d , -f 3)
9- MAXQ=$(echo "$HAPROXYSTATS" | grep $BACKEND | grep BACKEND | cut -d , -f 4)
10+ CURRQ=$(echo "$HAPROXYSTATS" | grep ^$BACKEND, | grep BACKEND | cut -d , -f 3)
11+ MAXQ=$(echo "$HAPROXYSTATS" | grep ^$BACKEND, | grep BACKEND | cut -d , -f 4)
12
13 if [[ $CURRQ -gt $CURRQthrsh || $MAXQ -gt $MAXQthrsh ]] ; then
14 echo "CRITICAL: queue depth for $BACKEND - CURRENT:$CURRQ MAX:$MAXQ"

Subscribers

People subscribed via source and target branches

to all changes: