opening haproxy.cfg with vim makes the nagios check fails

Bug #1828529 reported by Junien F
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
charm-haproxy
Fix Released
Medium
Junien F

Bug Description

The nagios check uses "grep -r", which has multiple matches if you open the haproxy.cfg file with vim :

$ sudo -u nagios /usr/lib/nagios/plugins/check_haproxy.sh
sudo: unable to resolve host juju-927c9f-prod-cdo-kubernetes-10
Enter host password for user 'matches':

$ grep -r "stats auth" /etc/haproxy | head -1 | awk '{print $4}'
matches

$ grep -r "stats auth" /etc/haproxy
Binary file /etc/haproxy/.haproxy.cfg.swp matches
/etc/haproxy/haproxy.cfg: stats auth haproxy:y7fy4hGJHGp9TzfLwqhV

The grep should probably ignore files starting with a dot.

Junien F (axino)
Changed in charm-haproxy:
importance: Undecided → Medium
assignee: nobody → Junien Fridrick (axino)
status: New → In Progress
Junien F (axino)
Changed in charm-haproxy:
status: In Progress → Fix Committed
Junien F (axino)
Changed in charm-haproxy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.