]> granicus.if.org Git - icinga2/commitdiff
Add haproxy CheckCommand definition 6852/head
authorBarbUk <julien.virey@gmail.com>
Thu, 20 Dec 2018 10:39:15 +0000 (14:39 +0400)
committerBarbUk <julien.virey@gmail.com>
Thu, 20 Dec 2018 10:54:53 +0000 (14:54 +0400)
Haproxy plugin check haproxy csv statistics page and reports response
time and backends sessions count

doc/10-icinga-template-library.md
itl/plugins-contrib.d/web.conf

index 3ff76f7f40fb92a554b11bc133f25614d95d0e03..17e9c1e0d8ac1d00c663c7bfe9f67a9906676ffa 100644 (file)
@@ -5388,3 +5388,29 @@ uptime                  | How long the cache has been running (in seconds)
 ratio                   | The cache hit ratio expressed as a percentage of hits to hits + misses.  Default thresholds are 95 and 90.
 usage                   | Cache file usage as a percentage of the total cache space.
 
+#### haproxy <a id="plugin-contrib-command-haproxy"></a>
+
+The [check_haproxy](https://salsa.debian.org/nagios-team/pkg-nagios-plugins-contrib/blob/master/check_haproxy/check_haproxy) plugin,
+also available in the [monitoring-plugins-contrib](https://packages.debian.org/nagios-plugins-contrib) on debian,
+uses the `haproxy` csv statistics page to monitor [haproxy](http://www.haproxy.org/) response time. The plugin outputa performance data for backends sessions and statistics response time.
+
+This plugin need to access the csv statistics page. You can configure it in haproxy by adding a new frontend:
+```
+frontend stats
+    bind 127.0.0.1:80
+    stats enablestats
+    stats uri /stats
+```
+
+The statistics page will be available at `http://127.0.0.1/stats;csv;norefresh`.
+
+Custom attributes passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
+
+Name                    | Description
+------------------------|----------------------------------------------------------------------------------
+haproxy_username        | **Optional.** Username for HTTP Auth
+haproxy_password        | **Optional.** Password for HTTP Auth
+haproxy_url             | **Required.** URL of the HAProxy csv statistics page.
+haproxy_timeout         | **Optional.** Seconds before plugin times out (default: 10)
+haproxy_warning         | **Optional.** Warning request time threshold (in seconds)
+haproxy_critical        | **Optional.** Critical request time threshold (in seconds)
index 458de5a5700a7a1946ab23d266f43b97f117ea61..73266e3b1f75fd2aab5091f39c763bd1a669bc6d 100644 (file)
@@ -586,3 +586,35 @@ object CheckCommand "varnish" {
        }
 }
 
+object CheckCommand "haproxy" {
+       import "plugin-check-command"
+       command = [ PluginDir + "/check_haproxy" ]
+
+       arguments = {
+               "--username" = {
+                       value = "$haproxy_username$"
+                       description = "Username for HTTP Auth"
+               }
+               "--password" = {
+                       value = "$haproxy_password$"
+                       description = "Password for HTTP Auth"
+               }
+               "--url" = {
+                       value = "$haproxy_url$"
+                       description = "URL of the HAProxy csv statistics page"
+                       required = true
+               }
+               "--timeout" = {
+                       value = "$haproxy_timeout$"
+                       description = "Seconds before plugin times out (default: 10)"
+               }
+               "-w" = {
+                       value = "$haproxy_warning$"
+                       description = "Warning request time threshold (in seconds)"
+               }
+               "-c" = {
+                       value = "$haproxy_critical$"
+                       description = "Critical request time threshold (in seconds)"
+               }
+       }
+}