Skip to content

Commit

Permalink
Fix for multithreaded HAProxy (since HAProxy 1.8) (#404)
Browse files Browse the repository at this point in the history
For making the tcollector work with a multithreaded HAProxy, the pidof command should only get one PID. This is solved with the "-s" (Singleshot).
  • Loading branch information
kai-laufer authored and johann8384 committed Dec 4, 2018
1 parent 7b7ab7e commit f8117a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion collectors/0/haproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
def haproxy_pid():
"""Finds out the pid of haproxy process"""
try:
pid = subprocess.check_output(["pidof", "haproxy"])
pid = subprocess.check_output(["pidof", "-s", "haproxy"])
except subprocess.CalledProcessError:
return None
return pid.rstrip()
Expand Down

0 comments on commit f8117a7

Please sign in to comment.