]>
Commit | Line | Data |
---|---|---|
1 | .ig | |
2 | Copyright (C) 2002-10 Bruce Allen | |
3 | Copyright (C) 2004-18 Christian Franke | |
4 | ||
5 | SPDX-License-Identifier: GPL-2.0-or-later | |
6 | ||
7 | $Id: smartd.conf.5.in 4856 2018-12-11 21:42:16Z chrfranke $ | |
8 | ||
9 | .. | |
10 | .\" Macros borrowed from pages generated with Pod::Man | |
11 | .de Sp \" Vertical space (when we can't use .PP) | |
12 | .if t .sp 0.4v | |
13 | .if n .sp | |
14 | .. | |
15 | .de Vb \" Begin verbatim text | |
16 | .ft CW | |
17 | .nf | |
18 | .ne \\$1 | |
19 | .. | |
20 | .de Ve \" End verbatim text | |
21 | .ft R | |
22 | .fi | |
23 | .. | |
24 | .\" Use groff extension \(aq (apostrophe quote, ASCII 0x27) if possible | |
25 | .ie \n(.g .ds Aq \(aq | |
26 | .el .ds Aq ' | |
27 | .TH SMARTD.CONF 5 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools" | |
28 | .SH NAME | |
29 | \fBsmartd.conf\fP \- SMART Disk Monitoring Daemon Configuration File\fP | |
30 | .Sp | |
31 | .SH DESCRIPTION | |
32 | .\" %IF NOT OS ALL | |
33 | .\"! [This man page is generated for the OS_MAN_FILTER version of smartmontools. | |
34 | .\"! It does not contain info specific to other platforms.] | |
35 | .\"! .PP | |
36 | .\" %ENDIF NOT OS ALL | |
37 | \fB/usr/local/etc/smartd.conf\fP is the configuration file for the \fBsmartd\fP | |
38 | daemon. | |
39 | .PP | |
40 | If the configuration file \fB/usr/local/etc/smartd.conf\fP is present, | |
41 | \fBsmartd\fP reads it at startup. | |
42 | If \fBsmartd\fP subsequently receives a \fBHUP\fP signal, | |
43 | it will then re-read the configuration file. If \fBsmartd\fP is | |
44 | running in debug mode, then an \fBINT\fP signal will also make it | |
45 | re-read the configuration file. This signal can be generated by typing | |
46 | \fB<CONTROL-C>\fP in the terminal window where \fBsmartd\fP is | |
47 | running. | |
48 | .PP | |
49 | In the absence of a configuration file | |
50 | \fBsmartd\fP will try to open all available devices | |
51 | (see \fBsmartd\fP(8) man page). | |
52 | A configuration file with a single line \fB\*(AqDEVICESCAN \-a\*(Aq\fP | |
53 | would have the same effect. | |
54 | .PP | |
55 | This can be annoying if you have an ATA or SCSI device that hangs or | |
56 | misbehaves when receiving SMART commands. Even if this causes no | |
57 | problems, you may be annoyed by the string of error log messages about devices | |
58 | that can't be opened. | |
59 | .PP | |
60 | One can avoid this problem, and gain more control over the types of | |
61 | events monitored by | |
62 | \fBsmartd\fP, | |
63 | by using the configuration file | |
64 | .B /usr/local/etc/smartd.conf. | |
65 | This file contains a list of devices to monitor, with one device per | |
66 | line. An example file is included with the | |
67 | .B smartmontools | |
68 | distribution. You will find this sample configuration file in | |
69 | \fB/usr/local/share/doc/smartmontools/\fP. | |
70 | For security, the configuration file should not be writable by anyone | |
71 | but root. | |
72 | The syntax of the file is as follows: | |
73 | .IP \(bu 4 | |
74 | There should be one device listed per line, although you may have | |
75 | lines that are entirely comments or white space. | |
76 | .IP \(bu 4 | |
77 | Any text following a hash sign \*(Aq#\*(Aq and up to the end of the line is | |
78 | taken to be a comment, and ignored. | |
79 | .IP \(bu 4 | |
80 | Lines may be continued by using a backslash \*(Aq\e\*(Aq as the last | |
81 | non-whitespace or non-comment item on a line. | |
82 | .IP \(bu 4 | |
83 | Note: a line whose first character is a hash sign \*(Aq#\*(Aq is treated as | |
84 | a white-space blank line, \fBnot\fP as a non-existent line, and will | |
85 | \fBend\fP a continuation line. | |
86 | .PP | |
87 | Here is an example configuration file. It's for illustrative purposes | |
88 | only; please don't copy it onto your system without reading to the end | |
89 | of the | |
90 | .B DIRECTIVES | |
91 | Section below! | |
92 | .PP | |
93 | .Vb 9 | |
94 | ################################################ | |
95 | # This is an example smartd startup config file | |
96 | # /usr/local/etc/smartd.conf | |
97 | # | |
98 | # On the second disk, start a long self-test every | |
99 | # Sunday between 3 and 4 am. | |
100 | # | |
101 | /dev/sda \-a \-m admin@example.com,root@localhost | |
102 | /dev/sdb \-a \-I 194 \-I 5 \-i 12 \-s L/../../7/03 | |
103 | # | |
104 | # Send a TEST warning email to admin on startup. | |
105 | # | |
106 | /dev/sdc \-m admin@example.com \-M test | |
107 | # | |
108 | # Strange device. It's SCSI. Start a scheduled | |
109 | # long self test between 5 and 6 am Monday/Thursday | |
110 | /dev/weird \-d scsi \-s L/../../(1|4)/05 | |
111 | # | |
112 | # An ATA disk may appear as a SCSI device to the | |
113 | # OS. If a SCSI to ATA Translation (SAT) layer | |
114 | # is between the OS and the device then this can be | |
115 | # flagged with the '\-d sat' option. This situation | |
116 | # may become common with SATA disks in SAS and FC | |
117 | # environments. | |
118 | /dev/sda \-a \-d sat | |
119 | .\" %IF OS Linux | |
120 | # | |
121 | # Three disks connected to a MegaRAID controller | |
122 | # Start short self\-tests daily between 1\-2, 2\-3, and | |
123 | # 3\-4 am. | |
124 | /dev/sda \-d megaraid,0 \-a \-s S/../.././01 | |
125 | /dev/sda \-d megaraid,1 \-a \-s S/../.././02 | |
126 | /dev/sda \-d megaraid,2 \-a \-s S/../.././03 | |
127 | /dev/bus/0 \-d megaraid,2 \-a \-s S/../.././03 | |
128 | # | |
129 | # Three disks connected to an AacRaid controller | |
130 | # Start short self\-tests daily between 1\-2, 2\-3, and | |
131 | # 3\-4 am. | |
132 | /dev/sda \-d aacraid,0,0,66 \-a \-s S/../.././01 | |
133 | /dev/sda \-d aacraid,0,0,67 \-a \-s S/../.././02 | |
134 | /dev/sda \-d aacraid,0,0,68 \-a \-s S/../.././03 | |
135 | .\" %ENDIF OS Linux | |
136 | .\" %IF OS FreeBSD Linux | |
137 | # | |
138 | # Two SATA (not SAS) disks on a 3ware 9750 controller. | |
139 | # Start long self\-tests Sundays between midnight and | |
140 | # 1 am and 2\-3 am | |
141 | .\" %ENDIF OS FreeBSD Linux | |
142 | .\" %IF OS Linux | |
143 | # under Linux | |
144 | /dev/twl0 \-d 3ware,0 \-a \-s L/../../7/00 | |
145 | /dev/twl0 \-d 3ware,1 \-a \-s L/../../7/02 | |
146 | .\" %ENDIF OS Linux | |
147 | .\" %IF OS FreeBSD | |
148 | # under FreeBSD | |
149 | /dev/tws0 \-d 3ware,0 \-a \-s L/../../7/00 | |
150 | /dev/tws0 \-d 3ware,1 \-a \-s L/../../7/02 | |
151 | .\" %ENDIF OS FreeBSD | |
152 | .\" %IF OS FreeBSD Linux | |
153 | # | |
154 | # Three SATA disks on a HighPoint RocketRAID controller. | |
155 | # Start short self\-tests daily between 1\-2, 2\-3, and | |
156 | # 3\-4 am. | |
157 | .\" %ENDIF OS FreeBSD Linux | |
158 | .\" %IF OS Linux | |
159 | # under Linux | |
160 | /dev/sde \-d hpt,1/1 \-a \-s S/../.././01 | |
161 | /dev/sde \-d hpt,1/2 \-a \-s S/../.././02 | |
162 | /dev/sde \-d hpt,1/3 \-a \-s S/../.././03 | |
163 | .\" %ENDIF OS Linux | |
164 | .\" %IF OS FreeBSD | |
165 | # under FreeBSD | |
166 | /dev/hptrr \-d hpt,1/1 \-a \-s S/../.././01 | |
167 | /dev/hptrr \-d hpt,1/2 \-a \-s S/../.././02 | |
168 | /dev/hptrr \-d hpt,1/3 \-a \-s S/../.././03 | |
169 | .\" %ENDIF OS FreeBSD | |
170 | .\" %IF OS FreeBSD Linux | |
171 | # | |
172 | # Two SATA disks connected to a HighPoint RocketRAID | |
173 | # via a pmport device. Start long self\-tests Sundays | |
174 | # between midnight and 1 am and 2\-3 am. | |
175 | .\" %ENDIF OS FreeBSD Linux | |
176 | .\" %IF OS Linux | |
177 | # under Linux | |
178 | /dev/sde \-d hpt,1/4/1 \-a \-s L/../../7/00 | |
179 | /dev/sde \-d hpt,1/4/2 \-a \-s L/../../7/02 | |
180 | .\" %ENDIF OS Linux | |
181 | .\" %IF OS FreeBSD | |
182 | # under FreeBSD | |
183 | /dev/hptrr \-d hpt,1/4/1 \-a \-s L/../../7/00 | |
184 | /dev/hptrr \-d hpt,1/4/2 \-a \-s L/../../7/02 | |
185 | .\" %ENDIF OS FreeBSD | |
186 | .\" %IF OS FreeBSD Linux | |
187 | # | |
188 | # Three SATA disks connected to an Areca | |
189 | # RAID controller. Start long self\-tests Sundays | |
190 | # between midnight and 3 am. | |
191 | .\" %ENDIF OS FreeBSD Linux | |
192 | .\" %IF OS Linux | |
193 | # under Linux | |
194 | /dev/sg2 \-d areca,1 \-a \-s L/../../7/00 | |
195 | /dev/sg2 \-d areca,2 \-a \-s L/../../7/01 | |
196 | /dev/sg2 \-d areca,3 \-a \-s L/../../7/02 | |
197 | .\" %ENDIF OS Linux | |
198 | .\" %IF OS FreeBSD | |
199 | # under FreeBSD | |
200 | /dev/arcmsr0 \-d areca,1 \-a \-s L/../../7/00 | |
201 | /dev/arcmsr0 \-d areca,2 \-a \-s L/../../7/01 | |
202 | /dev/arcmsr0 \-d areca,3 \-a \-s L/../../7/02 | |
203 | .\" %ENDIF OS FreeBSD | |
204 | .\" %IF OS Linux | |
205 | # | |
206 | # Two SATA disks on an Intelliprop controller. | |
207 | # Start short self\-tests daily between 1\-2, 2\-3, and | |
208 | # 3\-4 am. | |
209 | /dev/sde \-d intelliprop,0+sat \-a \-s S/../.././01 | |
210 | /dev/sde \-d intelliprop,1+sat \-a \-s S/../.././02 | |
211 | .\" %ENDIF OS Linux | |
212 | # | |
213 | # The following line enables monitoring of the | |
214 | # ATA Error Log and the Self\-Test Error Log. | |
215 | # It also tracks changes in both Prefailure | |
216 | # and Usage Attributes, apart from Attributes | |
217 | # 9, 194, and 231, and shows continued lines: | |
218 | # | |
219 | /dev/sdd\ \-l\ error\ \e | |
220 | \ \ \ \ \ \-l\ selftest\ \e | |
221 | \ \ \ \ \ \-t\ \e\ \ \ \ \ \ \ \ \ # Attributes not tracked: | |
222 | \ \ \ \ \ \-I\ 194\ \e\ \ \ \ \ # temperature | |
223 | \ \ \ \ \ \-I\ 231\ \e\ \ \ \ \ # also temperature | |
224 | \ \ \ \ \ \-I\ 9\ \ \ \ \ \ \ \ \ # power\-on hours | |
225 | # | |
226 | ################################################ | |
227 | .Ve | |
228 | .Sp | |
229 | .SH DEVICESCAN | |
230 | If a non-comment entry in the configuration file is the text string | |
231 | .B DEVICESCAN | |
232 | in capital letters, then | |
233 | \fBsmartd\fP | |
234 | will ignore any remaining lines in the configuration file, and will | |
235 | scan for devices. | |
236 | If | |
237 | .B DEVICESCAN | |
238 | is not followed by any Directives, then \*(Aq\-a\*(Aq will apply to all | |
239 | devices. | |
240 | .PP | |
241 | .B DEVICESCAN | |
242 | may optionally be followed by Directives that will apply to all | |
243 | devices that are found in the scan. | |
244 | For example | |
245 | .PP | |
246 | .Vb | |
247 | \ \ DEVICESCAN \-m root@example.com | |
248 | .Ve | |
249 | .PP | |
250 | will scan for all devices, and then monitor them. | |
251 | It will send one email warning per device for any problems that are found. | |
252 | .PP | |
253 | .Vb | |
254 | \ \ DEVICESCAN \-H \-m root@example.com | |
255 | .Ve | |
256 | .PP | |
257 | will do the same, but only monitors the SMART health status of the | |
258 | devices, rather than the default \*(Aq\-a\*(Aq. | |
259 | .PP | |
260 | Multiple \*(Aq\-d TYPE\*(Aq options may be specified with DEVICESCAN | |
261 | to combine the scan results of more than one TYPE. | |
262 | .PP | |
263 | Configuration entries for specific devices may precede the \fBDEVICESCAN\fP | |
264 | entry. | |
265 | For example | |
266 | .PP | |
267 | .Vb 4 | |
268 | \ \ DEFAULT \-m root@example.com | |
269 | \ \ /dev/sda \-s S/../.././02 | |
270 | \ \ /dev/sdc \-d ignore | |
271 | \ \ DEVICESCAN \-s L/../.././02 | |
272 | .Ve | |
273 | .PP | |
274 | will scan for all devices except /dev/sda and /dev/sdc, monitor them, and | |
275 | run a long test between 2\(en3 am every morning. | |
276 | Device /dev/sda will also be monitored, but only a short test will be run. | |
277 | Device /dev/sdc will be ignored. | |
278 | Warning emails will be sent for all monitored devices. | |
279 | .PP | |
280 | A device is ignored by DEVICESCAN if a configuration line with the same | |
281 | device name exists. | |
282 | .br | |
283 | [NEW EXPERIMENTAL SMARTD FEATURE] | |
284 | A device name is also ignored if another device with same identify | |
285 | information (vendor, model, firmware version, serial number, WWN) already | |
286 | exists. | |
287 | .Sp | |
288 | .SH DEFAULT SETTINGS | |
289 | If an entry in the configuration file starts with | |
290 | .B DEFAULT | |
291 | instead of a device name, then all directives in this entry are set | |
292 | as defaults for the next device entries. | |
293 | .PP | |
294 | This configuration: | |
295 | .PP | |
296 | .Vb 7 | |
297 | \ \ DEFAULT \-a \-R5! \-W 2,40,45 \-I 194 \-s L/../../7/00 \-m admin@example.com | |
298 | \ \ /dev/sda | |
299 | \ \ /dev/sdb | |
300 | \ \ /dev/sdc | |
301 | \ \ DEFAULT \-H \-m admin@example.com | |
302 | \ \ /dev/sdd | |
303 | \ \ /dev/sde \-d removable | |
304 | .Ve | |
305 | .PP | |
306 | has the same effect as: | |
307 | .PP | |
308 | .Vb 5 | |
309 | \ \ /dev/sda \-a \-R5! \-W 2,40,45 \-I 194 \-s L/../../7/00 \-m admin@example.com | |
310 | \ \ /dev/sdb \-a \-R5! \-W 2,40,45 \-I 194 \-s L/../../7/00 \-m admin@example.com | |
311 | \ \ /dev/sdc \-a \-R5! \-W 2,40,45 \-I 194 \-s L/../../7/00 \-m admin@example.com | |
312 | \ \ /dev/sdd \-H \-m admin@example.com | |
313 | \ \ /dev/sde \-d removable \-H \-m admin@example.com | |
314 | .Ve | |
315 | .Sp | |
316 | .SH CONFIGURATION FILE DIRECTIVES | |
317 | The following are the Directives that may appear following the device | |
318 | name or | |
319 | .B DEVICESCAN | |
320 | or | |
321 | .B DEFAULT | |
322 | on any line of the | |
323 | .B /usr/local/etc/smartd.conf | |
324 | configuration file. Note that | |
325 | .B these are NOT command-line options for | |
326 | \fBsmartd\fP. | |
327 | The Directives below may appear in any order, following the device | |
328 | name. | |
329 | .PP | |
330 | .B For an ATA device, | |
331 | if no Directives appear, then the device will be monitored | |
332 | as if the \*(Aq\-a\*(Aq Directive (monitor all SMART properties) had been given. | |
333 | .PP | |
334 | .B If a SCSI disk is listed, | |
335 | it will be monitored at the maximum implemented level: roughly | |
336 | equivalent to using the \*(Aq\-H \-l selftest\*(Aq options for an ATA disk. | |
337 | So with the exception of \*(Aq\-d\*(Aq, \*(Aq\-m\*(Aq, \*(Aq\-l selftest\*(Aq, | |
338 | \*(Aq\-s\*(Aq, and \*(Aq\-M\*(Aq, the Directives below are ignored for SCSI disks. | |
339 | For SCSI disks, the \*(Aq\-m\*(Aq Directive sends a warning email if the SMART | |
340 | status indicates a disk failure or problem, if the SCSI inquiry about disk | |
341 | status fails, or if new errors appear in the self-test log. | |
342 | .\" %IF OS FreeBSD Linux | |
343 | .PP | |
344 | .B If a 3ware controller is used | |
345 | then the corresponding SCSI (/dev/sd?) or character device (/dev/twe?, | |
346 | /dev/twa?, /dev/twl? or /dev/tws?) must be listed, along with the | |
347 | \*(Aq\-d 3ware,N\*(Aq Directive (see below). | |
348 | The individual ATA disks hosted by the 3ware controller appear to \fBsmartd\fP | |
349 | as normal ATA devices. | |
350 | Hence all the ATA directives can be used for these disks (but see note below). | |
351 | .PP | |
352 | .B If an Areca controller is used | |
353 | then the corresponding device (SCSI /dev/sg? on Linux or /dev/arcmsr0 on | |
354 | FreeBSD) must be listed, along with the \*(Aq\-d areca,N\*(Aq Directive | |
355 | (see below). | |
356 | The individual SATA disks hosted by the Areca controller appear to \fBsmartd\fP | |
357 | as normal ATA devices. Hence all the ATA directives can be used for | |
358 | these disks. Areca firmware version 1.46 or later which supports | |
359 | smartmontools must be used; Please see the \fBsmartctl\fP(8) man page | |
360 | for further details. | |
361 | .\" %ENDIF OS FreeBSD Linux | |
362 | .TP | |
363 | .B \-d TYPE | |
364 | Specifies the type of the device. | |
365 | The valid arguments to this directive are: | |
366 | .Sp | |
367 | .I auto | |
368 | \- attempt to guess the device type from the device name or from | |
369 | controller type info provided by the operating system or from | |
370 | a matching USB ID entry in the drive database. | |
371 | This is the default. | |
372 | .Sp | |
373 | .I ata | |
374 | \- the device type is ATA. This prevents | |
375 | \fBsmartd\fP | |
376 | from issuing SCSI commands to an ATA device. | |
377 | .Sp | |
378 | .\" %IF NOT OS Darwin | |
379 | .I scsi | |
380 | \- the device type is SCSI. This prevents | |
381 | \fBsmartd\fP | |
382 | from issuing ATA commands to a SCSI device. | |
383 | .Sp | |
384 | .\" %ENDIF NOT OS Darwin | |
385 | .\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
386 | .I nvme[,NSID] | |
387 | \- the device type is NVM Express (NVMe). | |
388 | The optional parameter NSID specifies the namespace id (in hex) passed | |
389 | to the driver. | |
390 | Use 0xffffffff for the broadcast namespace id. | |
391 | The default for NSID is the namespace id addressed by the device name. | |
392 | .Sp | |
393 | .\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
394 | .\" %IF NOT OS Darwin | |
395 | .I sat[,auto][,N] | |
396 | \- the device type is SCSI to ATA Translation (SAT). | |
397 | This is for ATA disks that have a SCSI to ATA Translation Layer (SATL) | |
398 | between the disk and the operating system. | |
399 | SAT defines two ATA PASS THROUGH SCSI commands, one 12 bytes long and | |
400 | the other 16 bytes long. The default is the 16 byte variant which can be | |
401 | overridden with either \*(Aq\-d sat,12\*(Aq or \*(Aq\-d sat,16\*(Aq. | |
402 | .Sp | |
403 | If \*(Aq\-d sat,auto\*(Aq is specified, device type SAT (for ATA/SATA disks) | |
404 | is only used if the SCSI INQUIRY data reports a SATL (VENDOR: "ATA "). | |
405 | Otherwise device type SCSI (for SCSI/SAS disks) is used. | |
406 | .Sp | |
407 | .I usbcypress | |
408 | \- this device type is for ATA disks that are behind a Cypress USB to PATA | |
409 | bridge. This will use the ATACB proprietary scsi pass through command. | |
410 | The default SCSI operation code is 0x24, but although it can be overridden | |
411 | with \*(Aq\-d usbcypress,0xN\*(Aq, where N is the scsi operation code, | |
412 | you're running the risk of damage to the device or filesystems on it. | |
413 | .Sp | |
414 | .I usbjmicron[,p][,x][,PORT] | |
415 | \- this device type is for SATA disks that are behind a JMicron USB to | |
416 | PATA/SATA bridge. | |
417 | The 48-bit ATA commands (required e.g.\& for \*(Aq\-l xerror\*(Aq, see below) | |
418 | do not work with all of these bridges and are therefore disabled by default. | |
419 | These commands can be enabled by \*(Aq\-d usbjmicron,x\*(Aq. | |
420 | If two disks are connected to a bridge with two ports, an error message is | |
421 | printed if no PORT is specified. | |
422 | The port can be specified by \*(Aq\-d usbjmicron[,x],PORT\*(Aq where PORT is 0 | |
423 | (master) or 1 (slave). This is not necessary if the device uses a port | |
424 | multiplier to connect multiple disks to one port. The disks appear under | |
425 | separate /dev/ice names then. | |
426 | CAUTION: Specifying \*(Aq,x\*(Aq for a device which does not support it results | |
427 | in I/O errors and may disconnect the drive. The same applies if the specified | |
428 | PORT does not exist or is not connected to a disk. | |
429 | .Sp | |
430 | The Prolific PL2507/3507 USB bridges with older firmware support a pass-through | |
431 | command similar to JMicron and work with \*(Aq\-d usbjmicron,0\*(Aq. | |
432 | Newer Prolific firmware requires a modified command which can be selected by | |
433 | \*(Aq\-d usbjmicron,p\*(Aq. | |
434 | Note that this does not yet support the SMART status command. | |
435 | .Sp | |
436 | .I usbprolific | |
437 | \- this device type is for SATA disks that are behind a Prolific | |
438 | PL2571/2771/2773/2775 USB to SATA bridge. | |
439 | .Sp | |
440 | .I usbsunplus | |
441 | \- this device type is for SATA disks that are behind a SunplusIT USB to SATA | |
442 | bridge. | |
443 | .Sp | |
444 | .I sntjmicron[,NSID] | |
445 | \- [NEW EXPERIMENTAL SMARTD FEATURE] | |
446 | this device type is for NVMe disks that are behind a JMicron USB to NVMe | |
447 | bridge. | |
448 | The optional parameter NSID specifies the namespace id (in hex) passed | |
449 | to the driver. | |
450 | The default namespace id is the broadcast namespace id (0xffffffff). | |
451 | .Sp | |
452 | .\" %ENDIF NOT OS Darwin | |
453 | .\" %IF OS Linux | |
454 | .I marvell | |
455 | \- [Linux only] interact with SATA disks behind Marvell chip-set | |
456 | controllers (using the Marvell rather than libata driver). | |
457 | .Sp | |
458 | .I megaraid,N | |
459 | \- [Linux only] the device consists of one or more SCSI/SAS disks connected | |
460 | to a MegaRAID controller. The non-negative integer N (in the range of 0 to | |
461 | 127 inclusive) denotes which disk on the controller is monitored. | |
462 | This interface will also work for Dell PERC controllers. | |
463 | In log files and email messages this disk will be identified as | |
464 | megaraid_disk_XXX with XXX in the range from 000 to 127 inclusive. | |
465 | It is possible to set RAID device name as /dev/bus/N, where N is a SCSI bus | |
466 | number. | |
467 | Please see the \fBsmartctl\fP(8) man page for further details. | |
468 | .Sp | |
469 | .\" %ENDIF OS Linux | |
470 | .\" %IF OS Linux Windows Cygwin | |
471 | .I aacraid,H,L,ID | |
472 | \- [Linux, Windows and Cygwin only] the device consists of one or more | |
473 | SCSI/SAS or SATA disks connected to an AacRaid controller. | |
474 | The non-negative integers H,L,ID (Host number, Lun, ID) denote which disk | |
475 | on the controller is monitored. | |
476 | In log files and email messages this disk will be identified as | |
477 | aacraid_disk_HH_LL_ID. | |
478 | Please see the \fBsmartctl\fP(8) man page for further details. | |
479 | .Sp | |
480 | .\" %ENDIF OS Linux Windows Cygwin | |
481 | .\" %IF OS FreeBSD Linux | |
482 | .I 3ware,N | |
483 | \- [FreeBSD and Linux only] the device consists of one or more ATA disks | |
484 | connected to a 3ware RAID controller. The non-negative integer N | |
485 | (in the range from 0 to 127 inclusive) denotes which disk on the controller | |
486 | is monitored. | |
487 | In log files and email messages this disk will be identified as 3ware_disk_XXX | |
488 | with XXX in the range from 000 to 127 inclusive. | |
489 | .Sp | |
490 | Note that while you may use \fBany\fP of the 3ware SCSI logical devices /dev/tw* | |
491 | to address \fBany\fP of the physical disks (3ware ports), error and log | |
492 | messages will make the most sense if you always list the 3ware SCSI | |
493 | logical device corresponding to the particular physical disks. | |
494 | Please see the \fBsmartctl\fP(8) man page for further details. | |
495 | .Sp | |
496 | .\" %ENDIF OS FreeBSD Linux | |
497 | .\" %IF OS FreeBSD Linux Windows Cygwin | |
498 | .I areca,N | |
499 | \- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one or | |
500 | more SATA disks connected to an Areca SATA RAID controller. | |
501 | The positive integer N (in the range from 1 to 24 inclusive) denotes which | |
502 | disk on the controller is monitored. | |
503 | In log files and email messages this disk will be identified as | |
504 | areca_disk_XX with XX in the range from 01 to 24 inclusive. | |
505 | Please see the \fBsmartctl\fP(8) man page for further details. | |
506 | .Sp | |
507 | .I areca,N/E | |
508 | \- [FreeBSD, Linux, Windows and Cygwin only] the device consists of one | |
509 | or more SATA or SAS disks connected to an Areca SAS RAID controller. | |
510 | The integer N (range 1 to 128) denotes the channel (slot) and E (range | |
511 | 1 to 8) denotes the enclosure. | |
512 | Important: This requires Areca SAS controller firmware version 1.51 or later. | |
513 | .Sp | |
514 | .\" %ENDIF OS FreeBSD Linux Windows Cygwin | |
515 | .\" %IF OS FreeBSD Linux | |
516 | .I cciss,N | |
517 | \- [FreeBSD and Linux only] the device consists of one or more SCSI/SAS or | |
518 | SATA disks connected to a cciss RAID controller. | |
519 | The non-negative integer N (in the range from 0 to 15 inclusive) denotes | |
520 | which disk on the controller is monitored. | |
521 | In log files and email messages this disk will be identified as cciss_disk_XX | |
522 | with XX in the range from 00 to 15 inclusive. | |
523 | Please see the \fBsmartctl\fP(8) man page for further details. | |
524 | .Sp | |
525 | .I hpt,L/M/N | |
526 | \- [FreeBSD and Linux only] the device consists of one or more ATA disks | |
527 | connected to a HighPoint RocketRAID controller. The integer L is the | |
528 | controller id, the integer M is the channel number, and the integer N | |
529 | is the PMPort number if it is available. The allowed values of L are | |
530 | from 1 to 4 inclusive, M are from 1 to 128 inclusive and N from 1 to 4 | |
531 | if PMPort available. And also these values are limited by the model | |
532 | of the HighPoint RocketRAID controller. | |
533 | In log files and email messages this disk will be identified as | |
534 | hpt_X/X/X and X/X/X is the same as L/M/N, note if no N indicated, N set | |
535 | to the default value 1. | |
536 | Please see the \fBsmartctl\fP(8) man page for further details. | |
537 | .Sp | |
538 | .\" %ENDIF OS FreeBSD Linux | |
539 | .I intelliprop,N[+TYPE] | |
540 | \- [NEW EXPERIMENTAL SMARTD FEATURE] the device consists of multiple ATA | |
541 | disks connected to an Intelliprop controller. | |
542 | The integer N is the port number from 0 to 3 of the ATA drive to be targeted. | |
543 | Please see the \fBsmartctl\fP(8) man page for further details. | |
544 | .Sp | |
545 | .I ignore | |
546 | \- the device specified by this configuration entry should be ignored. | |
547 | This allows to ignore specific devices which are detected by a following | |
548 | DEVICESCAN configuration line. | |
549 | It may also be used to temporary disable longer multi-line configuration entries. | |
550 | This Directive may be used in conjunction with the other \*(Aq\-d\*(Aq | |
551 | Directives. | |
552 | .Sp | |
553 | .I removable | |
554 | \- the device or its media is removable. This indicates to | |
555 | \fBsmartd\fP | |
556 | that it should continue (instead of exiting, which is the default | |
557 | behavior) if the device does not appear to be present when | |
558 | \fBsmartd\fP is started. This Directive may be used in conjunction | |
559 | with the other \*(Aq\-d\*(Aq Directives. | |
560 | [NEW EXPERIMENTAL SMARTD FEATURE] | |
561 | This directive also suppresses warning emails and repeated log messages | |
562 | if the device is removed after startup. | |
563 | \fBWARNING: Removing a device and connecting a different one to same interface | |
564 | is not supported and may result in bogus warnings until smartd is restarted.\fP | |
565 | .TP | |
566 | .B \-n POWERMODE[,N][,q] | |
567 | [ATA only] This \*(Aqnocheck\*(Aq Directive is used to prevent a disk from | |
568 | being spun-up when it is periodically polled by \fBsmartd\fP. | |
569 | .Sp | |
570 | ATA disks have five different power states. In order of increasing | |
571 | power consumption they are: \*(AqOFF\*(Aq, \*(AqSLEEP\*(Aq, | |
572 | \*(AqSTANDBY\*(Aq, \*(AqIDLE\*(Aq, and \*(AqACTIVE\*(Aq. | |
573 | Typically in the OFF, SLEEP, and STANDBY modes the disk's platters are not | |
574 | spinning. | |
575 | But usually, in response to SMART commands issued by \fBsmartd\fP, the disk | |
576 | platters are spun up. | |
577 | So if this option is not used, then a disk which is in a low-power mode may | |
578 | be spun up and put into a higher-power mode when it is periodically | |
579 | polled by \fBsmartd\fP. | |
580 | .Sp | |
581 | Note that if the disk is in SLEEP mode when \fBsmartd\fP is started, | |
582 | then it won't respond to \fBsmartd\fP commands, and so the disk won't | |
583 | be registered as a device for \fBsmartd\fP to monitor. If a disk is in | |
584 | any other low-power mode, then the commands issued by \fBsmartd\fP to | |
585 | register the disk will probably cause it to spin-up. | |
586 | .Sp | |
587 | The \*(Aq\fB\-n\fP\*(Aq (nocheck) Directive specifies if \fBsmartd\fP's | |
588 | periodic checks should still be carried out when the device is in a | |
589 | low-power mode. It may be used to prevent a disk from being spun-up | |
590 | by periodic \fBsmartd\fP polling. The allowed values of POWERMODE | |
591 | are: | |
592 | .Sp | |
593 | .I never | |
594 | \- \fBsmartd\fP will poll (check) the device regardless of its power | |
595 | mode. This may cause a disk which is spun-down to be spun-up when | |
596 | \fBsmartd\fP checks it. This is the default behavior if the '\-n' | |
597 | Directive is not given. | |
598 | .Sp | |
599 | .I sleep | |
600 | \- check the device unless it is in SLEEP mode. | |
601 | .Sp | |
602 | .I standby | |
603 | \- check the device unless it is in SLEEP or STANDBY mode. In | |
604 | these modes most disks are not spinning, so if you want to prevent | |
605 | a laptop disk from spinning up each time that \fBsmartd\fP polls, | |
606 | this is probably what you want. | |
607 | .Sp | |
608 | .I idle | |
609 | \- check the device unless it is in SLEEP, STANDBY or IDLE mode. | |
610 | In the IDLE state, most disks are still spinning, so this is probably | |
611 | not what you want. | |
612 | .Sp | |
613 | Maximum number of skipped checks (in a row) can be specified by | |
614 | appending positive number \*(Aq,N\*(Aq to POWERMODE (like | |
615 | \*(Aq\-n standby,15\*(Aq). | |
616 | After N checks are skipped in a row, powermode is ignored and the | |
617 | check is performed anyway. | |
618 | .Sp | |
619 | When a periodic test is skipped, \fBsmartd\fP normally writes an | |
620 | informal log message. The message can be suppressed by appending | |
621 | the option \*(Aq,q\*(Aq to POWERMODE (like \*(Aq\-n standby,q\*(Aq). | |
622 | This prevents a laptop disk from spinning up due to this message. | |
623 | .Sp | |
624 | Both \*(Aq,N\*(Aq and \*(Aq,q\*(Aq can be specified together. | |
625 | .TP | |
626 | .B \-T TYPE | |
627 | Specifies how tolerant | |
628 | \fBsmartd\fP | |
629 | should be of SMART command failures. The valid arguments to this | |
630 | Directive are: | |
631 | .Sp | |
632 | .I normal | |
633 | \- do not try to monitor the disk if a mandatory SMART command fails, but | |
634 | continue if an optional SMART command fails. This is the default. | |
635 | .Sp | |
636 | .I permissive | |
637 | \- try to monitor the disk even if it appears to lack SMART | |
638 | capabilities. This may be required for some old disks (prior to | |
639 | ATA-3 revision 4) that implemented SMART before the SMART standards | |
640 | were incorporated into the ATA/ATAPI Specifications. | |
641 | [Please see the \fBsmartctl \-T\fP command-line option.] | |
642 | .TP | |
643 | .B \-o VALUE | |
644 | [ATA only] Enables or disables SMART Automatic Offline Testing when | |
645 | \fBsmartd\fP | |
646 | starts up and has no further effect. The valid arguments to this | |
647 | Directive are \fIon\fP and \fIoff\fP. | |
648 | .Sp | |
649 | The delay between tests is vendor-specific, but is typically four | |
650 | hours. | |
651 | .Sp | |
652 | Note that SMART Automatic Offline Testing is \fBnot\fP part of the ATA | |
653 | Specification. Please see the | |
654 | .B smartctl \-o | |
655 | command-line option documentation for further information about this | |
656 | feature. | |
657 | .TP | |
658 | .B \-S VALUE | |
659 | Enables or disables Attribute Autosave when \fBsmartd\fP | |
660 | starts up and has no further effect. The valid arguments to this | |
661 | Directive are \fIon\fP and \fIoff\fP. Also affects SCSI devices. | |
662 | [Please see the \fBsmartctl \-S\fP command-line option.] | |
663 | .TP | |
664 | .B \-H | |
665 | [ATA] Check the health status of the disk with the SMART RETURN | |
666 | STATUS command. | |
667 | If this command reports a failing health status, then disk | |
668 | failure is predicted in less than 24 hours, and a message at loglevel | |
669 | .B \*(AqLOG_CRIT\*(Aq | |
670 | will be logged to syslog. [Please see the | |
671 | .B smartctl \-H | |
672 | command-line option.] | |
673 | .\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
674 | .Sp | |
675 | [NVMe] Checks the "Critical Warning" byte from the SMART/Health | |
676 | Information log. | |
677 | If any warning bit is set, a message at loglevel \fB\*(AqLOG_CRIT\*(Aq\fP | |
678 | will be logged to syslog. | |
679 | .\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
680 | .TP | |
681 | .B \-l TYPE | |
682 | Reports increases in the number of errors in one of three SMART logs. The | |
683 | valid arguments to this Directive are: | |
684 | .Sp | |
685 | .I error | |
686 | \- [ATA] report if the number of ATA errors reported in the Summary SMART | |
687 | error log has increased since the last check. | |
688 | .Sp | |
689 | .\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
690 | .I error | |
691 | \- [NVMe] report if the "Number of Error Information Log Entries" from the | |
692 | SMART/Health Information log has increased since the last check. | |
693 | .Sp | |
694 | .\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
695 | .I xerror | |
696 | \- [ATA] report if the number of ATA errors reported in the Extended | |
697 | Comprehensive SMART error log has increased since the last check. | |
698 | .Sp | |
699 | If both \*(Aq\-l error\*(Aq and \*(Aq\-l xerror\*(Aq are specified, smartd | |
700 | checks the maximum of both values. | |
701 | .Sp | |
702 | [Please see the \fBsmartctl \-l xerror\fP command-line option.] | |
703 | .Sp | |
704 | .\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
705 | .I xerror | |
706 | \- [NVMe] same as \*(Aq\-l error\*(Aq. | |
707 | .\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
708 | .Sp | |
709 | .I selftest | |
710 | \- report if the number of failed tests reported in the SMART | |
711 | Self-Test Log has increased since the last check, or if the timestamp | |
712 | associated with the most recent failed test has increased. Note that | |
713 | such errors will \fBonly\fP be logged if you run self-tests on the | |
714 | disk (and it fails a test!). Self-Tests can be run automatically by | |
715 | \fBsmartd\fP: please see the \*(Aq\-s\*(Aq Directive below. | |
716 | Self-Tests can also be run manually by using the \*(Aq\-t short\*(Aq | |
717 | and \fB\*(Aq\-t\ long\*(Aq\fP options of \fBsmartctl\fP and the results of | |
718 | the testing can be observed using the \fBsmartctl \*(Aq\-l\ selftest\*(Aq\fP | |
719 | command-line option. | |
720 | [Please see the \fBsmartctl \-l\fP and \fB\-t\fP command-line | |
721 | options.] | |
722 | .Sp | |
723 | [ATA only] Failed self-tests outdated by a newer successful extended | |
724 | self-test are ignored. The warning email counter is reset if the | |
725 | number of failed self tests dropped to 0. This typically happens when | |
726 | an extended self-test is run after all bad sectors have been reallocated. | |
727 | .Sp | |
728 | .I offlinests[,ns] | |
729 | \- [ATA only] report if the Offline Data Collection status has changed | |
730 | since the last check. The report will be logged as LOG_CRIT if the new | |
731 | status indicates an error. With some drives the status often changes, | |
732 | therefore \*(Aq\-l offlinests\*(Aq is not enabled by \*(Aq\-a\*(Aq Directive. | |
733 | .\" %IF NOT OS Cygwin Windows | |
734 | .\"! Appending ',ns' (no standby) to this directive is not implemented | |
735 | .\"! on OS_MAN_FILTER. | |
736 | .\" %ENDIF NOT OS Cygwin Windows | |
737 | .\" %IF OS Cygwin Windows | |
738 | .Sp | |
739 | [Windows and Cygwin only] If \*(Aq,ns\*(Aq (no standby) is appended to this | |
740 | directive, smartd disables system auto standby as long as an Offline | |
741 | Data Collection is in progress. See \*(Aq\-l selfteststs,ns\*(Aq below. | |
742 | .\" %ENDIF OS Cygwin Windows | |
743 | .Sp | |
744 | .I selfteststs[,ns] | |
745 | \- [ATA only] report if the Self-Test execution status has changed | |
746 | since the last check. The report will be logged as LOG_CRIT if the new | |
747 | status indicates an error. | |
748 | .\" %IF NOT OS Cygwin Windows | |
749 | .\"! Appending ',ns' (no standby) to this directive is not implemented | |
750 | .\"! on OS_MAN_FILTER. | |
751 | .\" %ENDIF NOT OS Cygwin Windows | |
752 | .\" %IF OS Cygwin Windows | |
753 | .Sp | |
754 | [Windows and Cygwin only] If \*(Aq,ns\*(Aq (no standby) is appended to this | |
755 | directive, smartd disables system auto standby as long as a Self-Test | |
756 | is in progress. This prevents that a Self-Test is aborted because the | |
757 | OS sets the system to a standby/sleep mode when idle. Smartd check | |
758 | interval (\*(Aq\-i\*(Aq option) should be shorter than the configured idle | |
759 | timeout. Auto standby is not disabled if the system is running on | |
760 | battery. | |
761 | .\" %ENDIF OS Cygwin Windows | |
762 | .Sp | |
763 | .I scterc,READTIME,WRITETIME | |
764 | \- [ATA only] sets the SCT Error Recovery Control settings to the specified | |
765 | values (deciseconds) when \fBsmartd\fP starts up and has no further effect. | |
766 | Values of 0 disable the feature, other values less than 65 are probably | |
767 | not supported. For RAID configurations, this is typically set to | |
768 | 70,70 deciseconds. | |
769 | [Please see the \fBsmartctl \-l scterc\fP command-line option.] | |
770 | .TP | |
771 | .B \-e NAME[,VALUE] | |
772 | Sets non-SMART device settings when \fBsmartd\fP starts up and has no | |
773 | further effect. | |
774 | [Please see the \fBsmartctl \-\-set\fP command-line option.] | |
775 | Valid arguments are: | |
776 | .Sp | |
777 | .I aam,[N|off] | |
778 | \- [ATA only] Sets the Automatic Acoustic Management (AAM) feature. | |
779 | .Sp | |
780 | .I apm,[N|off] | |
781 | \- [ATA only] Sets the Advanced Power Management (APM) feature. | |
782 | .Sp | |
783 | .I lookahead,[on|off] | |
784 | \- [ATA only] Sets the read look-ahead feature. | |
785 | .Sp | |
786 | .I security-freeze | |
787 | \- [ATA only] Sets ATA Security feature to frozen mode. | |
788 | .Sp | |
789 | .I standby,[N|off] | |
790 | \- [ATA only] Sets the standby (spindown) timer and places the drive in the | |
791 | IDLE mode. | |
792 | .Sp | |
793 | .I wcache,[on|off] | |
794 | \- [ATA only] Sets the volatile write cache feature. | |
795 | .Sp | |
796 | .I dsn,[on|off] | |
797 | \- [ATA only] | |
798 | [NEW EXPERIMENTAL SMARTD FEATURE] | |
799 | Sets the DSN feature. | |
800 | .TP | |
801 | .B \-s REGEXP | |
802 | Run Self-Tests or Offline Immediate Tests, at scheduled times. A | |
803 | Self- or Offline Immediate Test will be run at the end of periodic | |
804 | device polling, if all 12 characters of the string \fBT/MM/DD/d/HH\fP | |
805 | match the extended regular expression \fBREGEXP\fP. Here: | |
806 | .RS 7 | |
807 | .IP \fBT\fP 4 | |
808 | is the type of the test. The values that \fBsmartd\fP will try to | |
809 | match (in turn) are: \*(AqL\*(Aq for a \fBL\fPong Self-Test, \*(AqS\*(Aq for a | |
810 | \fBS\fPhort Self-Test, \*(AqC\*(Aq for a \fBC\fPonveyance Self-Test (ATA | |
811 | only), and \*(AqO\*(Aq for an \fBO\fPffline Immediate Test (ATA only). As | |
812 | soon as a match is found, the test will be started and no additional | |
813 | matches will be sought for that device and that polling cycle. | |
814 | .Sp | |
815 | To run scheduled Selective Self-Tests, use \*(Aqn\*(Aq for \fBn\fPext span, | |
816 | \*(Aqr\*(Aq to \fBr\fPedo last span, or \*(Aqc\*(Aq to \fBc\fPontinue with | |
817 | next span or redo last span based on status of last test. | |
818 | The LBA range is based on the first span from the last test. | |
819 | See the \fBsmartctl \-t select,[next|redo|cont]\fP options for | |
820 | further info. | |
821 | .Sp | |
822 | Some disks (e.g.\& WD) do not preserve the selective self test log across | |
823 | power cycles. If state persistence (\*(Aq\-s\*(Aq option) is enabled, the last | |
824 | test span is preserved by smartd and used if (and only if) the selective | |
825 | self test log is empty. | |
826 | .IP \fBMM\fP 4 | |
827 | is the month of the year, expressed with two decimal digits. The | |
828 | range is from 01 (January) to 12 (December) inclusive. Do \fBnot\fP | |
829 | use a single decimal digit or the match will always fail! | |
830 | .IP \fBDD\fP 4 | |
831 | is the day of the month, expressed with two decimal digits. The | |
832 | range is from 01 to 31 inclusive. Do \fBnot\fP | |
833 | use a single decimal digit or the match will always fail! | |
834 | .IP \fBd\fP 4 | |
835 | is the day of the week, expressed with one decimal digit. The | |
836 | range is from 1 (Monday) to 7 (Sunday) inclusive. | |
837 | .IP \fBHH\fP 4 | |
838 | is the hour of the day, written with two decimal digits, and given in | |
839 | hours after midnight. The range is 00 (midnight to just before 1 am) | |
840 | to 23 (11pm to just before midnight) inclusive. Do \fBnot\fP use a | |
841 | single decimal digit or the match will always fail! | |
842 | .RE | |
843 | .\" The following two lines are a workaround for a man2html bug. Please leave them. | |
844 | .\" They define a non-existent option; useful because man2html can't correctly reset the margins. | |
845 | .TP | |
846 | .B \& | |
847 | Some examples follow. In reading these, keep in mind that in extended | |
848 | regular expressions a dot \fB\*(Aq.\*(Aq\fP matches any single character, and | |
849 | a parenthetical expression such as \fB\*(Aq(A|B|C)\*(Aq\fP denotes any one | |
850 | of the three possibilities \fBA\fP, \fBB\fP, or \fBC\fP. | |
851 | .Sp | |
852 | To schedule a short Self-Test between 2\(en3 am every morning, use: | |
853 | .br | |
854 | \fB \-s S/../.././02\fP | |
855 | .br | |
856 | To schedule a long Self-Test between 4\(en5 am every Sunday morning, use: | |
857 | .br | |
858 | \fB \-s L/../../7/04\fP | |
859 | .br | |
860 | To schedule a long Self-Test between 10\(en11 pm on the first and | |
861 | fifteenth day of each month, use: | |
862 | .br | |
863 | \fB \-s L/../(01|15)/./22\fP | |
864 | .br | |
865 | To schedule an Offline Immediate test after every midnight, 6 am, | |
866 | noon, and 6 pm, plus a Short Self-Test daily at 1\(en2 am and a Long | |
867 | Self-Test every Saturday at 3\(en4 am, use: | |
868 | .br | |
869 | \fB \-s (O/../.././(00|06|12|18)|S/../.././01|L/../../6/03)\fP | |
870 | .br | |
871 | If Long Self-Tests of a large disks take longer than the system uptime, | |
872 | a full disk test can be performed by several Selective Self-Tests. | |
873 | To setup a full test of a 1 TB disk within 20 days (one 50 GB span | |
874 | each day), run this command once: | |
875 | .nf | |
876 | smartctl \-t select,0\-99999999 /dev/sda | |
877 | .fi | |
878 | To run the next test spans on Monday\(enFriday between 12\(en13 am, run smartd | |
879 | with this directive: | |
880 | .br | |
881 | \fB \-s n/../../[1\-5]/12\fP | |
882 | .Sp | |
883 | Scheduled tests are run immediately following the regularly-scheduled | |
884 | device polling, if the current local date, time, and test type, match | |
885 | \fBREGEXP\fP. By default the regularly-scheduled device polling | |
886 | occurs every thirty minutes after starting \fBsmartd\fP. Take caution | |
887 | if you use the \*(Aq\-i\*(Aq option to make this polling interval more than | |
888 | sixty minutes: the poll times may fail to coincide with any of the | |
889 | testing times that you have specified with \fBREGEXP\fP. In this case | |
890 | the test will be run following the next device polling. | |
891 | .Sp | |
892 | Before running an offline or self-test, \fBsmartd\fP checks to be sure | |
893 | that a self-test is not already running. If a self-test \fBis\fP | |
894 | already running, then this running self test will \fBnot\fP be | |
895 | interrupted to begin another test. | |
896 | .Sp | |
897 | \fBsmartd\fP will not attempt to run \fBany\fP type of test if another | |
898 | test was already started or run in the same hour. | |
899 | .Sp | |
900 | To avoid performance problems during system boot, \fBsmartd\fP will | |
901 | not attempt to run any scheduled tests following the very first | |
902 | device polling (unless \*(Aq\-q onecheck\*(Aq is specified). | |
903 | .Sp | |
904 | Each time a test is run, \fBsmartd\fP will log an entry to SYSLOG. | |
905 | You can use these or the \*(Aq\-q showtests\*(Aq command-line option to verify | |
906 | that you constructed \fBREGEXP\fP correctly. The matching order | |
907 | (\fBL\fP before \fBS\fP before \fBC\fP before \fBO\fP) ensures that | |
908 | if multiple test types are all scheduled for the same hour, the | |
909 | longer test type has precedence. This is usually the desired behavior. | |
910 | .Sp | |
911 | If the scheduled tests are used in conjunction with state persistence | |
912 | (\*(Aq\-s\*(Aq option), smartd will also try to match the hours since last | |
913 | shutdown (or 90 days at most). If any test would have been started | |
914 | during downtime, the longest (see above) of these tests is run after | |
915 | second device polling. | |
916 | .Sp | |
917 | If the \*(Aq\-n\*(Aq directive is used and any test would have been started | |
918 | during disk standby time, the longest of these tests is run when the | |
919 | disk is active again. | |
920 | .Sp | |
921 | Unix users: please beware that the rules for extended regular | |
922 | expressions [\fBregex\fP(7)] are \fBnot\fP the same as the rules for | |
923 | file-name pattern matching by the shell [\fBglob\fP(7)]. \fBsmartd\fP will | |
924 | issue harmless informational warning messages if it detects characters | |
925 | in \fBREGEXP\fP that appear to indicate that you have made this | |
926 | mistake. | |
927 | .TP | |
928 | .B \-m ADD | |
929 | Send a warning email to the email address \fBADD\fP if the \*(Aq\-H\*(Aq, | |
930 | \*(Aq\-l\*(Aq, \*(Aq\-f\*(Aq, \*(Aq\-C\*(Aq, or \*(Aq\-O\*(Aq Directives | |
931 | detect a failure or a new error, or if a SMART command to the disk fails. | |
932 | This Directive only works in conjunction with these other Directives | |
933 | (or with the equivalent default \*(Aq\-a\*(Aq Directive). | |
934 | .Sp | |
935 | To prevent your email in-box from getting filled up with warning | |
936 | messages, by default only a single warning and (depending on | |
937 | \*(Aq\-s\*(Aq option) daily reminder emails will be sent for each of | |
938 | the enabled alert types. | |
939 | See the \*(Aq\-M\*(Aq Directive below for details. | |
940 | .Sp | |
941 | To send email to more than one user, please use the following "comma | |
942 | separated" form for the address: \fBuser1@add1,user2@add2,...,userN@addN\fP | |
943 | (with no spaces). | |
944 | .Sp | |
945 | To test that email is being sent correctly, use the \*(Aq\-M test\*(Aq | |
946 | Directive described below to send one test email message on | |
947 | \fBsmartd\fP | |
948 | startup. | |
949 | .Sp | |
950 | By default, email is sent using the system \fBmail\fP(1) command. | |
951 | In order that \fBsmartd\fP find this command (normally /usr/bin/mail) the | |
952 | executable must be in the path of the shell or environment from which | |
953 | \fBsmartd\fP | |
954 | was started. If you wish to specify an explicit path to the mail | |
955 | executable (for example /usr/local/bin/mail) or a custom script to | |
956 | run, please use the \*(Aq\-M exec\*(Aq Directive below. | |
957 | .Sp | |
958 | .\" %IF OS Windows | |
959 | [Windows only] On Windows, the \*(Aq\fBBlat\fP\*(Aq mailer | |
960 | (<\fBhttp://blat.sourceforge.net/\fP>) is used by default. | |
961 | This mailer uses a different command line syntax, see | |
962 | \*(Aq\-M exec\*(Aq below. | |
963 | .Sp | |
964 | [NEW EXPERIMENTAL SMARTD FEATURE] | |
965 | If the file EXEDIR/smartd_mailer.conf.ps1 is present and \*(Aq\-M exec\*(Aq | |
966 | is not specified, the script smartd_mailer.ps1 is used instead. | |
967 | This script uses the Send-MailMessage cmdlet to send mail. | |
968 | See EXEDIR/smartd_mailer.conf.sample.ps1 for info about the format of | |
969 | the configuration file. | |
970 | .Sp | |
971 | .\" %ENDIF OS Windows | |
972 | Note also that there is a special argument | |
973 | .B <nomailer> | |
974 | which can be given to the \*(Aq\-m\*(Aq Directive in conjunction with the | |
975 | \*(Aq\-M exec\*(Aq Directive. | |
976 | Please see below for an explanation of its effect. | |
977 | .Sp | |
978 | If the mailer or the shell running it produces any STDERR/STDOUT | |
979 | output, then a snippet of that output will be copied to SYSLOG. The | |
980 | remainder of the output is discarded. If problems are encountered in | |
981 | sending mail, this should help you to understand and fix them. If | |
982 | you have mail problems, we recommend running \fBsmartd\fP in debug | |
983 | mode with the \*(Aq\-d\*(Aq flag, using the \*(Aq\-M test\*(Aq Directive | |
984 | described below. | |
985 | .\" %IF ENABLE_SMARTDPLUGINDIR | |
986 | .\" %IF NOT OS Windows | |
987 | .Sp | |
988 | If a word of the comma separated list has the form \*(Aq@plugin\*(Aq, a custom | |
989 | script /usr/local/etc/smartd_warning.d/plugin is run and the word is | |
990 | removed from the list before sending mail. The string \*(Aqplugin\*(Aq may | |
991 | be any valid name except \*(AqALL\*(Aq. | |
992 | If \*(Aq@ALL\*(Aq is specified, all scripts in /usr/local/etc/smartd_warning.d/* | |
993 | are run instead. | |
994 | This is handled by the script /usr/local/etc/smartd_warning.sh | |
995 | (see also \*(Aq\-M exec\*(Aq below). | |
996 | .\" %ENDIF NOT OS Windows | |
997 | .\" %ENDIF ENABLE_SMARTDPLUGINDIR | |
998 | .\" %IF OS Windows | |
999 | .Sp | |
1000 | [Windows only] If one of the following words are used as the first address | |
1001 | in the comma separated list, warning messages are sent via WTSSendMessage(). | |
1002 | This displays message boxes on the desktops of the selected sessions. | |
1003 | Address \*(Aq\fBconsole\fP\*(Aq specifies the console session only, | |
1004 | \*(Aq\fBactive\fP\*(Aq specifies the console session and all active remote | |
1005 | sessions, and \*(Aq\fBconnected\fP\*(Aq specifies the console session and | |
1006 | all connected (active or waiting for login) remote sessions. | |
1007 | This is handled by the script EXEDIR/smartd_warning.cmd which runs | |
1008 | the tool EXEDIR/wtssendmsg.exe (see also \*(Aq\-M exec\*(Aq below). | |
1009 | .\" %ENDIF OS Windows | |
1010 | .TP | |
1011 | .B \-M TYPE | |
1012 | These Directives modify the behavior of the | |
1013 | \fBsmartd\fP | |
1014 | email warnings enabled with the \*(Aq\-m\*(Aq email Directive described above. | |
1015 | These \*(Aq\-M\*(Aq Directives only work in conjunction with the \*(Aq\-m\*(Aq | |
1016 | Directive and can not be used without it. | |
1017 | .Sp | |
1018 | Multiple \-M Directives may be given. If more than one of the | |
1019 | following three \-M Directives are given (example: \-M once \-M daily) | |
1020 | then the final one (in the example, \-M daily) is used. | |
1021 | .Sp | |
1022 | The valid arguments to the \-M Directive are (one of the following | |
1023 | three): | |
1024 | .Sp | |
1025 | .I once | |
1026 | \- send only one warning email for each type of disk problem detected. This | |
1027 | is the default unless state persistence (\*(Aq\-s\*(Aq option) is enabled. | |
1028 | .Sp | |
1029 | .I daily | |
1030 | \- send additional warning reminder emails, once per day, for each type | |
1031 | of disk problem detected. This is the default if state persistence | |
1032 | (\*(Aq\-s\*(Aq option) is enabled. | |
1033 | .Sp | |
1034 | .I diminishing | |
1035 | \- send additional warning reminder emails, after a one-day interval, | |
1036 | then a two-day interval, then a four-day interval, and so on for each | |
1037 | type of disk problem detected. Each interval is twice as long as the | |
1038 | previous interval. | |
1039 | .Sp | |
1040 | If a disk problem is no longer detected, the internal email counter is | |
1041 | reset. If the problem reappears a new warning email is sent immediately. | |
1042 | .Sp | |
1043 | In addition, one may add zero or more of the following Directives: | |
1044 | .Sp | |
1045 | .I test | |
1046 | \- send a single test email | |
1047 | immediately upon | |
1048 | \fBsmartd\fP | |
1049 | startup. This allows one to verify that email is delivered correctly. | |
1050 | Note that if this Directive is used, | |
1051 | \fBsmartd\fP | |
1052 | will also send the normal email warnings that were enabled with the | |
1053 | \*(Aq\-m\*(Aq Directive, in addition to the single test email! | |
1054 | .Sp | |
1055 | .I exec PATH | |
1056 | \- run the executable PATH instead of the default mail command, when | |
1057 | \fBsmartd\fP | |
1058 | needs to send email. PATH must point to an executable binary file or | |
1059 | script. | |
1060 | .\" %IF OS Windows | |
1061 | .Sp | |
1062 | [Windows only] The PATH may contain space characters. | |
1063 | Then it must be included in double quotes. | |
1064 | .\" %ENDIF OS Windows | |
1065 | .Sp | |
1066 | By setting PATH to point to a customized script, you can make | |
1067 | \fBsmartd\fP perform useful tricks when a disk problem is detected | |
1068 | (beeping the console, shutting down the machine, broadcasting warnings | |
1069 | to all logged-in users, etc.\&) But please be careful. \fBsmartd\fP | |
1070 | will \fBblock\fP until the executable PATH returns, so if your | |
1071 | executable hangs, then \fBsmartd\fP will also hang. | |
1072 | .\" %IF NOT OS Windows | |
1073 | Some sample scripts are included in | |
1074 | /usr/local/share/doc/smartmontools/examplescripts/. | |
1075 | .\" %ENDIF NOT OS Windows | |
1076 | .Sp | |
1077 | The exit status of the executable is recorded by \fBsmartd\fP in | |
1078 | SYSLOG. | |
1079 | The executable is not expected to write to STDOUT or STDERR. | |
1080 | If it does, then this is interpreted as indicating that | |
1081 | something is going wrong with your executable, and a fragment of this | |
1082 | output is logged to SYSLOG to help you to understand the problem. | |
1083 | Normally, if you wish to leave some record behind, the executable | |
1084 | should send mail or write to a file or device. | |
1085 | .Sp | |
1086 | Before running the executable, \fBsmartd\fP sets a number of | |
1087 | environment variables. These environment variables may be used to | |
1088 | control the executable's behavior. The environment variables | |
1089 | exported by \fBsmartd\fP are: | |
1090 | .RS 7 | |
1091 | .IP \fBSMARTD_MAILER\fP 4 | |
1092 | is set to the argument of \-M exec, if present or else to \*(Aqmail\*(Aq | |
1093 | (examples: /usr/local/bin/mail, mail). | |
1094 | .IP \fBSMARTD_DEVICE\fP 4 | |
1095 | is set to the device path (example: /dev/sda). | |
1096 | .IP \fBSMARTD_DEVICETYPE\fP 4 | |
1097 | is set to the device type specified by \*(Aq\-d\*(Aq directive or | |
1098 | \*(Aqauto\*(Aq if none. | |
1099 | .IP \fBSMARTD_DEVICESTRING\fP 4 | |
1100 | is set to the device description. | |
1101 | It starts with SMARTD_DEVICE and may be followed by an optional controller | |
1102 | identification (example: /dev/sda [SAT]). | |
1103 | The string may contain a space and is NOT quoted. | |
1104 | .IP \fBSMARTD_DEVICEINFO\fP 4 | |
1105 | is set to device identify information. It includes most of the info printed | |
1106 | by \fBsmartctl \-i\fP but uses a brief single line format. | |
1107 | This device info is also logged when \fBsmartd\fP starts up. | |
1108 | The string contains space characters and is NOT quoted. | |
1109 | .IP \fBSMARTD_FAILTYPE\fP 4 | |
1110 | gives the reason for the warning or message email. The possible values that | |
1111 | it takes and their meanings are: | |
1112 | .br | |
1113 | \fIEmailTest\fP: this is an email test message. | |
1114 | .br | |
1115 | \fIHealth\fP: the SMART health status indicates imminent failure. | |
1116 | .br | |
1117 | \fIUsage\fP: a usage Attribute has failed. | |
1118 | .br | |
1119 | \fISelfTest\fP: the number of self-test failures has increased. | |
1120 | .br | |
1121 | \fIErrorCount\fP: the number of errors in the ATA error log has increased. | |
1122 | .br | |
1123 | \fICurrentPendingSector\fP: one of more disk sectors could not be | |
1124 | read and are marked to be reallocated (replaced with spare sectors). | |
1125 | .br | |
1126 | \fIOfflineUncorrectableSector\fP: during off-line testing, or self-testing, | |
1127 | one or more disk sectors could not be read. | |
1128 | .br | |
1129 | \fITemperature\fP: Temperature reached critical limit (see \-W directive). | |
1130 | .br | |
1131 | \fIFailedHealthCheck\fP: the SMART health status command failed. | |
1132 | .br | |
1133 | \fIFailedReadSmartData\fP: the command to read SMART Attribute data failed. | |
1134 | .br | |
1135 | \fIFailedReadSmartErrorLog\fP: the command to read the SMART error log failed. | |
1136 | .br | |
1137 | \fIFailedReadSmartSelfTestLog\fP: the command to read the SMART self-test log | |
1138 | failed. | |
1139 | .br | |
1140 | \fIFailedOpenDevice\fP: the open() command to the device failed. | |
1141 | .IP \fBSMARTD_ADDRESS\fP 4 | |
1142 | is determined by the address argument ADD of the \*(Aq\-m\*(Aq Directive. | |
1143 | If ADD is \fB<nomailer>\fP, then \fBSMARTD_ADDRESS\fP is not set. | |
1144 | Otherwise, it is set to the comma-separated-list of email addresses | |
1145 | given by the argument ADD, with the commas replaced by spaces | |
1146 | (example:admin@example.com root). If more than one email address is | |
1147 | given, then this string will contain space characters and is NOT | |
1148 | quoted, so to use it in a shell script you may want to enclose it in | |
1149 | double quotes. | |
1150 | .\" %IF OS Windows | |
1151 | .IP \fBSMARTD_ADDRCSV\fP 4 | |
1152 | [Windows only] is set to a comma-separated list of the addresses from | |
1153 | SMARTD_ADDRESS. | |
1154 | .\" %ENDIF OS Windows | |
1155 | .IP \fBSMARTD_MESSAGE\fP 4 | |
1156 | is set to the one sentence summary warning email message string from | |
1157 | \fBsmartd\fP. | |
1158 | This message string contains space characters and is NOT quoted. So to | |
1159 | use $SMARTD_MESSAGE in a shell script you should probably enclose it in | |
1160 | double quotes. | |
1161 | .\" %IF NOT OS Windows | |
1162 | .IP \fBSMARTD_FULLMESSAGE\fP 4 | |
1163 | is set to the contents of the entire email warning message string from | |
1164 | \fBsmartd\fP. | |
1165 | This message string contains space and return characters and is NOT | |
1166 | quoted. | |
1167 | So to use $SMARTD_FULLMESSAGE in a shell script you should probably | |
1168 | enclose it in double quotes. | |
1169 | .\" %ENDIF NOT OS Windows | |
1170 | .\" %IF OS Windows | |
1171 | .IP \fBSMARTD_FULLMSGFILE\fP 4 | |
1172 | [Windows only] is the path to a temporary file containing the full message. | |
1173 | The path may contain space characters and is NOT quoted. | |
1174 | The file is created by the smartd_warning.cmd script and removed when | |
1175 | the mailer or command exits. | |
1176 | .\" %ENDIF OS Windows | |
1177 | .IP \fBSMARTD_TFIRST\fP 4 | |
1178 | is a text string giving the time and date at which the first problem | |
1179 | of this type was reported. This text string contains space characters | |
1180 | and no newlines, and is NOT quoted. For example: | |
1181 | .br | |
1182 | Sun Feb 9 14:58:19 2003 CST | |
1183 | .IP \fBSMARTD_TFIRSTEPOCH\fP 4 | |
1184 | is an integer, which is the unix epoch (number of seconds since Jan 1, | |
1185 | 1970) for \fBSMARTD_TFIRST\fP. | |
1186 | .IP \fBSMARTD_PREVCNT\fP 4 | |
1187 | is an integer specifying the number of previous messages sent. | |
1188 | It is set to \*(Aq0\*(Aq for the first message. | |
1189 | .IP \fBSMARTD_NEXTDAYS\fP 4 | |
1190 | is an integer specifying the number of days until the next message will be sent. | |
1191 | It it set to empty on \*(Aq\-M once\*(Aq and set to \*(Aq1\*(Aq on | |
1192 | \*(Aq\-M daily\*(Aq. | |
1193 | .RE | |
1194 | .\" The following two lines are a workaround for a man2html bug. Please leave them. | |
1195 | .\" They define a non-existent option; useful because man2html can't correctly reset the margins. | |
1196 | .TP | |
1197 | .B \& | |
1198 | If the \*(Aq\-m ADD\*(Aq Directive is given with a normal address argument, | |
1199 | then the executable pointed to by PATH will be run in a shell with | |
1200 | STDIN receiving the body of the email message, and with the same | |
1201 | command-line arguments: | |
1202 | .Vb 1 | |
1203 | \ \ \-s "$SMARTD_SUBJECT" $SMARTD_ADDRESS | |
1204 | .Ve | |
1205 | that would normally be provided to \*(Aqmail\*(Aq. Examples include: | |
1206 | .br | |
1207 | .B \-m user@home \-M exec /usr/bin/mail | |
1208 | .br | |
1209 | .B \-m admin@work \-M exec /usr/local/bin/mailto | |
1210 | .br | |
1211 | .B \-m root \-M exec /Example_1/shell/script/below | |
1212 | .Sp | |
1213 | .\" %IF OS Windows | |
1214 | [Windows only] On Windows, the syntax of the \*(Aq\fBBlat\fP\*(Aq mailer is | |
1215 | used (except for \*(Aq.ps1\*(Aq scripts): | |
1216 | .Vb 1 | |
1217 | \ \ \- \-q \-subject "%SMARTD_SUBJECT%" \-to %SMARTD_ADDRCSV% | |
1218 | .Ve | |
1219 | .Sp | |
1220 | .\" %ENDIF OS Windows | |
1221 | If the \*(Aq\-m ADD\*(Aq Directive is given with the special address argument | |
1222 | .B <nomailer> | |
1223 | then the executable pointed to by PATH is run in a shell with | |
1224 | .B no | |
1225 | STDIN and | |
1226 | .B no | |
1227 | command-line arguments, for example: | |
1228 | .Vb 1 | |
1229 | \ \ \-m <nomailer> \-M exec /Example_2/shell/script/below | |
1230 | .Ve | |
1231 | .Sp | |
1232 | .\" %IF OS Windows | |
1233 | [Windows only] | |
1234 | [NEW EXPERIMENTAL SMARTD FEATURE] | |
1235 | If a PATH with extension \*(Aq.ps1\*(Aq is specified with \*(Aq\-M exec\*(Aq, | |
1236 | the script is run as follows with no STDIN, regardless of \*(Aq\-m ADD\*(Aq | |
1237 | setting: | |
1238 | .Vb 2 | |
1239 | \ \ PowerShell -NoProfile -ExecutionPolicy Bypass ^ | |
1240 | \ \ \ \ \ \ \ \ \ \ \ \ \ -Command ^& \*(Aq%SMARTD_MAILER%\*(Aq | |
1241 | .Ve | |
1242 | .Sp | |
1243 | .\" %ENDIF OS Windows | |
1244 | If the executable produces any STDERR/STDOUT output, then \fBsmartd\fP | |
1245 | assumes that something is going wrong, and a snippet of that output | |
1246 | will be copied to SYSLOG. The remainder of the output is then | |
1247 | discarded. | |
1248 | .Sp | |
1249 | Some EXAMPLES of scripts that can be used with the \*(Aq\-M exec\*(Aq | |
1250 | Directive are given below. | |
1251 | .\" %IF NOT OS Windows | |
1252 | Some sample scripts are also included in | |
1253 | /usr/local/share/doc/smartmontools/examplescripts/. | |
1254 | .\" %ENDIF NOT OS Windows | |
1255 | .Sp | |
1256 | The executable is run by the script | |
1257 | .\" %IF NOT OS Windows | |
1258 | /usr/local/etc/smartd_warning.sh. | |
1259 | .\" %ENDIF NOT OS Windows | |
1260 | .\" %IF OS ALL | |
1261 | (Windows: EXEDIR/smartd_warning.cmd) | |
1262 | .\" %ENDIF OS ALL | |
1263 | .\" %IF OS Windows | |
1264 | .\"! EXEDIR/smartd_warning.cmd. | |
1265 | .\" %ENDIF OS Windows | |
1266 | This script formats subject and full message based on SMARTD_MESSAGE and other | |
1267 | environment variables set by \fBsmartd\fP. | |
1268 | The environment variables | |
1269 | .\" %IF NOT OS Windows | |
1270 | SMARTD_SUBJECT and SMARTD_FULLMESSAGE | |
1271 | .\" %ENDIF NOT OS Windows | |
1272 | .\" %IF OS ALL | |
1273 | (Windows: SMARTD_SUBJECT, SMARTD_FULLMSGFILE and SMARTD_ADDRCSV) | |
1274 | .\" %ENDIF OS ALL | |
1275 | .\" %IF OS Windows | |
1276 | .\"! SMARTD_SUBJECT, SMARTD_FULLMSGFILE and SMARTD_ADDRCSV | |
1277 | .\" %ENDIF OS Windows | |
1278 | are set by the script before running the executable. | |
1279 | .TP | |
1280 | .B \-f | |
1281 | [ATA only] Check for \*(Aqfailure\*(Aq of any Usage Attributes. If these | |
1282 | Attributes are less than or equal to the threshold, it does NOT indicate | |
1283 | imminent disk failure. It "indicates an advisory condition where the usage | |
1284 | or age of the device has exceeded its intended design life period." | |
1285 | [Please see the \fBsmartctl \-A\fP command-line option.] | |
1286 | .TP | |
1287 | .B \-p | |
1288 | [ATA only] Report anytime that a Prefail Attribute has changed | |
1289 | its value since the last check. [Please see the | |
1290 | .B smartctl \-A | |
1291 | command-line option.] | |
1292 | .TP | |
1293 | .B \-u | |
1294 | [ATA only] Report anytime that a Usage Attribute has changed its value | |
1295 | since the last check. [Please see the | |
1296 | .B smartctl \-A | |
1297 | command-line option.] | |
1298 | .TP | |
1299 | .B \-t | |
1300 | [ATA only] Equivalent to turning on the two previous flags \*(Aq\-p\*(Aq | |
1301 | and \*(Aq\-u\*(Aq. | |
1302 | Tracks changes in \fIall\fP device Attributes (both Prefailure and | |
1303 | Usage). [Please see the \fBsmartctl\fP \-A command-line option.] | |
1304 | .TP | |
1305 | .B \-i ID | |
1306 | [ATA only] Ignore device Attribute number \fBID\fP when checking for failure | |
1307 | of Usage Attributes. \fBID\fP must be a decimal integer in the range | |
1308 | from 1 to 255. This Directive modifies the behavior of the \*(Aq\-f\*(Aq | |
1309 | Directive and has no effect without it. | |
1310 | .Sp | |
1311 | This is useful, for example, if you have a very old disk and don't | |
1312 | want to keep getting messages about the hours-on-lifetime Attribute | |
1313 | (usually Attribute 9) failing. This Directive may appear multiple | |
1314 | times for a single device, if you want to ignore multiple Attributes. | |
1315 | .TP | |
1316 | .B \-I ID | |
1317 | [ATA only] Ignore device Attribute \fBID\fP when tracking changes in the | |
1318 | Attribute values. \fBID\fP must be a decimal integer in the range | |
1319 | from 1 to 255. This Directive modifies the behavior of the \*(Aq\-p\*(Aq, | |
1320 | \*(Aq\-u\*(Aq, and \*(Aq\-t\*(Aq tracking Directives and has no effect | |
1321 | without one of them. | |
1322 | .Sp | |
1323 | This is useful, for example, if one of the device Attributes is the disk | |
1324 | temperature (usually Attribute 194 or 231). It's annoying to get reports | |
1325 | each time the temperature changes. This Directive may appear multiple | |
1326 | times for a single device, if you want to ignore multiple Attributes. | |
1327 | .TP | |
1328 | .B \-r ID[!] | |
1329 | [ATA only] When tracking, report the \fIRaw\fP value of Attribute \fBID\fP | |
1330 | along with its (normally reported) \fINormalized\fP value. \fBID\fP must | |
1331 | be a decimal integer in the range from 1 to 255. This Directive modifies | |
1332 | the behavior of the \*(Aq\-p\*(Aq, \*(Aq\-u\*(Aq, and \*(Aq\-t\*(Aq tracking | |
1333 | Directives and has no effect without one of them. | |
1334 | This Directive may be given multiple times. | |
1335 | .Sp | |
1336 | A common use of this Directive is to track the device Temperature | |
1337 | (often ID=194 or 231). | |
1338 | .Sp | |
1339 | If the optional flag \*(Aq!\*(Aq is appended, a change of the Normalized | |
1340 | value is considered critical. The report will be logged as LOG_CRIT | |
1341 | and a warning email will be sent if \*(Aq\-m\*(Aq is specified. | |
1342 | .TP | |
1343 | .B \-R ID[!] | |
1344 | [ATA only] When tracking, report whenever the \fIRaw\fP value of Attribute | |
1345 | \fBID\fP changes. (Normally \fBsmartd\fP only tracks/reports changes | |
1346 | of the \fINormalized\fP Attribute values.) \fBID\fP must be a decimal | |
1347 | integer in the range from 1 to 255. This Directive modifies the | |
1348 | behavior of the \*(Aq\-p\*(Aq, \*(Aq\-u\*(Aq, and \*(Aq\-t\*(Aq tracking | |
1349 | Directives and has no effect without one of them. | |
1350 | This Directive may be given multiple times. | |
1351 | .Sp | |
1352 | If this Directive is given, it automatically implies the \*(Aq\-r\*(Aq | |
1353 | Directive for the same Attribute, so that the Raw value of the | |
1354 | Attribute is reported. | |
1355 | .Sp | |
1356 | A common use of this Directive is to track the device Temperature | |
1357 | (often ID=194 or 231). It is also useful for understanding how | |
1358 | different types of system behavior affects the values of certain | |
1359 | Attributes. | |
1360 | .Sp | |
1361 | If the optional flag \*(Aq!\*(Aq is appended, a change of the Raw | |
1362 | value is considered critical. The report will be logged as | |
1363 | LOG_CRIT and a warning email will be sent if \*(Aq\-m\*(Aq is specified. | |
1364 | An example is \*(Aq\-R 5!\*(Aq to warn when new sectors are reallocated. | |
1365 | .TP | |
1366 | .B \-C ID[+] | |
1367 | [ATA only] Report if the current number of pending sectors is | |
1368 | non-zero. Here \fBID\fP is the id number of the Attribute whose raw | |
1369 | value is the Current Pending Sector count. The allowed range of | |
1370 | \fBID\fP is 0 to 255 inclusive. To turn off this reporting, use | |
1371 | ID\ =\ 0. If the \fB\-C ID\fP option is not given, then it defaults to | |
1372 | \fB\-C 197\fP (since Attribute 197 is generally used to monitor | |
1373 | pending sectors). If the name of this Attribute is changed by a | |
1374 | \*(Aq\-v 197,FORMAT,NAME\*(Aq directive, the default is changed to | |
1375 | \fB\-C 0\fP. | |
1376 | .Sp | |
1377 | If \*(Aq+\*(Aq is specified, a report is only printed if the number of sectors | |
1378 | has increased between two check cycles. Some disks do not reset this | |
1379 | attribute when a bad sector is reallocated. | |
1380 | See also \*(Aq\-v 197,increasing\*(Aq below. | |
1381 | .Sp | |
1382 | The warning email counter is reset if the number of pending sectors | |
1383 | dropped to 0. This typically happens when all pending sectors have | |
1384 | been reallocated or could be read again. | |
1385 | .Sp | |
1386 | A pending sector is a disk sector (containing 512 bytes of your data) | |
1387 | which the device would like to mark as "bad" and reallocate. | |
1388 | Typically this is because your computer tried to read that sector, and | |
1389 | the read failed because the data on it has been corrupted and has | |
1390 | inconsistent Error Checking and Correction (ECC) codes. This is | |
1391 | important to know, because it means that there is some unreadable data | |
1392 | on the disk. The problem of figuring out what file this data belongs | |
1393 | to is operating system and file system specific. You can typically | |
1394 | force the sector to reallocate by writing to it (translation: make the | |
1395 | device substitute a spare good sector for the bad one) but at the | |
1396 | price of losing the 512 bytes of data stored there. | |
1397 | .TP | |
1398 | .B \-U ID[+] | |
1399 | [ATA only] Report if the number of offline uncorrectable sectors is | |
1400 | non-zero. Here \fBID\fP is the id number of the Attribute whose raw | |
1401 | value is the Offline Uncorrectable Sector count. The allowed range of | |
1402 | \fBID\fP is 0 to 255 inclusive. To turn off this reporting, use | |
1403 | ID\ =\ 0. If the \fB\-U ID\fP option is not given, then it defaults to | |
1404 | \fB\-U 198\fP (since Attribute 198 is generally used to monitor | |
1405 | offline uncorrectable sectors). If the name of this Attribute is changed | |
1406 | by a \*(Aq\-v 198,FORMAT,NAME\*(Aq (except | |
1407 | \*(Aq\-v 198,FORMAT,Offline_Scan_UNC_SectCt\*(Aq), directive, the default | |
1408 | is changed to \fB\-U 0\fP. | |
1409 | .Sp | |
1410 | If \*(Aq+\*(Aq is specified, a report is only printed if the number of sectors | |
1411 | has increased since the last check cycle. Some disks do not reset this | |
1412 | attribute when a bad sector is reallocated. | |
1413 | See also \*(Aq\-v 198,increasing\*(Aq below. | |
1414 | .Sp | |
1415 | The warning email counter is reset if the number of offline uncorrectable | |
1416 | sectors dropped to 0. This typically happens when all offline uncorrectable | |
1417 | sectors have been reallocated or could be read again. | |
1418 | .Sp | |
1419 | An offline uncorrectable sector is a disk sector which was not | |
1420 | readable during an off-line scan or a self-test. This is important | |
1421 | to know, because if you have data stored in this disk sector, and you | |
1422 | need to read it, the read will fail. Please see the previous \*(Aq\-C\*(Aq | |
1423 | option for more details. | |
1424 | .TP | |
1425 | .B \-W DIFF[,INFO[,CRIT]] | |
1426 | Report if the current temperature had changed by at least \fBDIFF\fP | |
1427 | degrees since last report, or if new min or max temperature is detected. | |
1428 | Report or Warn if the temperature is greater or equal than one of | |
1429 | \fBINFO\fP or \fBCRIT\fP degrees Celsius. | |
1430 | If the limit \fBCRIT\fP is reached, a message with loglevel | |
1431 | \fB\*(AqLOG_CRIT\*(Aq\fP will be logged to syslog and a warning email | |
1432 | will be send if \*(Aq\-m\*(Aq is specified. If only the limit \fBINFO\fP is | |
1433 | reached, a message with loglevel \fB\*(AqLOG_INFO\*(Aq\fP will be logged. | |
1434 | .Sp | |
1435 | The warning email counter is reset if the temperature dropped below | |
1436 | \fBINFO\fP or \fBCRIT\fP-5 if \fBINFO\fP is not specified. | |
1437 | .Sp | |
1438 | If this directive is used in conjunction with state persistence | |
1439 | (\*(Aq\-s\*(Aq option), the min and max temperature values are preserved | |
1440 | across boot cycles. The minimum temperature value is not updated | |
1441 | during the first 30 minutes after startup. | |
1442 | .Sp | |
1443 | To disable any of the 3 reports, set the corresponding limit to 0. | |
1444 | Trailing zero arguments may be omitted. By default, all temperature | |
1445 | reports are disabled (\*(Aq\-W 0\*(Aq). | |
1446 | .Sp | |
1447 | To track temperature changes of at least 2 degrees, use: | |
1448 | .br | |
1449 | .B \-W 2 | |
1450 | .br | |
1451 | To log informal messages on temperatures of at least 40 degrees, use: | |
1452 | .br | |
1453 | .B \-W 0,40 | |
1454 | .br | |
1455 | For warning messages/mails on temperatures of at least 45 degrees, use: | |
1456 | .br | |
1457 | .B \-W 0,0,45 | |
1458 | .br | |
1459 | To combine all of the above reports, use: | |
1460 | .br | |
1461 | .B \-W 2,40,45 | |
1462 | .Sp | |
1463 | For ATA devices, smartd interprets Attribute 194 or 190 as Temperature Celsius | |
1464 | by default. This can be changed to Attribute 9 or 220 by the drive | |
1465 | database or by the \*(Aq\-v 9,temp\*(Aq or \*(Aq\-v 220,temp\*(Aq directive. | |
1466 | .\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
1467 | .Sp | |
1468 | For NVMe devices, smartd checks the maximum of the Composite Temperature value | |
1469 | and all Temperature Sensor values reported by SMART/Health Information log. | |
1470 | .\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
1471 | .TP | |
1472 | .B \-F TYPE | |
1473 | [ATA only] Modifies the behavior of \fBsmartd\fP to compensate for some | |
1474 | known and understood device firmware bug. This directive may be used | |
1475 | multiple times. The valid arguments are: | |
1476 | .Sp | |
1477 | .I none | |
1478 | \- Assume that the device firmware obeys the ATA specifications. This | |
1479 | is the default, unless the device has presets for \*(Aq\-F\*(Aq in the | |
1480 | drive database. Using this directive will override any preset values. | |
1481 | .Sp | |
1482 | .I nologdir | |
1483 | \- Suppresses read attempts of SMART or GP Log Directory. | |
1484 | Support for all standard logs is assumed without an actual check. | |
1485 | Some Intel SSDs may freeze if log address 0 is read. | |
1486 | .Sp | |
1487 | .I samsung | |
1488 | \- In some Samsung disks (example: model SV4012H Firmware Version: | |
1489 | RM100-08) some of the two- and four-byte quantities in the SMART data | |
1490 | structures are byte-swapped (relative to the ATA specification). | |
1491 | Enabling this option tells \fBsmartd\fP to evaluate these quantities | |
1492 | in byte-reversed order. Some signs that your disk needs this option | |
1493 | are (1) no self-test log printed, even though you have run self-tests; | |
1494 | (2) very large numbers of ATA errors reported in the ATA error log; | |
1495 | (3) strange and impossible values for the ATA error log timestamps. | |
1496 | .Sp | |
1497 | .I samsung2 | |
1498 | \- In some Samsung disks the number of ATA errors reported is byte swapped. | |
1499 | Enabling this option tells \fBsmartd\fP to evaluate this quantity in | |
1500 | byte-reversed order. | |
1501 | .Sp | |
1502 | .I samsung3 | |
1503 | \- Some Samsung disks (at least SP2514N with Firmware VF100-37) report | |
1504 | a self-test still in progress with 0% remaining when the test was already | |
1505 | completed. If this directive is specified, \fBsmartd\fP will not skip the | |
1506 | next scheduled self-test (see Directive \*(Aq\-s\*(Aq above) in this case. | |
1507 | .Sp | |
1508 | .I xerrorlba | |
1509 | \- This only affects \fBsmartctl\fP. | |
1510 | .Sp | |
1511 | [Please see the \fBsmartctl \-F\fP command-line option.] | |
1512 | .TP | |
1513 | .B \-v ID,FORMAT[:BYTEORDER][,NAME] | |
1514 | [ATA only] Sets a vendor-specific raw value print FORMAT, an optional | |
1515 | BYTEORDER and an optional NAME for Attribute ID. | |
1516 | This directive may be used multiple times. | |
1517 | Please see \fBsmartctl \-v\fP command-line option for further details. | |
1518 | .Sp | |
1519 | The following arguments affect smartd warning output: | |
1520 | .Sp | |
1521 | .I 197,increasing | |
1522 | \- Raw Attribute number 197 (Current Pending Sector Count) is not | |
1523 | reset if uncorrectable sectors are reallocated. This sets \*(Aq\-C 197+\*(Aq | |
1524 | if no other \*(Aq\-C\*(Aq directive is specified. | |
1525 | .Sp | |
1526 | .I 198,increasing | |
1527 | \- Raw Attribute number 198 (Offline Uncorrectable Sector Count) is not | |
1528 | reset if uncorrectable sectors are reallocated. This sets \*(Aq\-U 198+\*(Aq | |
1529 | if no other \*(Aq\-U\*(Aq directive is specified. | |
1530 | .TP | |
1531 | .B \-P TYPE | |
1532 | [ATA only] Specifies whether \fBsmartd\fP should use any preset options | |
1533 | that are available for this drive. | |
1534 | The valid arguments to this Directive are: | |
1535 | .Sp | |
1536 | .I use | |
1537 | \- use any presets that are available for this drive. This is the default. | |
1538 | .Sp | |
1539 | .I ignore | |
1540 | \- do not use any presets for this drive. | |
1541 | .Sp | |
1542 | .I show | |
1543 | \- show the presets listed for this drive in the database. | |
1544 | .Sp | |
1545 | .I showall | |
1546 | \- show the presets that are available for all drives and then exit. | |
1547 | .Sp | |
1548 | [Please see the | |
1549 | .B smartctl \-P | |
1550 | command-line option.] | |
1551 | .TP | |
1552 | .B \-a | |
1553 | Equivalent to turning on all of the following Directives: | |
1554 | .B \*(Aq\-H\*(Aq | |
1555 | to check the SMART health status, | |
1556 | .B \*(Aq\-f\*(Aq | |
1557 | to report failures of Usage (rather than Prefail) Attributes, | |
1558 | .B \*(Aq\-t\*(Aq | |
1559 | to track changes in both Prefailure and Usage Attributes, | |
1560 | .B \*(Aq\-l\ error\*(Aq | |
1561 | to report increases in the number of ATA errors, | |
1562 | .B \*(Aq\-l\ selftest\*(Aq | |
1563 | to report increases in the number of Self-Test Log errors, | |
1564 | .B \*(Aq\-l\ selfteststs\*(Aq | |
1565 | to report changes of Self-Test execution status, | |
1566 | .B \*(Aq\-C 197\*(Aq | |
1567 | to report nonzero values of the current pending sector count, and | |
1568 | .B \*(Aq\-U 198\*(Aq | |
1569 | to report nonzero values of the offline pending sector count. | |
1570 | .Sp | |
1571 | Note that \-a is the default for ATA devices. If none of these other | |
1572 | Directives is given, then \-a is assumed. | |
1573 | .TP | |
1574 | .B # | |
1575 | Comment: ignore the remainder of the line. | |
1576 | .TP | |
1577 | .B \e | |
1578 | Continuation character: if this is the last non-white or non-comment | |
1579 | character on a line, then the following line is a continuation of the current | |
1580 | one. | |
1581 | .PP | |
1582 | If you are not sure which Directives to use, I suggest experimenting | |
1583 | for a few minutes with | |
1584 | .B smartctl | |
1585 | to see what SMART functionality your disk(s) support(s). If you do | |
1586 | not like voluminous syslog messages, a good choice of | |
1587 | \fBsmartd\fP | |
1588 | configuration file Directives might be: | |
1589 | .br | |
1590 | \fB\-H \-l selftest \-l error \-f\fP. | |
1591 | .br | |
1592 | If you want more frequent information, use: \fB\-a\fP. | |
1593 | .Sp | |
1594 | .TP | |
1595 | .B EXAMPLES OF SHELL SCRIPTS FOR \*(Aq\-M exec\*(Aq | |
1596 | These are two examples of shell scripts that can be used with the \*(Aq\-M | |
1597 | exec PATH\*(Aq Directive described previously. The paths to these scripts | |
1598 | and similar executables is the PATH argument to the \*(Aq\-M exec PATH\*(Aq | |
1599 | Directive. | |
1600 | .Sp | |
1601 | Example 1: This script is for use with \*(Aq\-m ADDRESS \-M exec PATH\*(Aq. | |
1602 | It appends the output of | |
1603 | .B smartctl \-a | |
1604 | to the output of the smartd email warning message and sends it to ADDRESS. | |
1605 | .Sp | |
1606 | .Vb 4 | |
1607 | #! /bin/sh | |
1608 | ||
1609 | # Save the email message (STDIN) to a file: | |
1610 | cat > /root/msg | |
1611 | ||
1612 | # Append the output of smartctl \-a to the message: | |
1613 | /usr/local/sbin/smartctl \-a \-d $SMART_DEVICETYPE \e | |
1614 | $SMARTD_DEVICE >> /root/msg | |
1615 | ||
1616 | # Now email the message to the user at address ADD: | |
1617 | /usr/bin/mail \-s "$SMARTD_SUBJECT" $SMARTD_ADDRESS \e | |
1618 | < /root/msg | |
1619 | .Ve | |
1620 | .Sp | |
1621 | Example 2: This script is for use with \*(Aq\-m <nomailer> \-M exec | |
1622 | PATH\*(Aq. It warns all users about a disk problem, waits 30 seconds, and | |
1623 | then powers down the machine. | |
1624 | .Sp | |
1625 | .Vb 4 | |
1626 | #! /bin/sh | |
1627 | ||
1628 | # Warn all users of a problem | |
1629 | wall <<EOF | |
1630 | Problem detected with disk: $SMARTD_DEVICESTRING | |
1631 | Warning message from smartd is: $SMARTD_MESSAGE | |
1632 | Shutting down machine in 30 seconds... | |
1633 | EOF | |
1634 | ||
1635 | # Wait half a minute | |
1636 | sleep 30 | |
1637 | ||
1638 | # Power down the machine | |
1639 | /sbin/shutdown \-hf now | |
1640 | .Ve | |
1641 | .Sp | |
1642 | Some example scripts are distributed with the smartmontools package, | |
1643 | in /usr/local/share/doc/smartmontools/examplescripts/. | |
1644 | .Sp | |
1645 | Please note that these scripts typically run as root, so any files | |
1646 | that they read/write should not be writable by ordinary users or | |
1647 | reside in directories like /tmp that are writable by ordinary users | |
1648 | and may expose your system to symlink attacks. | |
1649 | .Sp | |
1650 | As previously described, if the scripts write to STDOUT or STDERR, | |
1651 | this is interpreted as indicating that there was an internal error | |
1652 | within the script, and a snippet of STDOUT/STDERR is logged to SYSLOG. | |
1653 | The remainder is flushed. | |
1654 | .Sp | |
1655 | .\" %IF NOT OS Windows | |
1656 | .SH FILES | |
1657 | .TP | |
1658 | .B /usr/local/etc/smartd.conf | |
1659 | full path of this file. | |
1660 | .Sp | |
1661 | .\" %ENDIF NOT OS Windows | |
1662 | .SH SEE ALSO | |
1663 | \fBsmartd\fP(8), \fBsmartctl\fP(8), | |
1664 | \fBmail\fP(1), \fBregex\fP(7). | |
1665 | .Sp | |
1666 | .SH PACKAGE VERSION | |
1667 | CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV | |
1668 | .br | |
1669 | $Id: smartd.conf.5.in 4856 2018-12-11 21:42:16Z chrfranke $ |