diff --git a/AUTHORS b/AUTHORS index bf62cdb3e..672b4c474 100644 --- a/AUTHORS +++ b/AUTHORS @@ -221,6 +221,7 @@ Nicolas Limage Nicolas Rodriguez Nicole Lang Niflou +Nils Czernia Noah Hilverling noobahoi <20069422+noobahoi@users.noreply.github.com> Obihörnchen diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 26d1b8813..1ad4f55b1 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -3032,10 +3032,18 @@ uses the `smartctl` binary to monitor SMART values of SSDs and HDDs. Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters): -Name | Description ---------------------------------|----------------------------------------------------------------------- -smart_attributes_config_path | **Required.** Path to the smart attributes config file (e.g. check_smartdb.json). -smart_attributes_device | **Required.** Device name (e.g. /dev/sda) to monitor. +Name | Description +---------------------------------------|----------------------------------------------------------------------- +smart_attributes_smartclt_path | **Optional.** Path where the smartctl binary can be found. +smart_attributes_device | **Required.** Device name (e.g. /dev/sda) to monitor. +smart_attributes_device_regex | **Required.** Alternative to *smart_attributes_device* but with the availability to use regex. +smart_attributes_config_path | **Required.** Path to the smart attributes config file (e.g. check_smartdb.json). +smart_attributes_user_config_path | **Optional.** Path where the JSON user config file can be found. +smart_attributes_critical_if_not_found | **Optional.** If set to true, the check enters cirical state if the device was not found in the database. +smart_attributes_no_sudo | **Optional.** If set to true, disable the usage of sudo for smartctl. +smart_attributes_get_allperfs | **Optional.** Get performance data for all monitor-able smart attributes and don't limit performance data to the 'Perfs' section in the smartdb.json. +smart_attributes_ssd_only | **Optional.** If set to true, only SSDs are checked, even if more devices are given +smart_attributes_options | **Optional.** Additional parameters forwarded to smartctl binary ### IcingaCLI diff --git a/itl/plugins-contrib.d/smart-attributes.conf b/itl/plugins-contrib.d/smart-attributes.conf index 20eb34584..f70216f3f 100644 --- a/itl/plugins-contrib.d/smart-attributes.conf +++ b/itl/plugins-contrib.d/smart-attributes.conf @@ -8,15 +8,47 @@ object CheckCommand "smart-attributes" { command = [ PluginContribDir + "/check_smart_attributes" ] arguments = { - "-dbj" = { + "--path" = { + value = "$smart_attributes_smartclt_path$" + description = "Specify the path at which the smartctl binary can be found." + } + "--device" = { + value = "$smart_attributes_device$" + description = "Insert the device name (e.g. /dev/sda) to monitor" + } + "--regex" = { + value = "$smart_attributes_device_regex$" + description = "Insert a regex to finde devices to monitori (version > 1.6)" + } + "--dbjson" = { required = true value = "$smart_attributes_config_path$" description = "Path to the smart attributes config file (e.g. check_smartdb.json)" } - "-d" = { - required = true - value = "$smart_attributes_device$" - description = "Insert the device name (e.g. /dev/sda) to monitor" + "--ucfgjson" = { + value = "$smart_attributes_user_config_path$" + description = "Specify the path at which the JSON smart db can be found." + + } + "--critical_on_unknown" = { + set_if = "$smart_attributes_critical_if_not_found$" + description = "Show critical if the device was not found in database." + } + "-nosudo" = { # Only one '-' is correct, not a typo + set_if = "$smart_attributes_no_sudo$" + description = "Disable the usage of sudo for smartctl." + } + "--allperfs" = { + set_if = "$smart_attributes_get_allperfs$" + description = "Get performance data for all monitor-able smart attributes and don't limit performance data to the 'Perfs' section in the smartdb.json." + } + "--ssdonly" = { + set_if = "$smart_attributes_ssd_only$" + description = "Check SSDs only, even if more devices are given." + } + "--options" = { + value = "$smart_attributes_options$" + description = "Additional parameters forwarded to smarctl binary" } }