]> granicus.if.org Git - icinga2/commitdiff
Add check command mysql
authorLennart Betz <lennart.betz@netways.de>
Sun, 1 Nov 2015 12:26:01 +0000 (13:26 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Sun, 1 Nov 2015 12:55:15 +0000 (13:55 +0100)
fixes #10511

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

index 79bdd7b81cf74754e010b98f92a03b776d37a860..acd52100d914f8e503a6a4db3bf1d4344ce119c1 100644 (file)
@@ -987,6 +987,33 @@ pgsql_query_warning        | **Optional.** SQL query value to result in warning status
 pgsql_query_critical   | **Optional.** SQL query value to result in critical status (double).
 
 
+### <a id="plugin-check-command-mysql"></a> mysql
+
+Check command object for the `check_mysql` plugin.
+
+Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters):
+
+Name                   | Description
+------------------------|---------------------------------------------------------------
+mysql_hostname         | **Optional.** Host name, IP Address, or unix socket (must be an absolute path).
+mysql_port             | **Optional.** Port number (default: 3306).
+mysql_ignore_auth      | **Optional.** Ignore authentication failure and check for mysql connectivity only.
+mysql_database         | **Optional.** Check database with indicated name.
+mysql_file             | **Optional.** Read from the specified client options file.
+mysql_group            | **Optional.** Use a client options group.
+mysql_username         | **Optional.** Connect using the indicated username.
+mysql_password         | **Optional.** Use the indicated password to authenticate the connection.
+mysql_check_slave      | **Optional.** Check if the slave thread is running properly.
+mysql_warning          | **Optional.** Exit with WARNING status if slave server is more than INTEGER seconds behind master.
+mysql_critical         | **Optional.** Exit with CRITICAL status if slave server is more then INTEGER seconds behind master.
+mysql_ssl              | **Optional.** Use ssl encryptation.
+mysql_cacert           | **Optional.** Path to CA signing the cert.
+mysql_cert             | **Optional.** Path to SSL certificate.
+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="windows-plugins"></a> Windows Plugins for Icinga 2
 
 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 a46580b689b2850af0a85f6b20e51ed9c25e6fec..06931b3ef708be95ad00f47631f95dfdbc8e43bd 100644 (file)
@@ -1667,3 +1667,38 @@ object CheckCommand "pgsql" {
        vars.pgsql_hostname = "$check_address$"
 }
 
+object CheckCommand "mysql" {
+       import "plugin-check-command"
+       import "ipv4-or-ipv6"
+
+       command = [ PluginDir + "/check_mysql" ]
+
+       arguments = {
+               "-H" = "$mysql_hostname$"
+               "-P" = "$mysql_port$"
+               "-n" = {
+                       set_if = "$mysql_ignore_auth$"
+               }
+               "-s" = "$mysql_socket$"
+               "-d" = "$mysql_database$"
+               "-f" = "$mysql_file$"
+               "-g" = "$mysql_group$"
+               "-u" = "$mysql_username$"
+               "-p" = "$mysql_password$"
+               "-S" = {
+                       set_if = "$mysql_check_slave$"
+               }
+               "-w" = "$mysql_warning$"
+               "-c" = "$mysql_critical$"
+               "-l" = {
+                       set_if = "$mysql_ssl$"
+               }
+               "-C" = "$mysql_cacert$"
+               "-a" = "$mysql_cert$"
+               "-k" = "$mysql_key$"
+               "-D" = "$mysql_cadir$"
+               "-L" = "$mysql_ciphers$"
+       }
+
+       vars.mysql_hostname = "$check_address$"
+}