Ostatnio aktywny 6 months ago

Rewizja c72f10953b181927e0d570f519a9760f5e7eed4a

check_smart.conf Surowy
1object CheckCommand "check-smart" {
2 import "plugin-check-command"
3
4 command = [ "/usr/lib/monitoring-plugins" + "/check_smart" ]
5
6 arguments = {
7 "--device" = {
8 value = "$smart_device$"
9 set_if = {{ macro("$smart_device_is_glob$") == false }}
10 description = "A physical block device to be SMART monitored, eg /dev/sda. Pseudo-device /dev/bus/N is allowed."
11 }
12 "--global" = {
13 value = "$smart_device$"
14 set_if = {{ macro("$smart_device_is_glob$") == true }}
15 description = "A glob expression of physical devices to be monitored, eg -g '/dev/sd[a-z]'."
16 }
17 "--interface" = {
18 value = "$smart_interface$"
19 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, aacraid,N,N,N"
20 required = true
21 }
22 "--raw" = {
23 value = "$smart_raw_list$"
24 description = "List (comma separated, without spaces!) of SMART attributes to check for their raw values."
25 }
26 "--exclude" = {
27 value = "$smart_exclude_list$"
28 description = "List of (comma separated) SMART attributes which should be excluded (=ignored) from checks."
29 }
30 "--exclude-all" = {
31 value = "$smart_exclude_all_list$"
32 description = "List of (comma separated) SMART attributes which should be excluded (=ignored) completely, for both checks and performance data."
33 }
34 "--bad" = {
35 value = "$smart_bad$"
36 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."
37 }
38 "--warn" = {
39 value = "$smart_warn$"
40 description = "Comma separated list of thresholds for ATA drives (e.g. `'Reallocated_Sector_Ct=10,Current_Pending_Sector=62'`)."
41 }
42 "--selftest" = {
43 set_if = "$smart_selftest$"
44 description = "If set to true, additionally check SMART's selftest log for errors."
45 }
46 "--ssd-lifetime" = {
47 set_if = "$smart_ssd_lifetime$"
48 description = "If set to true, additionally check SSD attribute Percent_Lifetime_Remain."
49 }
50 "--quiet" = {
51 set_if = "$smart_quite$"
52 description = "If set to true, additionally check SSD attribute Percent_Lifetime_Remain."
53 }
54 "--skip-self-assessment" = {
55 set_if = "$smart_skip_self_assessment$"
56 description = "If set to true, when faults are detected, only show failing drive(s) (only affects output when used with -g parameter)."
57 }
58 "--debug" = {
59 set_if = "$smart_debug$"
60 description = "If set to true, additionall debugging information is shown."
61 }
62 }
63 vars.smart_device = "/dev/sda"
64 vars.smart_interface = "auto"
65 vars.smart_device_is_glob = false
66 vars.smart_selftest = false
67 vars.smart_ssd_lifetime = false
68 vars.smart_quiet = false
69 vars.smart_skip_self_assessment = false
70 vars.smart_debug = false
71 timeout = 60s
72}
73
74/* apply smart service check */
75apply Service "smart" {
76 import "local-generic-service"
77
78 check_command = "check-smart"
79
80 command_endpoint = host.name
81
82 // notification tag
83 vars.sections = [ "operatingsystem" ] # TODO GIT
84
85 assign where host.vars.os == "Linux" && host.vars.smart_device
86 ignore where host.vars.nochecksmart
87 ignore where host.vars.noagent
88}
89
90object Host "hostname" {
91 import "linux-host"
92 address 127.0.1.3
93 vars.smart_device = "/dev/sda"
94 vars.smart_interface = "cciss,[0-5]"
95 vars.smart_device_is_glob = true
96}
97
98object Endpoint "hostname" {
99}
100object Zone "hostname" {
101 endpoints = [ "hostname" ]
102 parent = "master"
103}