Add "check_mysql_query" CheckCommand definition
authorChristian Birk <mail@birkc.de>
Mon, 8 Aug 2016 08:07:49 +0000 (10:07 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Mon, 8 Aug 2016 13:16:38 +0000 (15:16 +0200)
fixes #12314

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
AUTHORS
doc/7-icinga-template-library.md
itl/command-plugins.conf

diff --git a/AUTHORS b/AUTHORS
index ff7dcdee9314445ea0b912b98a0a70e85effab5c..7b5160520cfb65aacd37b9e75f2d8f581d036ca4 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -15,6 +15,7 @@ Brian De Wolf <git@bldewolf.com>
 Brian Dockter <specus@gmail.com>
 Bruno Lingner <mail@hugo.ro>
 Carlos Cesario <carloscesario@gmail.com>
+Christian Birk <mail@birkc.de>
 Christian Harke <ch.harke@gmail.com>
 Christian Jonak <christian@jonak.org>
 Christian Lehmann <christian_lehmann@gmx.de>
index c491b6e73f6079d973219e9343639e9b28c55382..5d3f8e335cc90497951439f38a05f927fbc9b171 100644 (file)
@@ -686,6 +686,27 @@ mysql_key          | **Optional.** Path to private SSL key.
 mysql_cadir            | **Optional.** Path to CA directory.
 mysql_ciphers          | **Optional.** List of valid SSL ciphers.
 
+
+### <a id="plugin-check-command-mysql-query"></a> mysql_query
+
+Check command object for the `check_mysql_query` plugin.
+
+Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters):
+
+Name                    | Description
+------------------------|---------------------------------------------------------------
+mysql_query_hostname    | **Optional.** Host name, IP Address, or unix socket (must be an absolute path).
+mysql_query_port        | **Optional.** Port number (default: 3306).
+mysql_query_database    | **Optional.** Check database with indicated name.
+mysql_query_file        | **Optional.** Read from the specified client options file.
+mysql_query_group       | **Optional.** Use a client options group.
+mysql_query_username    | **Optional.** Connect using the indicated username.
+mysql_query_password    | **Optional.** Use the indicated password to authenticate the connection.
+mysql_query_execute     | **Required.** SQL Query to run on the MySQL Server.
+mysql_query_warning     | **Optional.** Exit with WARNING status if query is outside of the range (format: start:end).
+mysql_query_critical    | **Optional.** Exit with CRITICAL status if query is outside of the range.
+
+
 ### <a id="plugin-check-command-negate"></a> negate
 
 Check command object for the `negate` plugin.
index b69ff1b9e4bad8a73ebc91b4f187351309c0c1b8..a1426d76e0acb469556542b1ea1dc21bbbb806a0 100644 (file)
@@ -2255,3 +2255,25 @@ object CheckCommand "game" {
                }
        }
 }
+
+object CheckCommand "mysql_query" {
+       import "plugin-check-command"
+       import "ipv4-or-ipv6"
+
+       command = [ PluginDir + "/check_mysql_query" ]
+
+       arguments = {
+               "-H" = "$mysql_query_hostname$"
+               "-P" = "$mysql_query_port$"
+               "-u" = "$mysql_query_username$"
+               "-p" = "$mysql_query_password$"
+               "-d" = "$mysql_query_database$"
+               "-f" = "$mysql_query_file$"
+               "-g" = "$mysql_query_group$"
+               "-q" = "$mysql_query_execute$"
+               "-w" = "$mysql_query_warning$"
+               "-c" = "$mysql_query_critical$"
+       }
+
+       vars.mysql_query_hostname = "$check_address$"
+}