]> granicus.if.org Git - icinga2/commitdiff
Add arguments to "tcp" CheckCommand
authorTobias von der Krone <tobias.vonderkrone@profitbricks.com>
Wed, 22 Apr 2015 07:15:58 +0000 (09:15 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 27 Apr 2015 09:27:51 +0000 (11:27 +0200)
fixes #9147

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
doc/7-icinga-template-library.md
itl/command-plugins.conf

index da80de1bf7f0dd73c61d1e9211031a44724a9310..e2d6fe3b085b751197eca9045a95f00589d412c8 100644 (file)
@@ -745,6 +745,22 @@ Name            | Description
 ----------------|--------------
 tcp_address     | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
 tcp_port        | **Required.** The port that should be checked.
+tcp_expect      | **Optional.** String to expect in server response (may be repeated).
+tcp_all         | **Optional.** All expect strings need to occur in server response. Defaults to false.
+tcp_escape_send | **Optional.** Enable usage of \n, \r, \t or \\\\ in send string.
+tcp_send        | **Optional.** String to send to the server.
+tcp_escape_quit | **Optional.** Enable usage of \n, \r, \t or \\\\ in quit string.
+tcp_quit        | **Optional.** String to send server to initiate a clean close of the connection.
+tcp_refuse      | **Optional.** Accept TCP refusals with states ok, warn, crit. Defaults to crit.
+tcp_mismatch    | **Optional.** Accept expected string mismatches with states ok, warn, crit. Defaults to warn.
+tcp_jail        | **Optional.** Hide output from TCP socket.
+tcp_maxbytes    | **Optional.** Close connection once more than this number of bytes are received.
+tcp_delay       | **Optional.** Seconds to wait between sending string and polling for response.
+tcp_certificate | **Optional.** Minimum number of days a certificate has to be valid. 1st value is number of days for warning, 2nd is critical (if not specified: 0) - seperated by comma.
+tcp_ssl         | **Optional.** Use SSL for the connection. Defaults to false.
+tcp_wtime       | **Optional.** Response time to result in warning status (seconds).
+tcp_ctime       | **Optional.** Response time to result in critical status (seconds).
+tcp_timeout     | **Optional.** Seconds before connection times out. Defaults to 10.
 
 
 ## <a id="plugin-check-command-udp"></a> udp
index 4c30ae10f2e20b0835b1b0d4b60c108913d1caf5..534b3a6e12cd073f7a19ecb5adc623d88483e2ba 100644 (file)
@@ -162,13 +162,94 @@ object CheckCommand "tcp" {
        import "plugin-check-command"
        import "ipv4-or-ipv6"
 
-       command = [
-               PluginDir + "/check_tcp",
-               "-H", "$tcp_address$",
-               "-p", "$tcp_port$"
-       ]
+       command = [ PluginDir + "/check_tcp" ]
+
+       arguments = {
+               "-H" = {
+                       value =  "$tcp_address$"
+                       description = "Host name, IP Address, or unix socket (must be an absolute path)."
+               }
+               "-p" = {
+                       value =  "$tcp_port$"
+                       description = "The TCP port number."
+               }
+               "-e" = {
+                       value = "$ftp_expect$"
+                       description = "String to expect in server response (may be repeated)."
+               }
+               "-A" = {
+                       set_if = "$tcp_all$"
+                       description = "All expect strings need to occur in server response. Defaults to false."
+               }
+               "-E_send" = {
+                       key = "-E"
+                       order = 1
+                       set_if = "$tcp_escape_send$"
+                       description = "Enable usage of \n, \r, \t or \\ in send string.
+               }
+               "-s" = {
+                       order = 2
+                       value = "$tcp_send$"
+                       description = "String to send to the server."
+               }
+               "-E_quit" = {
+                       key = "-E"
+                       order = 3
+                       set_if = "$tcp_escape_quit$"
+                       description = "Enable usage of \n, \r, \t or \\ in quit string.
+               }
+               "-q" = {
+                       order = 4
+                       value = "$tcp_quit$"
+                       description = "String to send server to initiate a clean close of the connection."
+               }
+               "-r" = {
+                       value = "$tcp_refuse$"
+                       description = "Accept TCP refusals with states ok, warn, crit. Defaults to crit."
+               }
+               "-M" = {
+                       value = "$tcp_mismatch$"
+                       description = "Accept expected string mismatches with states ok, warn, crit. Defaults to warn."
+               }
+               "-j" = {
+                       set_if = "$tcp_jail$"
+                       description = "Hide output from TCP socket."
+               }
+               "-m" = {
+                       value = "$tcp_maxbytes$"
+                       description = "Close connection once more than this number of bytes are received."
+               }
+               "-d" = {
+                       value = "$tcp_delay$"
+                       description = "Seconds to wait between sending string and polling for response."
+               }
+               "-D" = {
+                       value = "$tcp_certificate$"
+                       description = "Minimum number of days a certificate has to be valid. 1st value is number of days for warning, 2nd is critical (if not specified: 0) - seperated by comma."
+               }
+               "-S" = {
+                       set_if = "$tcp_ssl$"
+                       description = "Use SSL for the connection."
+               }
+               "-w" = {
+                       value = "$tcp_wtime$"
+                       description = "Response time to result in warning status (seconds)."
+               }
+               "-c" = {
+                       value = "$tcp_ctime$"
+                       description = "Response time to result in critical status (seconds)."
+               }
+               "-t" = {
+                       value = "$tcp_timeout$"
+                       description = "Seconds before connection times out. Defaults to 10."
+               }
+       }
 
        vars.tcp_address = "$check_address$"
+       vars.tcp_all = false
+       vars.tcp_refuse = "crit"
+       vars.tcp_mismatch = "warn"
+       vars.tcp_timeout = 10
 }
 
 object CheckCommand "ssl" {