From 2e462d63a4a8465aee0cea3a2e7b11c2837d8e60 Mon Sep 17 00:00:00 2001 From: BarbUk Date: Tue, 27 Nov 2018 19:22:36 +0400 Subject: [PATCH 1/3] Add varnish CheckCommand definition This definition use check_varnish to monitore a varnish instance. This closes #5122 --- doc/10-icinga-template-library.md | 15 +++++++++++++++ itl/plugins-contrib.d/web.conf | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 103410d2d..7887d24dd 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -5344,3 +5344,18 @@ webinject_no_output | **Optional.** Suppresses all output to STDOUT except t webinject_timeout | **Optional.** The value [given in seconds] will be compared to the global time elapsed to run all the tests. If the tests have all been successful, but have taken more time than the 'globaltimeout' value, a warning message is sent back to Icinga. webinject_report_type | **Optional.** This setting is used to enable output formatting that is compatible for use with specific external programs. The available values you can set this to are: nagios, mrtg, external and standard. webinject_testcase_file | **Optional.** When you launch WebInject in console mode, you can optionally supply an argument for a testcase file to run. It will look for this file in the directory that webinject.pl resides in. If no filename is passed from the command line, it will look in config.xml for testcasefile declarations. If no files are specified, it will look for a default file named 'testcases.xml' in the current [webinject] directory. If none of these are found, the engine will stop and give you an error. + +#### varnish + +The [check_varnish](https://github.com/varnish/varnish-nagios) plugin, +also available in the [monitoring-plugins-contrib](https://packages.debian.org/sid/nagios-plugins-contrib) on debian, +uses the `varnishstat` binary to monitor [varnish](https://varnish-cache.org/). + +Custom attributes passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|---------------------------------------------------------------------------------- +varnish_name | **Optional.** Specify the Varnish instance name +varnish_param | **Optional.** Specify the parameter to check (see below). The default is 'ratio'. +varnish_critical | **Optional.** Set critical threshold: [@][lo:]hi +varnish_warning | **Optional.** Set warning threshold: [@][lo:]hi diff --git a/itl/plugins-contrib.d/web.conf b/itl/plugins-contrib.d/web.conf index 0f5daac48..a5784963b 100644 --- a/itl/plugins-contrib.d/web.conf +++ b/itl/plugins-contrib.d/web.conf @@ -561,3 +561,28 @@ object CheckCommand "ssl_cert" { vars.ssl_cert_address = "$check_address$" vars.ssl_cert_port = 443 } + +object CheckCommand "varnish" { + import "plugin-check-command" + command = [ PluginDir + "/check_varnish" ] + + arguments = { + "-n" = { + value = "$varnish_name$" + description = "Specify the Varnish instance name" + } + "-p" = { + value = "$varnish_param$" + description = "Specify the parameter to check (see below). The default is 'ratio'." + } + "-c" = { + value = "$varnish_critical$" + description = "Set critical threshold: [@][lo:]hi" + } + "-w" = { + value = "$varnish_warning$" + description = "Set warning threshold: [@][lo:]hi" + } + } +} + From 42cbd365bf42ec624f8ccfb1d29b0dedffcc8821 Mon Sep 17 00:00:00 2001 From: BarbUk Date: Tue, 27 Nov 2018 19:35:58 +0400 Subject: [PATCH 2/3] Add more info about varnish_param --- doc/10-icinga-template-library.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 7887d24dd..388817d2d 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -5359,3 +5359,14 @@ varnish_name | **Optional.** Specify the Varnish instance name varnish_param | **Optional.** Specify the parameter to check (see below). The default is 'ratio'. varnish_critical | **Optional.** Set critical threshold: [@][lo:]hi varnish_warning | **Optional.** Set warning threshold: [@][lo:]hi + +For *varnish_param*, all items reported by varnishstat(1) are available - use the +identifier listed in the left column by `varnishstat -l`. In +addition, the following parameters are available: + +Name | Description +------------------------|---------------------------------------------------------------------------------- +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. + From 9d1a6d74928acbe536405c6179918653081598bd Mon Sep 17 00:00:00 2001 From: BarbUk Date: Fri, 30 Nov 2018 00:36:06 +0400 Subject: [PATCH 3/3] Indentation: space to tab --- itl/plugins-contrib.d/web.conf | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/itl/plugins-contrib.d/web.conf b/itl/plugins-contrib.d/web.conf index a5784963b..458de5a57 100644 --- a/itl/plugins-contrib.d/web.conf +++ b/itl/plugins-contrib.d/web.conf @@ -563,26 +563,26 @@ object CheckCommand "ssl_cert" { } object CheckCommand "varnish" { - import "plugin-check-command" - command = [ PluginDir + "/check_varnish" ] + import "plugin-check-command" + command = [ PluginDir + "/check_varnish" ] - arguments = { - "-n" = { - value = "$varnish_name$" - description = "Specify the Varnish instance name" - } - "-p" = { - value = "$varnish_param$" - description = "Specify the parameter to check (see below). The default is 'ratio'." - } - "-c" = { - value = "$varnish_critical$" - description = "Set critical threshold: [@][lo:]hi" - } - "-w" = { - value = "$varnish_warning$" - description = "Set warning threshold: [@][lo:]hi" - } - } + arguments = { + "-n" = { + value = "$varnish_name$" + description = "Specify the Varnish instance name" + } + "-p" = { + value = "$varnish_param$" + description = "Specify the parameter to check (see below). The default is 'ratio'." + } + "-c" = { + value = "$varnish_critical$" + description = "Set critical threshold: [@][lo:]hi" + } + "-w" = { + value = "$varnish_warning$" + description = "Set warning threshold: [@][lo:]hi" + } + } }