]> granicus.if.org Git - icinga2/commitdiff
Add attributes to the "ftp" CheckCommand.
authorTobias von der Krone <tobias.vonderkrone@profitbricks.com>
Tue, 21 Apr 2015 16:53:18 +0000 (18:53 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 22 Apr 2015 19:48:49 +0000 (21:48 +0200)
fixes #9146

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

index 292d6a19f969630991f936e9632a9656d75625a6..859dbe161394d2923c93fb18b826a6d177c4f2a1 100644 (file)
@@ -265,6 +265,23 @@ Custom Attributes:
 Name               | Description
 -------------------|--------------
 ftp_address        | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
+ftp_port           | **Optional.** The FTP port number.
+ftp_expect         | **Optional.** String to expect in server response (may be repeated).
+ftp_all            | **Optional.** All expect strings need to occur in server response. Defaults to false.
+ftp_escape_send    | **Optional.** Enable usage of \n, \r, \t or \\\\ in send string.
+ftp_send           | **Optional.** String to send to the server.
+ftp_escape_quit    | **Optional.** Enable usage of \n, \r, \t or \\\\ in quit string.
+ftp_quit           | **Optional.** String to send server to initiate a clean close of the connection.
+ftp_refuse         | **Optional.** Accept TCP refusals with states ok, warn, crit. Defaults to crit.
+ftp_mismatch       | **Optional.** Accept expected string mismatches with states ok, warn, crit. Defaults to warn.
+ftp_jail           | **Optional.** Hide output from TCP socket.
+ftp_maxbytes       | **Optional.** Close connection once more than this number of bytes are received.
+ftp_delay          | **Optional.** Seconds to wait between sending string and polling for response.
+ftp_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.
+ftp_ssl            | **Optional.** Use SSL for the connection. Defaults to false.
+ftp_wtime          | **Optional.** Response time to result in warning status (seconds).
+ftp_ctime          | **Optional.** Response time to result in critical status (seconds).
+ftp_timeout        | **Optional.** Seconds before connection times out. Defaults to 10.
 
 
 ## <a id="plugin-check-command-hostalive"></a> hostalive
index 0371724f5f9b13b9b11aaea5144e58b3260a2c0f..4c30ae10f2e20b0835b1b0d4b60c108913d1caf5 100644 (file)
@@ -339,10 +339,91 @@ object CheckCommand "ftp" {
        command = [ PluginDir + "/check_ftp" ]
 
        arguments = {
-               "-H" = "$ftp_address$"
+               "-H" = {
+                       value = "$ftp_address$"
+                       description = "The host's address. Defaults to $address$ or $address6$ if the address attribute is not set."
+               }
+               "-p" = {
+                       value = "$ftp_port$"
+                       description = "The FTP port number. Defaults to none"
+               }
+               "-e" = {
+                       value = "$ftp_expect$"
+                       description = "String to expect in server response (may be repeated)."
+               }
+               "-A" = {
+                       set_if = "$ftp_all$"
+                       description = "All expect strings need to occur in server response. Default is any."
+               }
+               "-E_send" = {
+                       key = "-E"
+                       order = 1
+                       set_if = "$ftp_escape_send$"
+                       description = "Enable usage of \n, \r, \t or \\ in send string. Default is nothing."
+               }
+               "-s" = {
+                       order = 2
+                       value = "$ftp_send$"
+                       description = "String to send to the server."
+               }
+               "-E_quit" = {
+                       key = "-E"
+                       order = 3
+                       set_if = "$ftp_escape_quit$"
+                       description = "Can use \n, \r, \t or \\ in quit string. Default is \r\n added to end of quit."
+               }
+               "-q" = {
+                       order = 4
+                       value = "$ftp_quit$"
+                       description = "String to send server to initiate a clean close of the connection."
+               }
+               "-r" = {
+                       value = "$ftp_refuse$"
+                       description = "Accept TCP refusals with states ok, warn, crit. Defaults to crit."
+               }
+               "-M" = {
+                       value = "$ftp_mismatch$"
+                       description = "Accept expected string mismatches with states ok, warn, crit. Defaults to warn."
+               }
+               "-j" = {
+                       set_if = "$ftp_jail$"
+                       description = "Hide output from TCP socket."
+               }
+               "-m" = {
+                       value = "$ftp_maxbytes$"
+                       description = "Close connection once more than this number of bytes are received."
+               }
+               "-d" = {
+                       value = "$ftp_delay$"
+                       description = "Seconds to wait between sending string and polling for response."
+               }
+               "-D" = {
+                       value = "$ftp_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 = "$ftp_ssl$"
+                       description = "Use SSL for the connection."
+               }
+               "-w" = {
+                       value = "$ftp_wtime$"
+                       description = "Response time to result in warning status (seconds)."
+               }
+               "-c" = {
+                       value = "$ftp_ctime$"
+                       description = "Response time to result in critical status (seconds)."
+               }
+               "-t" = {
+                       value = "$ftp_timeout$"
+                       description = "Seconds before connection times out. Defaults to 10."
+               }
        }
 
        vars.ftp_address = "$check_address$"
+       vars.ftp_ssl = false
+       vars.ftp_refuse = "crit"
+       vars.ftp_mismatch = "warn"
+       vars.ftp_timeout = 10
 }
 
 object CheckCommand "smtp" {