Merge pull request #6852 from BarbUk/feature/itl-check-haproxy

Add haproxy CheckCommand definition
This commit is contained in:
Michael Friedrich 2018-12-21 12:05:30 +01:00 committed by GitHub
commit f7393352f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 0 deletions

View File

@ -5389,3 +5389,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. 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. 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)

View 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)"
}
}
}