]> granicus.if.org Git - icinga2/commitdiff
add check command for plugin check_pgsql
authorLennart Betz <lennart.betz@netways.de>
Sat, 12 Sep 2015 18:15:36 +0000 (20:15 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Mon, 14 Sep 2015 08:14:03 +0000 (10:14 +0200)
fixes #10112

Signed-off-by: Michael Friedrich <michael.friedrich@netways.de>
doc/7-icinga-template-library.md
itl/command-plugins.conf

index a0f7aa366b95ba101c41ca05bf4c89cccef0d2d0..348817c5c5f83863d6257941ca6a6016050e2c22 100644 (file)
@@ -945,6 +945,28 @@ mailq_timeout              | **Optional.** Plugin timeout in seconds (default = 15).
 mailq_servertype       | **Optional.** [ sendmail | qmail | postfix | exim | nullmailer ] (default = autodetect).
 
 
+## <a id="plugin-check-command-pgsql"></a> pgsql
+
+Check command object for the `check_pgsql` plugin.
+
+Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters):
+
+Name                   | Description
+------------------------|---------------------------------------------------------------
+pgsql_hostname         | **Optional.** Host name, IP Address, or unix socket (must be an absolute path). 
+pgsql_port             | **Optional.** Port number (default: 5432).
+pgsql_database         | **Optional.** Database to check (default: template1).
+pgsql_username         | **Optional.** Login name of user.
+pgsql_password         | **Optional.** Password (BIG SECURITY ISSUE).
+pgsql_options          | **Optional.** Connection parameters (keyword = value), see below.
+pgsql_warning          | **Optional.** Response time to result in warning status (seconds).
+pgsql_critical         | **Optional.** Response time to result in critical status (seconds).
+pgsql_timeout          | **Optional.** Seconds before connection times out (default: 10).
+pgsql_query            | **Optional.** SQL query to run. Only first column in first row will be read.
+pgsql_query_warning    | **Optional.** SQL query value to result in warning status (double).
+pgsql_query_critical   | **Optional.** SQL query value to result in critical status (double).
+
+
 # <a id="windows-plugins"></a>Icinga 2 Windows plugins
 
 To allow a basic monitoring of Windows clients Icinga 2 comes with a set of Windows only plugins. While trying to mirror the functionalities of their linux cousins from the monitoring-plugins package, the differences between Windows and Linux are too big to be able use the same CheckCommands for both systems.
index 0066e86b18b1591e2471e98f946aa3d5d61bd511..220198b57863595a00d0cfcbb399ca699c6cbb7e 100644 (file)
@@ -1620,3 +1620,28 @@ object CheckCommand "mailq" {
                }
        }
 }
+
+object CheckCommand "pgsql" {
+       import "plugin-check-command"
+       import "ipv4-or-ipv6"
+
+       command = [ PluginDir + "/check_pgsql" ]
+
+       arguments = {
+               "-H" = "$pgsql_hostname$"
+               "-P" = "$pgsql_port$"
+               "-d" = "$pgsql_database$"
+               "-l" = "$pgsql_username$"
+               "-p" = "$pgsql_password$"
+               "-o" = "$pgsql_options$"
+               "-w" = "$pgsql_warning$"
+               "-c" = "$pgsql_critical$"
+               "-t" = "$pgsql_timeout$"
+               "-q" = "$pgsql_query$"
+               "-W" = "$pgsql_query_warning$"
+               "-C" = "$pgsql_query_critical$"
+       }
+
+       vars.pgsql_hostname = "$check_address$"
+}
+