diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index 2d3ebdb51..fb94811b1 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -897,6 +897,34 @@ users_wgreater | **Optional.** The user count warning threshold. Defaults to 20 users_cgreater | **Optional.** The user count critical threshold. Defaults to 50. +## clamd + +Check command object for the `check_clamd` plugin. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-------------------|-------------- +clamd_address | **Required.** The host's address or unix socket (must be an absolute path). +clamd_port | **Optional.** Port number (default: none). +clamd_expect | **Optional.** String to expect in server response (may be repeated). +clamd_all | **Optional.** All expect strings need to occur in server response. Defaults to false. +clamd_escape_send | **Optional.** Enable usage of \n, \r, \t or \\\\ in send string. +clamd_send | **Optional.** String to send to the server. +clamd_escape_quit | **Optional.** Enable usage of \n, \r, \t or \\\\ in quit string. +clamd_quit | **Optional.** String to send server to initiate a clean close of the connection. +clamd_refuse | **Optional.** Accept TCP refusals with states ok, warn, crit. Defaults to crit. +clamd_mismatch | **Optional.** Accept expected string mismatches with states ok, warn, crit. Defaults to warn. +clamd_jail | **Optional.** Hide output from TCP socket. +clamd_maxbytes | **Optional.** Close connection once more than this number of bytes are received. +clamd_delay | **Optional.** Seconds to wait between sending string and polling for response. +clamd_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. +clamd_ssl | **Optional.** Use SSL for the connection. Defaults to false. +clamd_wtime | **Optional.** Response time to result in warning status (seconds). +clamd_ctime | **Optional.** Response time to result in critical status (seconds). +clamd_timeout | **Optional.** Seconds before connection times out. Defaults to 10. + + # Icinga 2 Windows plugins To allow a basic monitoring of Windows clients Icinga 2 comes with a set of Windows only plugins. While trying to mirror the functionalities of their linux cousins from the monitoring-plugins package, the differences between Windows and Linux are too big to be able use the same CheckCommands for both systems. diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 74dcb9e88..8930c580e 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -1420,3 +1420,97 @@ object CheckCommand "ldap" { vars.ldap_timeout = 10s vars.ldap_verbose = false } + +object CheckCommand "clamd" { + import "plugin-check-command" + + command = [ PluginDir + "/check_clamd" ] + + arguments = { + "-H" = { + value = "$clamd_address$" + description = "The host's address or unix socket (must be an absolute path)." + required = true + } + "-p" = { + value = "$clamd_port$" + description = "Port number (default: none)." + } + "-e" = { + value = "$clamd_expect$" + description = "String to expect in server response (may be repeated)." + repeat_key = true + } + "-A" = { + set_if = "$clamd_all$" + description = "All expect strings need to occur in server response. Default is any." + } + "-E_send" = { + key = "-E" + order = 1 + set_if = "$clamd_escape_send$" + description = "Enable usage of \n, \r, \t or \\ in send string. Default is nothing." + } + "-s" = { + order = 2 + value = "$clamd_send$" + description = "String to send to the server." + } + "-E_quit" = { + key = "-E" + order = 3 + set_if = "$clamd_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 = "$clamd_quit$" + description = "String to send server to initiate a clean close of the connection." + } + "-r" = { + value = "$clamd_refuse$" + description = "Accept TCP refusals with states ok, warn, crit. Defaults to crit." + } + "-M" = { + value = "$clamd_mismatch$" + description = "Accept expected string mismatches with states ok, warn, crit. Defaults to warn." + } + "-j" = { + set_if = "$clamd_jail$" + description = "Hide output from TCP socket." + } + "-m" = { + value = "$clamd_maxbytes$" + description = "Close connection once more than this number of bytes are received." + } + "-d" = { + value = "$clamd_delay$" + description = "Seconds to wait between sending string and polling for response." + } + "-D" = { + value = "$clamd_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 = "$clamd_ssl$" + description = "Use SSL for the connection." + } + "-w" = { + value = "$clamd_wtime$" + description = "Response time to result in warning status (seconds)." + } + "-c" = { + value = "$clamd_ctime$" + description = "Response time to result in critical status (seconds)." + } + "-t" = { + value = "$clamd_timeout$" + description = "Seconds before connection times out. Defaults to 10." + } + } + + vars.clamd_ssl = false + vars.clamd_refuse = "crit" + vars.clamd_mismatch = "warn" + vars.clamd_timeout = 10 +}