From 442144d0e634a7af62e5514ef7e14b66385de5b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Jeanneret?= Date: Fri, 16 Nov 2018 15:11:32 +0100 Subject: [PATCH] Allow to collect HAProxy stats and log them in a file Getting HAProxy stats about its backends and health will help when we have issues with timeouts and the like. Closes-Bug: #1803716 Change-Id: Ic787f4ac32bf53c4409d8fd058a976fbb552cb94 --- roles/collect-logs/tasks/collect.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/roles/collect-logs/tasks/collect.yml b/roles/collect-logs/tasks/collect.yml index 521d50e..3cb2dfc 100644 --- a/roles/collect-logs/tasks/collect.yml +++ b/roles/collect-logs/tasks/collect.yml @@ -8,6 +8,7 @@ name: - gzip - rsync + - socat - tar - name: Prepare directory with extra logs @@ -92,6 +93,13 @@ nova list &> /var/log/extra/nova_list.txt; fi + - name: Get haproxy stats + shell: > + pgrep haproxy && \ + test -S /var/lib/haproxy/stats && \ + echo 'show info;show stat;show table' | socat /var/lib/haproxy/stats stdio &> /var/log/extra/haproxy-stats.txt || \ + echo "No HAProxy or no socket on host" > /var/log/extra/haproxy-stats.txt + - name: lsmod shell: "lsmod &> /var/log/extra/lsmod.txt"