From a9b6b1dba0b28270301e54ea00064aa8a00c797a Mon Sep 17 00:00:00 2001 From: C C Magnus Gustavsson Date: Mon, 31 Jan 2022 11:11:00 +0100 Subject: [PATCH] ITL: Add --extra-opts parameter to the mysql and pgsql CheckCommand definitions --- doc/10-icinga-template-library.md | 2 ++ itl/command-plugins.conf | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 8d5ddd2fa..ed5dc09c0 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -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). diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 02ae3cb20..6d5d83da2 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -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$"