Merge pull request #9197 from maggu/feature/db-extra-opts

ITL: Add --extra-opts parameter to the mysql and pgsql CheckCommand d…
This commit is contained in:
Alexander Aleksandrovič Klimov 2022-02-03 11:29:03 +01:00 committed by GitHub
commit d0c7dc86e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -796,6 +796,7 @@ Custom variables passed as [command parameters](03-monitoring-basics.md#command-
Name | Description
------------------------|---------------------------------------------------------------
mysql_extra_opts | **Optional.** Read options from an ini file.
mysql_hostname | **Optional.** Host name, IP Address, or unix socket (must be an absolute path).
mysql_port | **Optional.** Port number (default: 3306).
mysql_socket | **Optional.** Use the specified socket (has no effect if `mysql_hostname` is used).
@ -971,6 +972,7 @@ Custom variables passed as [command parameters](03-monitoring-basics.md#command-
Name | Description
------------------------|---------------------------------------------------------------
pgsql_extra_opts | **Optional.** Read options from an ini file.
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).

View File

@ -2667,6 +2667,10 @@ object CheckCommand "pgsql" {
command = [ PluginDir + "/check_pgsql" ]
arguments = {
"--extra-opts" = {
value = "$pgsql_extra_opts$"
description = "Read options from an ini file"
}
"-H" = {
value = "$pgsql_hostname$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
@ -2726,6 +2730,10 @@ object CheckCommand "mysql" {
command = [ PluginDir + "/check_mysql" ]
arguments = {
"--extra-opts" = {
value = "$mysql_extra_opts$"
description = "Read options from an ini file"
}
"-H" = {
set_if = {{ !macro("$mysql_socket$") }}
value = "$mysql_hostname$"