]> granicus.if.org Git - icinga2/commitdiff
ITL: Add query option to check_postgres
authorAndres Ivanov <andres@andres.wtf>
Tue, 23 Feb 2016 07:44:30 +0000 (09:44 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Fri, 11 Mar 2016 14:24:57 +0000 (15:24 +0100)
There were "query", "valtype" and "reverse" options missing
for "custom_query" action type in check_postgres plugin.

fixes #11205

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

index 943942bca32c559eb1af2d05428641948066fc0b..0f7083b5ed2f205d75a5bf0d2f3c6ca960a5052f 100644 (file)
@@ -1721,6 +1721,9 @@ postgres_standby     | **Optional.** Assume that the server is in continious WAL
 postgres_production  | **Optional.** Assume that the server is in production mode if set to true. Defaults to false.
 postgres_action      | **Required.** Determines the test executed.
 postgres_unixsocket  | **Optional.** If "postgres_unixsocket" is set to true the unix socket is used instead of an address. Defaults to false.
+postgres_query       | **Optional.** Query for "custom_query" action.
+postgres_valtype     | **Optional.** Value type of query result for "custom_query".
+postgres_reverse     | **Optional.** If "postgres_reverse" is set, warning and critical values are reversed for "custom_query" action.
 
 #### <a id="plugins-contrib-command-mongodb"></a> mongodb
 
index fc40093ca6f991abec4a0addcbfcf6030ed27576..adf9a14a9bde2c968e2a06c36a4fe15bb1a36383 100644 (file)
@@ -296,6 +296,18 @@ object CheckCommand "postgres" {
                        value = "$postgres_action$"
                        description = "determines the test executed"
                }
+               "--query" = {
+                       value = "$postgres_query$"
+                       description = "query for custom_query action"
+               }
+               "--valtype" = {
+                       value = "$postgres_valtype$"
+                       description = "determines the result type for custom_query action"
+               }
+               "--reverse" = {
+                       set_if = "$postgres_reverse$"
+                       description = "reverses warning and critical for custom_query action"
+               }
        }
 
        vars.postgres_host = "$check_address$"