[icinga-checkins] icinga.org: icinga2/master: Add "check_mysql_query" CheckCommand definition

git at icinga.org git at icinga.org
Mon Aug 8 15:16:54 CEST 2016


Module: icinga2
Branch: master
Commit: 98a97026f4fb63749ca6632a9527d46fd6f224ec
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=98a97026f4fb63749ca6632a9527d46fd6f224ec

Author: Christian Birk <mail at birkc.de>
Date:   Mon Aug  8 10:07:49 2016 +0200

Add "check_mysql_query" CheckCommand definition

fixes #12314

Signed-off-by: Gunnar Beutner <gunnar.beutner at netways.de>

---

 AUTHORS                          |    1 +
 doc/7-icinga-template-library.md |   21 +++++++++++++++++++++
 itl/command-plugins.conf         |   22 ++++++++++++++++++++++
 3 files changed, 44 insertions(+)

diff --git a/AUTHORS b/AUTHORS
index ff7dcde..7b51605 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -15,6 +15,7 @@ Brian De Wolf <git at bldewolf.com>
 Brian Dockter <specus at gmail.com>
 Bruno Lingner <mail at hugo.ro>
 Carlos Cesario <carloscesario at gmail.com>
+Christian Birk <mail at birkc.de>
 Christian Harke <ch.harke at gmail.com>
 Christian Jonak <christian at jonak.org>
 Christian Lehmann <christian_lehmann at gmx.de>
diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md
index c491b6e..5d3f8e3 100644
--- a/doc/7-icinga-template-library.md
+++ b/doc/7-icinga-template-library.md
@@ -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.
diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf
index b69ff1b..a1426d7 100644
--- a/itl/command-plugins.conf
+++ b/itl/command-plugins.conf
@@ -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$"
+}



More information about the icinga-checkins mailing list