From f45416ffa1804e1cb9809f3650c9a296f8fa5eb2 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Fri, 28 Jul 2023 10:23:28 +0200
Subject: [PATCH] haproxy_health: add doc page

---
 docs/20_Checks/_index.md               |  2 +-
 docs/20_Checks/check_haproxy_health.md | 66 ++++++++++++++++++++++++++
 2 files changed, 67 insertions(+), 1 deletion(-)
 create mode 100644 docs/20_Checks/check_haproxy_health.md

diff --git a/docs/20_Checks/_index.md b/docs/20_Checks/_index.md
index b5f91e8..081c6c2 100644
--- a/docs/20_Checks/_index.md
+++ b/docs/20_Checks/_index.md
@@ -22,7 +22,7 @@ There is one include script used by all checks:
 * [check_eol](check_eol.md)
 * [check_fs_errors](check_fs_errors.md)
 * [check_fs_writable](check_fs_writable.md)
-* check_haproxy_health
+* [check_haproxy_health](check_haproxy_health.md)
 * check_haproxy_status
 * check_memory
 * check_mysqlserver
diff --git a/docs/20_Checks/check_haproxy_health.md b/docs/20_Checks/check_haproxy_health.md
new file mode 100644
index 0000000..5193c0f
--- /dev/null
+++ b/docs/20_Checks/check_haproxy_health.md
@@ -0,0 +1,66 @@
+# Check filesystem errors
+
+## Introduction
+
+**check_haproxy_health** checks if kernel logs inconsistency messages in the journallog.
+It requires sudo permission on /bin/journalctl
+
+If it would find error messages it switches to critical and shows the found journallog entries.
+
+## Requirements
+
+* sudo permission on /bin/journalctl to scan for the information
+
+```txt
+icingaclient ALL=(ALL) NOPASSWD: /bin/journalctl
+```
+
+## Syntax
+
+```txt
+______________________________________________________________________
+
+CHECK_HAPROXY_HEALTH
+v1.6
+
+(c) Institute for Medical Education - University of Bern
+Licence: GNU GPL 3
+
+https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_haproxy_health.html
+______________________________________________________________________
+
+Check HA Proxy health.
+The plugin reads /etc/haproxy/haproxy.cfg to detect required status url. 
+It requires wget to handle the http request.
+
+Non OK values occur:
+  UNKNOWN - if /etc/haproxy/haproxy.cfg cannot be read
+          - haproxy is not in http mode
+          - the detected status url doesn't send a response
+  ERROR - the detected status url did not respond with Http status 
+          code 200
+
+SYNTAX:
+check_haproxy_health [-h]
+
+OPTIONS:
+
+    -h or --help   show this help.
+
+EXAMPLE:
+
+    check_haproxy_health
+
+```
+
+### Parameters
+
+(none)
+
+## Examples
+
+`$ check_haproxy_health` returns
+
+```txt
+OK: HA Proxy http://localhost:8080/_haproxy_health_check is up and running.
+```
-- 
GitLab