Add "check_mysql_query" CheckCommand definition

fixes #12314

Signed-off-by: Gunnar Beutner <gunnar.beutner@netways.de>
This commit is contained in:
Christian Birk 2016-08-08 10:07:49 +02:00 committed by Gunnar Beutner
parent 1beef64dc4
commit 98a97026f4
3 changed files with 44 additions and 0 deletions

View File

@ -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>

View 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.

View 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$"
}