Skip to content

Commit 1465099

Browse files
authored
Add Icinga2 check_smart CheckCommand definition (#105)
1 parent a6cdc66 commit 1465099

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

contrib/icinga2-command.conf

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/*
2+
* Icinga2 CheckCommand definition for check_smart (check_smart.pl) monitoring plugin
3+
* See https://www.claudiokuenzler.com/monitoring-plugins/check_smart.php
4+
*/
5+
6+
object CheckCommand "check_smart" {
7+
command = [ PluginContribDir + "/check_smart.pl" ]
8+
9+
arguments = {
10+
"-d" = {
11+
value = "$smart_device$"
12+
set_if = {{ macro("$smart_device_is_glob$") == false }}
13+
description = "A physical block device to be SMART monitored, eg /dev/sda."
14+
}
15+
"-g" = {
16+
value = "$smart_device$"
17+
set_if = {{ macro("$smart_device_is_glob$") == true }}
18+
description = "A glob expression of physical devices to be monitored, eg -g '/dev/sd[a-z]'."
19+
}
20+
"-i" = {
21+
value = "$smart_interface$"
22+
description = "Drive's interface type, must be one of: auto, ata, scsi, nvme, 3ware,N, areca,N, hpt,L/M/N, cciss,N, megaraid,N."
23+
required = true
24+
}
25+
"-r" = {
26+
value = "$smart_raw_list$"
27+
description = "List (comma separated, without spaces!) of SMART attributes to check for their raw values."
28+
}
29+
"-e" = {
30+
value = "$smart_exclude_list$"
31+
description = "List of (comma separated) SMART attributes which should be excluded (=ignored) from checks, but still appear in perfdata."
32+
}
33+
"-E" = {
34+
value = "$smart_exclude_all_list$"
35+
description = "List of (comma separated) SMART attributes which should be excluded (=ignored) completely from checks and perfdata."
36+
}
37+
"-b" = {
38+
value = "$smart_bad$"
39+
description = "Threshold value (integer) when to warn for N bad entries (ATA: Current Pending Sector, SCSI: Grown defect list). Note: Deprecated for ATA drives, use `smart_warn` instead. Continue to use this for SCSI drives."
40+
}
41+
"-w" = {
42+
value = "$smart_warn$"
43+
description = "Comma separated list of thresholds for ATA drives (e.g. `'Reallocated_Sector_Ct=10,Current_Pending_Sector=62'`)."
44+
}
45+
"-s" = {
46+
set_if = "$smart_selftest$"
47+
description = "If set to true, additionally check SMART's selftest log for errors."
48+
}
49+
"-l" = {
50+
set_if = "$smart_ssd_lifetime$"
51+
description = "If set to true, additionally check SSD attribute Percent_Lifetime_Remain."
52+
}
53+
"-O" = {
54+
set_if = "$smart_oldage$"
55+
description = "If set to true, ignore certain oldage attributes related to the drive's usage (not recommended)."
56+
}
57+
"-q" = {
58+
set_if = "$smart_quiet$"
59+
description = "If set to true, only show failing drive(s) when faults are detected (only affects output when used with `vars.smart_device_is_glob`)."
60+
}
61+
"--hide-sn" = {
62+
set_if = "$smart_hide_sn$"
63+
description = "If set to true, output does not reveal serial number of drive(s)."
64+
}
65+
"--skip-self-assessment" = {
66+
set_if = "$smart_skip_self_assessment$"
67+
description = "If set to true, skip the SMART self assessment health check (not recommended)."
68+
}
69+
"--skip-temp-check" = {
70+
set_if = "$smart_skip_temp_check$"
71+
description = "If set to true, skip temperature comparison current vs. drive max temperature (not recommended)."
72+
}
73+
"--skip-load-cycles" = {
74+
set_if = "$smart_skip_load_cycles$"
75+
description = "If set to true, skip check of SMART attribute 193 (Load_Cycle_Count), deemed unsafe after reaching 600K load/unload cycles."
76+
}
77+
"--skip-error-log" = {
78+
set_if = "$smart_skip_error_log$"
79+
description = "If set to true, skip check of SMART Error Log (not recommended)."
80+
}
81+
}
82+
83+
vars.smart_interface = "auto"
84+
vars.smart_device_is_glob = false
85+
vars.smart_selftest = false
86+
vars.smart_ssd_lifetime = false
87+
vars.smart_quiet = false
88+
}

0 commit comments

Comments
 (0)