Module: check_mk
Branch: master
Commit: 5dec65a23ac46acf3dd918fa207aa3fd1353ec93
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5dec65a23ac46a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 8 10:11:53 2019 +0100
7021 haproxy: Add agent implementation to standard linux agent
Change-Id: I9c9f2665535db4e1b2a39ce297fafed24497c98b
---
.werks/7021 | 10 ++++++++++
agents/check_mk_agent.linux | 5 +++++
checkman/haproxy.frontend | 5 +++--
checkman/haproxy.server | 5 +++--
4 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/.werks/7021 b/.werks/7021
new file mode 100644
index 0000000..bf3de05
--- /dev/null
+++ b/.werks/7021
@@ -0,0 +1,10 @@
+Title: haproxy: Add agent implementation to standard linux agent
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1546938683
+Class: feature
+
+
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 4f81e61..8e895b0 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -1032,6 +1032,11 @@ if type pvecm > /dev/null 2>&1 ; then
pvecm nodes
fi
+if [ -r /run/haproxy/admin.sock ] && type socat >/dev/null 2>&1; then
+ echo "<<<haproxy:sep(44)>>>"
+ echo "show stat" | socat - UNIX-CONNECT:/run/haproxy/admin.sock
+fi
+
# Start new liveupdate process in background on each agent execution. Starting
# a new live update process will terminate the old one automatically after
# max. 1 sec.
diff --git a/checkman/haproxy.frontend b/checkman/haproxy.frontend
index a315c24..170de44 100644
--- a/checkman/haproxy.frontend
+++ b/checkman/haproxy.frontend
@@ -1,5 +1,5 @@
title: HAProxy: Status of the Frontends
-agents: freebsd
+agents: freebsd linux
catalog: hw/app/haproxy
license: GPL
distribution: check_mk
@@ -7,7 +7,8 @@ description:
This check monitors the status of the frontends of the HAProxy loadbalancer
for TCP and HTTP connections. It requires the mk_haproxy.freebsd agent plugin
- to be installed on the FreeBSD host to be monitored.
+ to be installed on the FreeBSD host to be monitored. On linux it works with the
+ standard agent.
The check is {OK} if the frontend has the status {OPEN}. It is {CRIT}
otherwise.
diff --git a/checkman/haproxy.server b/checkman/haproxy.server
index 2bba86a..1d4ecd0 100644
--- a/checkman/haproxy.server
+++ b/checkman/haproxy.server
@@ -1,5 +1,5 @@
title: HAProxy: Server Status
-agents: freebsd
+agents: freebsd linux
catalog: hw/app/haproxy
license: GPL
distribution: check_mk
@@ -7,7 +7,8 @@ description:
This check monitors the status of the servers of the HAProxy loadbalancer
for TCP and HTTP connections. It requires the mk_haproxy.freebsd agent
- plugin to be installed on the FreeBSD host to be monitored.
+ plugin to be installed on the FreeBSD host to be monitored. On linux it
+ works with the standard agent.
The check is {OK} if the server indicates the status {UP} and either {active}
or {backup}. It is {CRIT} otherwise.