]> granicus.if.org Git - icinga2/commitdiff
Add check command nginx_status
authorBastian Guse <bguse@nocopy.de>
Thu, 15 Oct 2015 13:04:38 +0000 (15:04 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 26 Oct 2015 08:51:16 +0000 (09:51 +0100)
fixes #10374

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
doc/7-icinga-template-library.md
itl/plugins-contrib.d/web.conf

index 45a088fa334a989accf21161ba4404438cce920c..f52d4b51bf8eff98fa087fe7fe86593498752485 100644 (file)
@@ -1923,6 +1923,28 @@ squid_client             | **Optional.** Path of squidclient (default: /usr/bin/squidclient
 squid_timeout          | **Optional.** Seconds before plugin times out (default: 15).
 
 
+### <a id="plugins-contrib-nginx_status"></a> nginx_status
+
+Plugin for monitoring [nginx_status](https://github.com/regilero/check_nginx_status).
+
+Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters):
+
+Name                    | Description
+------------------------|----------------------------------------------------------------------------------
+nginx_status_host_address              | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, `address6` otherwise.
+nginx_status_port              | **Optional.** the http port.
+nginx_status_url               | **Optional.** URL to use, instead of the default (http://`nginx_status_hostname`/nginx_status).
+nginx_status_servername                | **Optional.** ServerName to use if you specified an IP to match the good Virtualhost in your target
+nginx_status_ssl               | **Optional.** set to use ssl connection
+nginx_status_disable_sslverify         | **Optional.** set to disable SSL hostname verification
+nginx_status_user              | **Optional.** Username for basic auth
+nginx_status_pass              | **Optional.** Password for basic auth
+nginx_status_realm             | **Optional.** Realm for basic auth
+nginx_status_maxreach          | **Optional.** Number of max processes reached (since last check) that should trigger an alert
+nginx_status_timeout           | **Optional.** timeout in seconds
+nginx_status_warn              | **Optional.** Warning threshold (number of active connections, ReqPerSec or ConnPerSec that will cause a WARNING) like '10000,100,200'.
+nginx_status_critical          | **Optional.** Critical threshold (number of active connections, ReqPerSec or ConnPerSec that will cause a CRITICAL) like '20000,200,300'.
+
 ## <a id="plugins-contrib-operating-system"></a> Operating System
 
 In this category you can find plugins for gathering information about your operating system or the system beneath like memory usage.
index 17cfc421aa4a7d288c91468edc3963a6052d54e2..6deb930dc9897810335c9f697280aff4da9c7d54 100644 (file)
@@ -248,3 +248,72 @@ object CheckCommand "squid" {
        vars.squid_hostname = "$check_address$"
        vars.squid_client = "/usr/bin/squidclient"
 }
+
+object CheckCommand "nginx_status" {
+               import "plugin-check-command"
+               import "ipv4-or-ipv6"
+
+               command = [ PluginContribDir + "/check_nginx_status.pl" ]
+
+               arguments = {
+                               "--hostname" = {
+                                               value = "$nginx_status_host_address$"
+                                               description = "name or IP address of host to check"
+                               }
+                               "--port" = {
+                                               value = "$nginx_status_port$"
+                                               description = "the http port"
+                               }
+                               "--url" = {
+                                               value = "$nginx_status_url$"
+                                               description = "Specific URL to use, instead of the default 'http://<nginx_status_hostname>/nginx_status'"
+                               }
+                               "--servername" = {
+                                               value = "$nginx_status_servername$"
+                                               description = "ServerName, use it if you specified an IP in -H to match the good Virtualhost in your target"
+                               }
+                               "--ssl" = {
+                                               set_if = "$nginx_status_ssl$"
+                                               description = "Wether we should use HTTPS instead of HTTP"
+                               }
+                               "--disable-sslverifyhostname" = {
+                                               set_if = "$nginx_status_disable_sslverify$"
+                                               description = "Disable SSL hostname verification"
+                               }
+                               "--user" = {
+                                               value = "$nginx_status_user$"
+                                               description = "Username for basic auth"
+                               }
+                               "--pass" = {
+                                               value = "$nginx_status_pass$"
+                                               description = "Password for basic auth"
+                               }
+                               "--realm" = {
+                                               value = "$nginx_status_realm$"
+                                               description = "Realm for basic auth"
+                               }
+                               "--maxreach" = {
+                                               value = "$nginx_status_maxreach$"
+                                               description = "Number of max processes reached (since last check) that should trigger an alert"
+                               }
+                               "--timeout" = {
+                                               value = "$nginx_status_timeout$"
+                                               description = "timeout in seconds"
+                               }
+                               "--warn" = {
+                                               value = "$nginx_status_warn$"
+                                               description = "number of active connections, ReqPerSec or ConnPerSec that will cause a WARNING"
+                               }
+                               "--critical" = {
+                                               value = "$nginx_status_critical$"
+                                               description = "number of active connections, ReqPerSec or ConnPerSec that will cause a CRITICAL"
+                               }
+               }
+
+               vars.nginx_status_host_address = "$check_address$"
+               vars.nginx_status_ssl = false
+               vars.nginx_status_disable_sslverify = false
+               vars.nginx_status_warn = "10000,100,200"
+               vars.nginx_status_critical = "20000,200,300"
+               vars.nginx_status_timeout = 15
+}