Skip to content

Commit beddc3f

Browse files
authored
Merge pull request #10564 from freaknils/master
ITL: Enhanced SMART attributes monitoring plugin check configuration to more parameters
2 parents bc7debe + 0dbc1a7 commit beddc3f

File tree

3 files changed

+50
-9
lines changed

3 files changed

+50
-9
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ Nicolas Limage <github@xephon.org>
221221
Nicolas Rodriguez <nico@nicoladmin.fr>
222222
Nicole Lang <nicole.lang@icinga.com>
223223
Niflou <dubuscyr@gmail.com>
224+
Nils Czernia <nils@czserver.de>
224225
Noah Hilverling <noah.hilverling@icinga.com>
225226
noobahoi <20069422+noobahoi@users.noreply.github.com>
226227
Obihörnchen <obihoernchende@gmail.com>

doc/10-icinga-template-library.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3032,10 +3032,18 @@ uses the `smartctl` binary to monitor SMART values of SSDs and HDDs.
30323032

30333033
Custom variables passed as [command parameters](03-monitoring-basics.md#command-passing-parameters):
30343034

3035-
Name | Description
3036-
--------------------------------|-----------------------------------------------------------------------
3037-
smart_attributes_config_path | **Required.** Path to the smart attributes config file (e.g. check_smartdb.json).
3038-
smart_attributes_device | **Required.** Device name (e.g. /dev/sda) to monitor.
3035+
Name | Description
3036+
---------------------------------------|-----------------------------------------------------------------------
3037+
smart_attributes_smartclt_path | **Optional.** Path where the smartctl binary can be found.
3038+
smart_attributes_device | **Required.** Device name (e.g. /dev/sda) to monitor.
3039+
smart_attributes_device_regex | **Required.** Alternative to *smart_attributes_device* but with the availability to use regex.
3040+
smart_attributes_config_path | **Required.** Path to the smart attributes config file (e.g. check_smartdb.json).
3041+
smart_attributes_user_config_path | **Optional.** Path where the JSON user config file can be found.
3042+
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.
3043+
smart_attributes_no_sudo | **Optional.** If set to true, disable the usage of sudo for smartctl.
3044+
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.
3045+
smart_attributes_ssd_only | **Optional.** If set to true, only SSDs are checked, even if more devices are given
3046+
smart_attributes_options | **Optional.** Additional parameters forwarded to smartctl binary
30393047

30403048

30413049
### IcingaCLI <a id="plugin-contrib-icingacli"></a>

itl/plugins-contrib.d/smart-attributes.conf

Lines changed: 37 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,47 @@ object CheckCommand "smart-attributes" {
88
command = [ PluginContribDir + "/check_smart_attributes" ]
99

1010
arguments = {
11-
"-dbj" = {
11+
"--path" = {
12+
value = "$smart_attributes_smartclt_path$"
13+
description = "Specify the path at which the smartctl binary can be found."
14+
}
15+
"--device" = {
16+
value = "$smart_attributes_device$"
17+
description = "Insert the device name (e.g. /dev/sda) to monitor"
18+
}
19+
"--regex" = {
20+
value = "$smart_attributes_device_regex$"
21+
description = "Insert a regex to finde devices to monitori (version > 1.6)"
22+
}
23+
"--dbjson" = {
1224
required = true
1325
value = "$smart_attributes_config_path$"
1426
description = "Path to the smart attributes config file (e.g. check_smartdb.json)"
1527
}
16-
"-d" = {
17-
required = true
18-
value = "$smart_attributes_device$"
19-
description = "Insert the device name (e.g. /dev/sda) to monitor"
28+
"--ucfgjson" = {
29+
value = "$smart_attributes_user_config_path$"
30+
description = "Specify the path at which the JSON smart db can be found."
31+
32+
}
33+
"--critical_on_unknown" = {
34+
set_if = "$smart_attributes_critical_if_not_found$"
35+
description = "Show critical if the device was not found in database."
36+
}
37+
"-nosudo" = { # Only one '-' is correct, not a typo
38+
set_if = "$smart_attributes_no_sudo$"
39+
description = "Disable the usage of sudo for smartctl."
40+
}
41+
"--allperfs" = {
42+
set_if = "$smart_attributes_get_allperfs$"
43+
description = "Get performance data for all monitor-able smart attributes and don't limit performance data to the 'Perfs' section in the smartdb.json."
44+
}
45+
"--ssdonly" = {
46+
set_if = "$smart_attributes_ssd_only$"
47+
description = "Check SSDs only, even if more devices are given."
48+
}
49+
"--options" = {
50+
value = "$smart_attributes_options$"
51+
description = "Additional parameters forwarded to smarctl binary"
2052
}
2153
}
2254

0 commit comments

Comments
 (0)