]>
Commit | Line | Data |
---|---|---|
832b75ed | 1 | .ig |
a86ec89e | 2 | Copyright (C) 2002-10 Bruce Allen |
ff28b140 | 3 | Copyright (C) 2004-18 Christian Franke |
832b75ed | 4 | |
ff28b140 | 5 | SPDX-License-Identifier: GPL-2.0-or-later |
832b75ed | 6 | |
ff28b140 | 7 | $Id: smartd.conf.5.in 4856 2018-12-11 21:42:16Z chrfranke $ |
ee38a438 | 8 | |
832b75ed | 9 | .. |
f9e10201 JD |
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 ' | |
a86ec89e | 27 | .TH SMARTD.CONF 5 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools" |
832b75ed GG |
28 | .SH NAME |
29 | \fBsmartd.conf\fP \- SMART Disk Monitoring Daemon Configuration File\fP | |
ff28b140 | 30 | .Sp |
832b75ed | 31 | .SH DESCRIPTION |
d008864d GI |
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 | |
832b75ed | 37 | \fB/usr/local/etc/smartd.conf\fP is the configuration file for the \fBsmartd\fP |
ee38a438 | 38 | daemon. |
f9e10201 | 39 | .PP |
832b75ed | 40 | If the configuration file \fB/usr/local/etc/smartd.conf\fP is present, |
f9e10201 JD |
41 | \fBsmartd\fP reads it at startup. |
42 | If \fBsmartd\fP subsequently receives a \fBHUP\fP signal, | |
832b75ed GG |
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 | |
f9e10201 JD |
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 | |
832b75ed | 47 | running. |
f9e10201 | 48 | .PP |
d008864d | 49 | In the absence of a configuration file |
ee38a438 GI |
50 | \fBsmartd\fP will try to open all available devices |
51 | (see \fBsmartd\fP(8) man page). | |
f9e10201 | 52 | A configuration file with a single line \fB\*(AqDEVICESCAN \-a\*(Aq\fP |
ee38a438 | 53 | would have the same effect. |
f9e10201 | 54 | .PP |
832b75ed GG |
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 | |
ee38a438 | 57 | problems, you may be annoyed by the string of error log messages about devices |
f9e10201 JD |
58 | that can't be opened. |
59 | .PP | |
832b75ed GG |
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 | |
f9e10201 JD |
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: | |
832b75ed GG |
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 | |
f9e10201 | 77 | Any text following a hash sign \*(Aq#\*(Aq and up to the end of the line is |
832b75ed GG |
78 | taken to be a comment, and ignored. |
79 | .IP \(bu 4 | |
f9e10201 | 80 | Lines may be continued by using a backslash \*(Aq\e\*(Aq as the last |
832b75ed GG |
81 | non-whitespace or non-comment item on a line. |
82 | .IP \(bu 4 | |
f9e10201 | 83 | Note: a line whose first character is a hash sign \*(Aq#\*(Aq is treated as |
832b75ed GG |
84 | a white-space blank line, \fBnot\fP as a non-existent line, and will |
85 | \fBend\fP a continuation line. | |
d2e702cf | 86 | .PP |
f9e10201 JD |
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 | |
832b75ed GG |
89 | of the |
90 | .B DIRECTIVES | |
91 | Section below! | |
f9e10201 JD |
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 | |
d008864d | 119 | .\" %IF OS Linux |
f9e10201 JD |
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 | |
d008864d | 135 | .\" %ENDIF OS Linux |
f9e10201 JD |
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 | |
ee38a438 | 142 | .\" %IF OS Linux |
f9e10201 JD |
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 | |
ee38a438 GI |
146 | .\" %ENDIF OS Linux |
147 | .\" %IF OS FreeBSD | |
f9e10201 JD |
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 | |
ee38a438 | 151 | .\" %ENDIF OS FreeBSD |
f9e10201 JD |
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 | |
d008864d | 158 | .\" %IF OS Linux |
f9e10201 JD |
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 | |
d008864d GI |
163 | .\" %ENDIF OS Linux |
164 | .\" %IF OS FreeBSD | |
f9e10201 JD |
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 | |
d008864d | 169 | .\" %ENDIF OS FreeBSD |
f9e10201 JD |
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 | |
d008864d | 176 | .\" %IF OS Linux |
f9e10201 JD |
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 | |
d008864d GI |
180 | .\" %ENDIF OS Linux |
181 | .\" %IF OS FreeBSD | |
f9e10201 JD |
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 | |
d008864d | 185 | .\" %ENDIF OS FreeBSD |
f9e10201 JD |
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 | |
d008864d | 192 | .\" %IF OS Linux |
f9e10201 JD |
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 | |
d008864d GI |
197 | .\" %ENDIF OS Linux |
198 | .\" %IF OS FreeBSD | |
f9e10201 JD |
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 | |
d008864d | 203 | .\" %ENDIF OS FreeBSD |
f9e10201 JD |
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 | |
ff28b140 | 229 | .SH DEVICESCAN |
7f0798ef | 230 | If a non-comment entry in the configuration file is the text string |
832b75ed GG |
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. | |
ff28b140 TL |
236 | If |
237 | .B DEVICESCAN | |
238 | is not followed by any Directives, then \*(Aq\-a\*(Aq will apply to all | |
239 | devices. | |
240 | .PP | |
832b75ed GG |
241 | .B DEVICESCAN |
242 | may optionally be followed by Directives that will apply to all | |
ff28b140 TL |
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 | |
f9e10201 | 266 | .PP |
ff28b140 TL |
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 | |
d2e702cf | 289 | If an entry in the configuration file starts with |
d008864d GI |
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. | |
d2e702cf | 293 | .PP |
d008864d | 294 | This configuration: |
d2e702cf | 295 | .PP |
f9e10201 JD |
296 | .Vb 7 |
297 | \ \ DEFAULT \-a \-R5! \-W 2,40,45 \-I 194 \-s L/../../7/00 \-m admin@example.com | |
d008864d GI |
298 | \ \ /dev/sda |
299 | \ \ /dev/sdb | |
300 | \ \ /dev/sdc | |
f9e10201 | 301 | \ \ DEFAULT \-H \-m admin@example.com |
d008864d | 302 | \ \ /dev/sdd |
f9e10201 JD |
303 | \ \ /dev/sde \-d removable |
304 | .Ve | |
d2e702cf | 305 | .PP |
d008864d | 306 | has the same effect as: |
d2e702cf | 307 | .PP |
f9e10201 JD |
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 | |
ff28b140 TL |
315 | .Sp |
316 | .SH CONFIGURATION FILE DIRECTIVES | |
832b75ed GG |
317 | The following are the Directives that may appear following the device |
318 | name or | |
319 | .B DEVICESCAN | |
d008864d GI |
320 | or |
321 | .B DEFAULT | |
832b75ed GG |
322 | on any line of the |
323 | .B /usr/local/etc/smartd.conf | |
f9e10201 JD |
324 | configuration file. Note that |
325 | .B these are NOT command-line options for | |
832b75ed GG |
326 | \fBsmartd\fP. |
327 | The Directives below may appear in any order, following the device | |
f9e10201 JD |
328 | name. |
329 | .PP | |
832b75ed GG |
330 | .B For an ATA device, |
331 | if no Directives appear, then the device will be monitored | |
f9e10201 JD |
332 | as if the \*(Aq\-a\*(Aq Directive (monitor all SMART properties) had been given. |
333 | .PP | |
832b75ed GG |
334 | .B If a SCSI disk is listed, |
335 | it will be monitored at the maximum implemented level: roughly | |
f9e10201 JD |
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 | |
832b75ed | 341 | status fails, or if new errors appear in the self-test log. |
f9e10201 JD |
342 | .\" %IF OS FreeBSD Linux |
343 | .PP | |
832b75ed | 344 | .B If a 3ware controller is used |
cfbba5b9 | 345 | then the corresponding SCSI (/dev/sd?) or character device (/dev/twe?, |
f9e10201 JD |
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 | |
2127e193 | 352 | .B If an Areca controller is used |
f9e10201 JD |
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). | |
d008864d GI |
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 | |
2127e193 | 358 | these disks. Areca firmware version 1.46 or later which supports |
bed94269 GI |
359 | smartmontools must be used; Please see the \fBsmartctl\fP(8) man page |
360 | for further details. | |
f9e10201 | 361 | .\" %ENDIF OS FreeBSD Linux |
832b75ed GG |
362 | .TP |
363 | .B \-d TYPE | |
cfbba5b9 GI |
364 | Specifies the type of the device. |
365 | The valid arguments to this directive are: | |
f9e10201 | 366 | .Sp |
cfbba5b9 | 367 | .I auto |
ee38a438 | 368 | \- attempt to guess the device type from the device name or from |
cfbba5b9 GI |
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. | |
f9e10201 | 372 | .Sp |
832b75ed GG |
373 | .I ata |
374 | \- the device type is ATA. This prevents | |
375 | \fBsmartd\fP | |
376 | from issuing SCSI commands to an ATA device. | |
f9e10201 | 377 | .Sp |
d008864d | 378 | .\" %IF NOT OS Darwin |
832b75ed GG |
379 | .I scsi |
380 | \- the device type is SCSI. This prevents | |
381 | \fBsmartd\fP | |
382 | from issuing ATA commands to a SCSI device. | |
f9e10201 | 383 | .Sp |
a86ec89e | 384 | .\" %ENDIF NOT OS Darwin |
f9e10201 | 385 | .\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin |
a86ec89e | 386 | .I nvme[,NSID] |
ff28b140 | 387 | \- the device type is NVM Express (NVMe). |
a86ec89e GI |
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. | |
f9e10201 JD |
392 | .Sp |
393 | .\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
a86ec89e | 394 | .\" %IF NOT OS Darwin |
d008864d | 395 | .I sat[,auto][,N] |
4d59bff9 | 396 | \- the device type is SCSI to ATA Translation (SAT). |
f9e10201 JD |
397 | This is for ATA disks that have a SCSI to ATA Translation Layer (SATL) |
398 | between the disk and the operating system. | |
cfbba5b9 GI |
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 | |
f9e10201 JD |
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 "). | |
d008864d | 405 | Otherwise device type SCSI (for SCSI/SAS disks) is used. |
f9e10201 | 406 | .Sp |
cfbba5b9 GI |
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 | |
f9e10201 | 411 | with \*(Aq\-d usbcypress,0xN\*(Aq, where N is the scsi operation code, |
cfbba5b9 | 412 | you're running the risk of damage to the device or filesystems on it. |
f9e10201 | 413 | .Sp |
ee38a438 GI |
414 | .I usbjmicron[,p][,x][,PORT] |
415 | \- this device type is for SATA disks that are behind a JMicron USB to | |
f9e10201 JD |
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 | |
cfbba5b9 GI |
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. | |
f9e10201 | 426 | CAUTION: Specifying \*(Aq,x\*(Aq for a device which does not support it results |
cfbba5b9 GI |
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. | |
f9e10201 | 429 | .Sp |
ee38a438 | 430 | The Prolific PL2507/3507 USB bridges with older firmware support a pass-through |
f9e10201 | 431 | command similar to JMicron and work with \*(Aq\-d usbjmicron,0\*(Aq. |
ee38a438 | 432 | Newer Prolific firmware requires a modified command which can be selected by |
f9e10201 | 433 | \*(Aq\-d usbjmicron,p\*(Aq. |
ee38a438 | 434 | Note that this does not yet support the SMART status command. |
f9e10201 | 435 | .Sp |
a86ec89e | 436 | .I usbprolific |
f9e10201 JD |
437 | \- this device type is for SATA disks that are behind a Prolific |
438 | PL2571/2771/2773/2775 USB to SATA bridge. | |
439 | .Sp | |
cfbba5b9 GI |
440 | .I usbsunplus |
441 | \- this device type is for SATA disks that are behind a SunplusIT USB to SATA | |
442 | bridge. | |
f9e10201 | 443 | .Sp |
ff28b140 TL |
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 | |
d008864d GI |
452 | .\" %ENDIF NOT OS Darwin |
453 | .\" %IF OS Linux | |
832b75ed | 454 | .I marvell |
cfbba5b9 | 455 | \- [Linux only] interact with SATA disks behind Marvell chip-set |
832b75ed | 456 | controllers (using the Marvell rather than libata driver). |
f9e10201 | 457 | .Sp |
2127e193 | 458 | .I megaraid,N |
cfbba5b9 GI |
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. | |
2127e193 GI |
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. | |
f9e10201 | 465 | It is possible to set RAID device name as /dev/bus/N, where N is a SCSI bus |
ee38a438 | 466 | number. |
cfbba5b9 | 467 | Please see the \fBsmartctl\fP(8) man page for further details. |
f9e10201 | 468 | .Sp |
a86ec89e GI |
469 | .\" %ENDIF OS Linux |
470 | .\" %IF OS Linux Windows Cygwin | |
d2e702cf | 471 | .I aacraid,H,L,ID |
f9e10201 | 472 | \- [Linux, Windows and Cygwin only] the device consists of one or more |
ff28b140 | 473 | SCSI/SAS or SATA disks connected to an AacRaid controller. |
d2e702cf GI |
474 | The non-negative integers H,L,ID (Host number, Lun, ID) denote which disk |
475 | on the controller is monitored. | |
f9e10201 JD |
476 | In log files and email messages this disk will be identified as |
477 | aacraid_disk_HH_LL_ID. | |
d2e702cf | 478 | Please see the \fBsmartctl\fP(8) man page for further details. |
f9e10201 | 479 | .Sp |
a86ec89e | 480 | .\" %ENDIF OS Linux Windows Cygwin |
d008864d | 481 | .\" %IF OS FreeBSD Linux |
832b75ed | 482 | .I 3ware,N |
cfbba5b9 GI |
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 | |
2127e193 | 488 | with XXX in the range from 000 to 127 inclusive. |
f9e10201 | 489 | .Sp |
cfbba5b9 GI |
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 | |
832b75ed | 492 | messages will make the most sense if you always list the 3ware SCSI |
cfbba5b9 GI |
493 | logical device corresponding to the particular physical disks. |
494 | Please see the \fBsmartctl\fP(8) man page for further details. | |
f9e10201 | 495 | .Sp |
d008864d | 496 | .\" %ENDIF OS FreeBSD Linux |
f4e463df | 497 | .\" %IF OS FreeBSD Linux Windows Cygwin |
2127e193 | 498 | .I areca,N |
f9e10201 JD |
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 | |
2127e193 | 504 | areca_disk_XX with XX in the range from 01 to 24 inclusive. |
cfbba5b9 | 505 | Please see the \fBsmartctl\fP(8) man page for further details. |
f9e10201 | 506 | .Sp |
f4e463df | 507 | .I areca,N/E |
a86ec89e GI |
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. | |
f4e463df GI |
510 | The integer N (range 1 to 128) denotes the channel (slot) and E (range |
511 | 1 to 8) denotes the enclosure. | |
ee38a438 | 512 | Important: This requires Areca SAS controller firmware version 1.51 or later. |
f9e10201 | 513 | .Sp |
f4e463df | 514 | .\" %ENDIF OS FreeBSD Linux Windows Cygwin |
d008864d | 515 | .\" %IF OS FreeBSD Linux |
ba59cff1 | 516 | .I cciss,N |
f9e10201 JD |
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. | |
cfbba5b9 | 521 | In log files and email messages this disk will be identified as cciss_disk_XX |
ba59cff1 | 522 | with XX in the range from 00 to 15 inclusive. |
cfbba5b9 | 523 | Please see the \fBsmartctl\fP(8) man page for further details. |
f9e10201 | 524 | .Sp |
4d59bff9 | 525 | .I hpt,L/M/N |
cfbba5b9 GI |
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 | |
3d17a85c | 530 | from 1 to 4 inclusive, M are from 1 to 128 inclusive and N from 1 to 4 |
cfbba5b9 GI |
531 | if PMPort available. And also these values are limited by the model |
532 | of the HighPoint RocketRAID controller. | |
4d59bff9 GG |
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. | |
cfbba5b9 | 536 | Please see the \fBsmartctl\fP(8) man page for further details. |
f9e10201 | 537 | .Sp |
d008864d | 538 | .\" %ENDIF OS FreeBSD Linux |
f9e10201 JD |
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 | |
ee38a438 | 545 | .I ignore |
a86ec89e | 546 | \- the device specified by this configuration entry should be ignored. |
ee38a438 GI |
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. | |
f9e10201 JD |
550 | This Directive may be used in conjunction with the other \*(Aq\-d\*(Aq |
551 | Directives. | |
552 | .Sp | |
832b75ed GG |
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 | |
f9e10201 JD |
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 | |
832b75ed | 565 | .TP |
2127e193 | 566 | .B \-n POWERMODE[,N][,q] |
f9e10201 | 567 | [ATA only] This \*(Aqnocheck\*(Aq Directive is used to prevent a disk from |
cfbba5b9 | 568 | being spun-up when it is periodically polled by \fBsmartd\fP. |
f9e10201 JD |
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 | |
ee38a438 | 578 | be spun up and put into a higher-power mode when it is periodically |
832b75ed | 579 | polled by \fBsmartd\fP. |
f9e10201 | 580 | .Sp |
832b75ed GG |
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 | |
f9e10201 | 583 | be registered as a device for \fBsmartd\fP to monitor. If a disk is in |
ee38a438 GI |
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. | |
f9e10201 JD |
586 | .Sp |
587 | The \*(Aq\fB\-n\fP\*(Aq (nocheck) Directive specifies if \fBsmartd\fP's | |
832b75ed | 588 | periodic checks should still be carried out when the device is in a |
ee38a438 | 589 | low-power mode. It may be used to prevent a disk from being spun-up |
832b75ed GG |
590 | by periodic \fBsmartd\fP polling. The allowed values of POWERMODE |
591 | are: | |
f9e10201 | 592 | .Sp |
832b75ed GG |
593 | .I never |
594 | \- \fBsmartd\fP will poll (check) the device regardless of its power | |
f9e10201 | 595 | mode. This may cause a disk which is spun-down to be spun-up when |
832b75ed GG |
596 | \fBsmartd\fP checks it. This is the default behavior if the '\-n' |
597 | Directive is not given. | |
f9e10201 | 598 | .Sp |
832b75ed GG |
599 | .I sleep |
600 | \- check the device unless it is in SLEEP mode. | |
f9e10201 | 601 | .Sp |
832b75ed GG |
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. | |
f9e10201 | 607 | .Sp |
832b75ed GG |
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. | |
f9e10201 | 612 | .Sp |
2127e193 | 613 | Maximum number of skipped checks (in a row) can be specified by |
f9e10201 JD |
614 | appending positive number \*(Aq,N\*(Aq to POWERMODE (like |
615 | \*(Aq\-n standby,15\*(Aq). | |
2127e193 GI |
616 | After N checks are skipped in a row, powermode is ignored and the |
617 | check is performed anyway. | |
f9e10201 | 618 | .Sp |
832b75ed | 619 | When a periodic test is skipped, \fBsmartd\fP normally writes an |
f9e10201 JD |
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). | |
832b75ed | 622 | This prevents a laptop disk from spinning up due to this message. |
f9e10201 JD |
623 | .Sp |
624 | Both \*(Aq,N\*(Aq and \*(Aq,q\*(Aq can be specified together. | |
832b75ed GG |
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: | |
f9e10201 | 631 | .Sp |
832b75ed GG |
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. | |
f9e10201 | 635 | .Sp |
832b75ed GG |
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 | |
ee38a438 GI |
639 | ATA-3 revision 4) that implemented SMART before the SMART standards |
640 | were incorporated into the ATA/ATAPI Specifications. | |
832b75ed GG |
641 | [Please see the \fBsmartctl \-T\fP command-line option.] |
642 | .TP | |
643 | .B \-o VALUE | |
cfbba5b9 | 644 | [ATA only] Enables or disables SMART Automatic Offline Testing when |
832b75ed GG |
645 | \fBsmartd\fP |
646 | starts up and has no further effect. The valid arguments to this | |
647 | Directive are \fIon\fP and \fIoff\fP. | |
f9e10201 | 648 | .Sp |
832b75ed GG |
649 | The delay between tests is vendor-specific, but is typically four |
650 | hours. | |
f9e10201 | 651 | .Sp |
832b75ed GG |
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 | |
a86ec89e GI |
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 | |
832b75ed | 668 | failure is predicted in less than 24 hours, and a message at loglevel |
f9e10201 | 669 | .B \*(AqLOG_CRIT\*(Aq |
832b75ed GG |
670 | will be logged to syslog. [Please see the |
671 | .B smartctl \-H | |
672 | command-line option.] | |
f9e10201 JD |
673 | .\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin |
674 | .Sp | |
ff28b140 TL |
675 | [NVMe] Checks the "Critical Warning" byte from the SMART/Health |
676 | Information log. | |
f9e10201 | 677 | If any warning bit is set, a message at loglevel \fB\*(AqLOG_CRIT\*(Aq\fP |
a86ec89e | 678 | will be logged to syslog. |
f9e10201 | 679 | .\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin |
832b75ed GG |
680 | .TP |
681 | .B \-l TYPE | |
e9583e0c | 682 | Reports increases in the number of errors in one of three SMART logs. The |
832b75ed | 683 | valid arguments to this Directive are: |
f9e10201 | 684 | .Sp |
832b75ed | 685 | .I error |
a86ec89e | 686 | \- [ATA] report if the number of ATA errors reported in the Summary SMART |
cfbba5b9 | 687 | error log has increased since the last check. |
f9e10201 JD |
688 | .Sp |
689 | .\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
a86ec89e | 690 | .I error |
ff28b140 | 691 | \- [NVMe] report if the "Number of Error Information Log Entries" from the |
a86ec89e | 692 | SMART/Health Information log has increased since the last check. |
f9e10201 JD |
693 | .Sp |
694 | .\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
e9583e0c | 695 | .I xerror |
a86ec89e | 696 | \- [ATA] report if the number of ATA errors reported in the Extended |
d008864d | 697 | Comprehensive SMART error log has increased since the last check. |
f9e10201 JD |
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 | |
e9583e0c | 702 | [Please see the \fBsmartctl \-l xerror\fP command-line option.] |
f9e10201 JD |
703 | .Sp |
704 | .\" %IF OS Darwin FreeBSD Linux NetBSD Windows Cygwin | |
a86ec89e | 705 | .I xerror |
ff28b140 | 706 | \- [NVMe] same as \*(Aq\-l error\*(Aq. |
f9e10201 JD |
707 | .\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin |
708 | .Sp | |
832b75ed GG |
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 | |
f9e10201 JD |
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 | |
cfbba5b9 | 719 | command-line option. |
832b75ed GG |
720 | [Please see the \fBsmartctl \-l\fP and \fB\-t\fP command-line |
721 | options.] | |
f9e10201 | 722 | .Sp |
cfbba5b9 | 723 | [ATA only] Failed self-tests outdated by a newer successful extended |
ee38a438 | 724 | self-test are ignored. The warning email counter is reset if the |
d008864d | 725 | number of failed self tests dropped to 0. This typically happens when |
ee38a438 | 726 | an extended self-test is run after all bad sectors have been reallocated. |
f9e10201 | 727 | .Sp |
d008864d GI |
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, | |
f9e10201 | 732 | therefore \*(Aq\-l offlinests\*(Aq is not enabled by \*(Aq\-a\*(Aq Directive. |
d008864d | 733 | .\" %IF NOT OS Cygwin Windows |
f9e10201 | 734 | .\"! Appending ',ns' (no standby) to this directive is not implemented |
d008864d GI |
735 | .\"! on OS_MAN_FILTER. |
736 | .\" %ENDIF NOT OS Cygwin Windows | |
737 | .\" %IF OS Cygwin Windows | |
f9e10201 JD |
738 | .Sp |
739 | [Windows and Cygwin only] If \*(Aq,ns\*(Aq (no standby) is appended to this | |
d008864d | 740 | directive, smartd disables system auto standby as long as an Offline |
f9e10201 | 741 | Data Collection is in progress. See \*(Aq\-l selfteststs,ns\*(Aq below. |
d008864d | 742 | .\" %ENDIF OS Cygwin Windows |
f9e10201 | 743 | .Sp |
d008864d GI |
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 | |
f9e10201 | 749 | .\"! Appending ',ns' (no standby) to this directive is not implemented |
d008864d GI |
750 | .\"! on OS_MAN_FILTER. |
751 | .\" %ENDIF NOT OS Cygwin Windows | |
752 | .\" %IF OS Cygwin Windows | |
f9e10201 JD |
753 | .Sp |
754 | [Windows and Cygwin only] If \*(Aq,ns\*(Aq (no standby) is appended to this | |
d008864d GI |
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 | |
f9e10201 | 758 | interval (\*(Aq\-i\*(Aq option) should be shorter than the configured idle |
d008864d GI |
759 | timeout. Auto standby is not disabled if the system is running on |
760 | battery. | |
761 | .\" %ENDIF OS Cygwin Windows | |
f9e10201 | 762 | .Sp |
cfbba5b9 | 763 | .I scterc,READTIME,WRITETIME |
f4e463df GI |
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. | |
cfbba5b9 GI |
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.] | |
d008864d | 770 | .TP |
ee38a438 GI |
771 | .B \-e NAME[,VALUE] |
772 | Sets non-SMART device settings when \fBsmartd\fP starts up and has no | |
773 | further effect. | |
d008864d GI |
774 | [Please see the \fBsmartctl \-\-set\fP command-line option.] |
775 | Valid arguments are: | |
f9e10201 | 776 | .Sp |
d008864d GI |
777 | .I aam,[N|off] |
778 | \- [ATA only] Sets the Automatic Acoustic Management (AAM) feature. | |
f9e10201 | 779 | .Sp |
d008864d GI |
780 | .I apm,[N|off] |
781 | \- [ATA only] Sets the Advanced Power Management (APM) feature. | |
f9e10201 | 782 | .Sp |
d008864d GI |
783 | .I lookahead,[on|off] |
784 | \- [ATA only] Sets the read look-ahead feature. | |
f9e10201 | 785 | .Sp |
d008864d GI |
786 | .I security-freeze |
787 | \- [ATA only] Sets ATA Security feature to frozen mode. | |
f9e10201 | 788 | .Sp |
d008864d GI |
789 | .I standby,[N|off] |
790 | \- [ATA only] Sets the standby (spindown) timer and places the drive in the | |
791 | IDLE mode. | |
f9e10201 | 792 | .Sp |
d008864d GI |
793 | .I wcache,[on|off] |
794 | \- [ATA only] Sets the volatile write cache feature. | |
f9e10201 JD |
795 | .Sp |
796 | .I dsn,[on|off] | |
797 | \- [ATA only] | |
798 | [NEW EXPERIMENTAL SMARTD FEATURE] | |
799 | Sets the DSN feature. | |
832b75ed GG |
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 | |
f9e10201 | 805 | match the extended regular expression \fBREGEXP\fP. Here: |
832b75ed GG |
806 | .RS 7 |
807 | .IP \fBT\fP 4 | |
808 | is the type of the test. The values that \fBsmartd\fP will try to | |
f9e10201 JD |
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 | |
832b75ed GG |
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. | |
f9e10201 JD |
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. | |
cfbba5b9 | 818 | The LBA range is based on the first span from the last test. |
2127e193 GI |
819 | See the \fBsmartctl \-t select,[next|redo|cont]\fP options for |
820 | further info. | |
f9e10201 JD |
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 | |
f4e463df GI |
824 | test span is preserved by smartd and used if (and only if) the selective |
825 | self test log is empty. | |
832b75ed GG |
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 | |
f9e10201 | 831 | is the day of the month, expressed with two decimal digits. The |
832b75ed GG |
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 | |
f9e10201 | 839 | hours after midnight. The range is 00 (midnight to just before 1 am) |
832b75ed GG |
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 | |
f9e10201 JD |
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 | |
832b75ed | 854 | \fB \-s S/../.././02\fP |
f9e10201 JD |
855 | .br |
856 | To schedule a long Self-Test between 4\(en5 am every Sunday morning, use: | |
857 | .br | |
832b75ed | 858 | \fB \-s L/../../7/04\fP |
f9e10201 JD |
859 | .br |
860 | To schedule a long Self-Test between 10\(en11 pm on the first and | |
832b75ed | 861 | fifteenth day of each month, use: |
f9e10201 | 862 | .br |
832b75ed | 863 | \fB \-s L/../(01|15)/./22\fP |
f9e10201 JD |
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 | |
832b75ed | 869 | \fB \-s (O/../.././(00|06|12|18)|S/../.././01|L/../../6/03)\fP |
f9e10201 | 870 | .br |
2127e193 GI |
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. | |
f9e10201 | 873 | To setup a full test of a 1 TB disk within 20 days (one 50 GB span |
2127e193 GI |
874 | each day), run this command once: |
875 | .nf | |
f9e10201 | 876 | smartctl \-t select,0\-99999999 /dev/sda |
2127e193 | 877 | .fi |
f9e10201 | 878 | To run the next test spans on Monday\(enFriday between 12\(en13 am, run smartd |
2127e193 | 879 | with this directive: |
f9e10201 JD |
880 | .br |
881 | \fB \-s n/../../[1\-5]/12\fP | |
882 | .Sp | |
832b75ed GG |
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 | |
f9e10201 | 887 | if you use the \*(Aq\-i\*(Aq option to make this polling interval more than |
832b75ed | 888 | sixty minutes: the poll times may fail to coincide with any of the |
2127e193 GI |
889 | testing times that you have specified with \fBREGEXP\fP. In this case |
890 | the test will be run following the next device polling. | |
f9e10201 | 891 | .Sp |
832b75ed GG |
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. | |
f9e10201 | 896 | .Sp |
832b75ed GG |
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. | |
f9e10201 | 899 | .Sp |
a37e7145 GG |
900 | To avoid performance problems during system boot, \fBsmartd\fP will |
901 | not attempt to run any scheduled tests following the very first | |
f9e10201 JD |
902 | device polling (unless \*(Aq\-q onecheck\*(Aq is specified). |
903 | .Sp | |
832b75ed | 904 | Each time a test is run, \fBsmartd\fP will log an entry to SYSLOG. |
f9e10201 | 905 | You can use these or the \*(Aq\-q showtests\*(Aq command-line option to verify |
832b75ed GG |
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. | |
f9e10201 | 910 | .Sp |
2127e193 | 911 | If the scheduled tests are used in conjunction with state persistence |
f9e10201 JD |
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 | |
2127e193 GI |
914 | during downtime, the longest (see above) of these tests is run after |
915 | second device polling. | |
f9e10201 JD |
916 | .Sp |
917 | If the \*(Aq\-n\*(Aq directive is used and any test would have been started | |
2127e193 GI |
918 | during disk standby time, the longest of these tests is run when the |
919 | disk is active again. | |
f9e10201 | 920 | .Sp |
832b75ed | 921 | Unix users: please beware that the rules for extended regular |
d2e702cf GI |
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 | |
832b75ed GG |
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. | |
832b75ed GG |
927 | .TP |
928 | .B \-m ADD | |
f9e10201 JD |
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 | |
832b75ed | 935 | To prevent your email in-box from getting filled up with warning |
f9e10201 JD |
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 | |
832b75ed GG |
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). | |
f9e10201 JD |
944 | .Sp |
945 | To test that email is being sent correctly, use the \*(Aq\-M test\*(Aq | |
832b75ed GG |
946 | Directive described below to send one test email message on |
947 | \fBsmartd\fP | |
948 | startup. | |
f9e10201 | 949 | .Sp |
d2e702cf GI |
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 | |
832b75ed GG |
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 | |
f9e10201 JD |
956 | run, please use the \*(Aq\-M exec\*(Aq Directive below. |
957 | .Sp | |
d008864d | 958 | .\" %IF OS Windows |
f9e10201 JD |
959 | [Windows only] On Windows, the \*(Aq\fBBlat\fP\*(Aq mailer |
960 | (<\fBhttp://blat.sourceforge.net/\fP>) is used by default. | |
832b75ed | 961 | This mailer uses a different command line syntax, see |
f9e10201 JD |
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 | |
d008864d | 971 | .\" %ENDIF OS Windows |
832b75ed GG |
972 | Note also that there is a special argument |
973 | .B <nomailer> | |
f9e10201 JD |
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 | |
832b75ed GG |
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 | |
f9e10201 | 980 | remainder of the output is discarded. If problems are encountered in |
832b75ed GG |
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 | |
f9e10201 JD |
983 | mode with the \*(Aq\-d\*(Aq flag, using the \*(Aq\-M test\*(Aq Directive |
984 | described below. | |
d2e702cf | 985 | .\" %IF ENABLE_SMARTDPLUGINDIR |
ee38a438 | 986 | .\" %IF NOT OS Windows |
f9e10201 JD |
987 | .Sp |
988 | If a word of the comma separated list has the form \*(Aq@plugin\*(Aq, a custom | |
ee38a438 | 989 | script /usr/local/etc/smartd_warning.d/plugin is run and the word is |
f9e10201 JD |
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/* | |
ee38a438 GI |
993 | are run instead. |
994 | This is handled by the script /usr/local/etc/smartd_warning.sh | |
f9e10201 | 995 | (see also \*(Aq\-M exec\*(Aq below). |
ee38a438 | 996 | .\" %ENDIF NOT OS Windows |
d2e702cf | 997 | .\" %ENDIF ENABLE_SMARTDPLUGINDIR |
d008864d | 998 | .\" %IF OS Windows |
f9e10201 | 999 | .Sp |
a86ec89e GI |
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(). | |
ee38a438 | 1002 | This displays message boxes on the desktops of the selected sessions. |
f9e10201 JD |
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 | |
ee38a438 GI |
1006 | all connected (active or waiting for login) remote sessions. |
1007 | This is handled by the script EXEDIR/smartd_warning.cmd which runs | |
f9e10201 | 1008 | the tool EXEDIR/wtssendmsg.exe (see also \*(Aq\-M exec\*(Aq below). |
d008864d | 1009 | .\" %ENDIF OS Windows |
832b75ed GG |
1010 | .TP |
1011 | .B \-M TYPE | |
1012 | These Directives modify the behavior of the | |
1013 | \fBsmartd\fP | |
f9e10201 JD |
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 | |
832b75ed | 1016 | Directive and can not be used without it. |
f9e10201 | 1017 | .Sp |
832b75ed GG |
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. | |
f9e10201 | 1021 | .Sp |
832b75ed GG |
1022 | The valid arguments to the \-M Directive are (one of the following |
1023 | three): | |
f9e10201 | 1024 | .Sp |
832b75ed GG |
1025 | .I once |
1026 | \- send only one warning email for each type of disk problem detected. This | |
f9e10201 JD |
1027 | is the default unless state persistence (\*(Aq\-s\*(Aq option) is enabled. |
1028 | .Sp | |
832b75ed GG |
1029 | .I daily |
1030 | \- send additional warning reminder emails, once per day, for each type | |
cfbba5b9 | 1031 | of disk problem detected. This is the default if state persistence |
f9e10201 JD |
1032 | (\*(Aq\-s\*(Aq option) is enabled. |
1033 | .Sp | |
832b75ed GG |
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 | |
f9e10201 | 1037 | type of disk problem detected. Each interval is twice as long as the |
832b75ed | 1038 | previous interval. |
f9e10201 | 1039 | .Sp |
d008864d GI |
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. | |
f9e10201 | 1042 | .Sp |
832b75ed | 1043 | In addition, one may add zero or more of the following Directives: |
f9e10201 | 1044 | .Sp |
832b75ed GG |
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. | |
9ebc753d GG |
1050 | Note that if this Directive is used, |
1051 | \fBsmartd\fP | |
f9e10201 JD |
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 | |
832b75ed GG |
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. | |
ee38a438 | 1060 | .\" %IF OS Windows |
f9e10201 | 1061 | .Sp |
ee38a438 GI |
1062 | [Windows only] The PATH may contain space characters. |
1063 | Then it must be included in double quotes. | |
1064 | .\" %ENDIF OS Windows | |
f9e10201 | 1065 | .Sp |
832b75ed GG |
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 | |
f9e10201 | 1069 | to all logged-in users, etc.\&) But please be careful. \fBsmartd\fP |
832b75ed | 1070 | will \fBblock\fP until the executable PATH returns, so if your |
ee38a438 GI |
1071 | executable hangs, then \fBsmartd\fP will also hang. |
1072 | .\" %IF NOT OS Windows | |
1073 | Some sample scripts are included in | |
e9583e0c | 1074 | /usr/local/share/doc/smartmontools/examplescripts/. |
ee38a438 | 1075 | .\" %ENDIF NOT OS Windows |
f9e10201 JD |
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 | |
832b75ed GG |
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. | |
f9e10201 | 1085 | .Sp |
832b75ed GG |
1086 | Before running the executable, \fBsmartd\fP sets a number of |
1087 | environment variables. These environment variables may be used to | |
f9e10201 | 1088 | control the executable's behavior. The environment variables |
832b75ed GG |
1089 | exported by \fBsmartd\fP are: |
1090 | .RS 7 | |
1091 | .IP \fBSMARTD_MAILER\fP 4 | |
f9e10201 | 1092 | is set to the argument of \-M exec, if present or else to \*(Aqmail\*(Aq |
d2e702cf | 1093 | (examples: /usr/local/bin/mail, mail). |
832b75ed | 1094 | .IP \fBSMARTD_DEVICE\fP 4 |
a86ec89e | 1095 | is set to the device path (example: /dev/sda). |
832b75ed | 1096 | .IP \fBSMARTD_DEVICETYPE\fP 4 |
f9e10201 JD |
1097 | is set to the device type specified by \*(Aq\-d\*(Aq directive or |
1098 | \*(Aqauto\*(Aq if none. | |
832b75ed | 1099 | .IP \fBSMARTD_DEVICESTRING\fP 4 |
f9e10201 JD |
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. | |
ee38a438 GI |
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. | |
832b75ed GG |
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: | |
d2e702cf | 1112 | .br |
832b75ed | 1113 | \fIEmailTest\fP: this is an email test message. |
d2e702cf | 1114 | .br |
832b75ed | 1115 | \fIHealth\fP: the SMART health status indicates imminent failure. |
d2e702cf | 1116 | .br |
832b75ed | 1117 | \fIUsage\fP: a usage Attribute has failed. |
d2e702cf | 1118 | .br |
832b75ed | 1119 | \fISelfTest\fP: the number of self-test failures has increased. |
d2e702cf | 1120 | .br |
832b75ed | 1121 | \fIErrorCount\fP: the number of errors in the ATA error log has increased. |
d2e702cf | 1122 | .br |
832b75ed GG |
1123 | \fICurrentPendingSector\fP: one of more disk sectors could not be |
1124 | read and are marked to be reallocated (replaced with spare sectors). | |
d2e702cf | 1125 | .br |
ee38a438 | 1126 | \fIOfflineUncorrectableSector\fP: during off-line testing, or self-testing, |
832b75ed | 1127 | one or more disk sectors could not be read. |
d2e702cf | 1128 | .br |
e9583e0c | 1129 | \fITemperature\fP: Temperature reached critical limit (see \-W directive). |
d2e702cf | 1130 | .br |
832b75ed | 1131 | \fIFailedHealthCheck\fP: the SMART health status command failed. |
d2e702cf | 1132 | .br |
832b75ed | 1133 | \fIFailedReadSmartData\fP: the command to read SMART Attribute data failed. |
d2e702cf | 1134 | .br |
832b75ed | 1135 | \fIFailedReadSmartErrorLog\fP: the command to read the SMART error log failed. |
d2e702cf | 1136 | .br |
f9e10201 JD |
1137 | \fIFailedReadSmartSelfTestLog\fP: the command to read the SMART self-test log |
1138 | failed. | |
d2e702cf | 1139 | .br |
832b75ed GG |
1140 | \fIFailedOpenDevice\fP: the open() command to the device failed. |
1141 | .IP \fBSMARTD_ADDRESS\fP 4 | |
f9e10201 | 1142 | is determined by the address argument ADD of the \*(Aq\-m\*(Aq Directive. |
832b75ed GG |
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 | |
d2e702cf | 1148 | quoted, so to use it in a shell script you may want to enclose it in |
832b75ed | 1149 | double quotes. |
ee38a438 GI |
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 | |
832b75ed GG |
1155 | .IP \fBSMARTD_MESSAGE\fP 4 |
1156 | is set to the one sentence summary warning email message string from | |
f9e10201 JD |
1157 | \fBsmartd\fP. |
1158 | This message string contains space characters and is NOT quoted. So to | |
d2e702cf | 1159 | use $SMARTD_MESSAGE in a shell script you should probably enclose it in |
832b75ed | 1160 | double quotes. |
ee38a438 | 1161 | .\" %IF NOT OS Windows |
832b75ed GG |
1162 | .IP \fBSMARTD_FULLMESSAGE\fP 4 |
1163 | is set to the contents of the entire email warning message string from | |
f9e10201 JD |
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. | |
ee38a438 GI |
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 | |
832b75ed GG |
1177 | .IP \fBSMARTD_TFIRST\fP 4 |
1178 | is a text string giving the time and date at which the first problem | |
f9e10201 JD |
1179 | of this type was reported. This text string contains space characters |
1180 | and no newlines, and is NOT quoted. For example: | |
d2e702cf | 1181 | .br |
832b75ed GG |
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. | |
ee38a438 GI |
1186 | .IP \fBSMARTD_PREVCNT\fP 4 |
1187 | is an integer specifying the number of previous messages sent. | |
f9e10201 | 1188 | It is set to \*(Aq0\*(Aq for the first message. |
ee38a438 GI |
1189 | .IP \fBSMARTD_NEXTDAYS\fP 4 |
1190 | is an integer specifying the number of days until the next message will be sent. | |
f9e10201 JD |
1191 | It it set to empty on \*(Aq\-M once\*(Aq and set to \*(Aq1\*(Aq on |
1192 | \*(Aq\-M daily\*(Aq. | |
832b75ed GG |
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 \& | |
f9e10201 | 1198 | If the \*(Aq\-m ADD\*(Aq Directive is given with a normal address argument, |
832b75ed GG |
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: | |
f9e10201 JD |
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 | |
d008864d | 1213 | .\" %IF OS Windows |
f9e10201 JD |
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 | |
d008864d | 1220 | .\" %ENDIF OS Windows |
f9e10201 | 1221 | If the \*(Aq\-m ADD\*(Aq Directive is given with the special address argument |
832b75ed GG |
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: | |
f9e10201 JD |
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 | |
832b75ed GG |
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. | |
f9e10201 JD |
1248 | .Sp |
1249 | Some EXAMPLES of scripts that can be used with the \*(Aq\-M exec\*(Aq | |
ee38a438 GI |
1250 | Directive are given below. |
1251 | .\" %IF NOT OS Windows | |
1252 | Some sample scripts are also included in | |
e9583e0c | 1253 | /usr/local/share/doc/smartmontools/examplescripts/. |
ee38a438 | 1254 | .\" %ENDIF NOT OS Windows |
f9e10201 | 1255 | .Sp |
a86ec89e | 1256 | The executable is run by the script |
ee38a438 GI |
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. | |
832b75ed GG |
1279 | .TP |
1280 | .B \-f | |
f9e10201 | 1281 | [ATA only] Check for \*(Aqfailure\*(Aq of any Usage Attributes. If these |
cfbba5b9 GI |
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." | |
832b75ed GG |
1285 | [Please see the \fBsmartctl \-A\fP command-line option.] |
1286 | .TP | |
1287 | .B \-p | |
cfbba5b9 | 1288 | [ATA only] Report anytime that a Prefail Attribute has changed |
f9e10201 | 1289 | its value since the last check. [Please see the |
832b75ed GG |
1290 | .B smartctl \-A |
1291 | command-line option.] | |
1292 | .TP | |
1293 | .B \-u | |
cfbba5b9 | 1294 | [ATA only] Report anytime that a Usage Attribute has changed its value |
f9e10201 | 1295 | since the last check. [Please see the |
832b75ed GG |
1296 | .B smartctl \-A |
1297 | command-line option.] | |
1298 | .TP | |
1299 | .B \-t | |
f9e10201 JD |
1300 | [ATA only] Equivalent to turning on the two previous flags \*(Aq\-p\*(Aq |
1301 | and \*(Aq\-u\*(Aq. | |
832b75ed | 1302 | Tracks changes in \fIall\fP device Attributes (both Prefailure and |
f9e10201 | 1303 | Usage). [Please see the \fBsmartctl\fP \-A command-line option.] |
832b75ed GG |
1304 | .TP |
1305 | .B \-i ID | |
cfbba5b9 GI |
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 | |
f9e10201 | 1308 | from 1 to 255. This Directive modifies the behavior of the \*(Aq\-f\*(Aq |
832b75ed | 1309 | Directive and has no effect without it. |
f9e10201 JD |
1310 | .Sp |
1311 | This is useful, for example, if you have a very old disk and don't | |
832b75ed GG |
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 | |
cfbba5b9 | 1317 | [ATA only] Ignore device Attribute \fBID\fP when tracking changes in the |
832b75ed | 1318 | Attribute values. \fBID\fP must be a decimal integer in the range |
f9e10201 JD |
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 | |
832b75ed | 1323 | This is useful, for example, if one of the device Attributes is the disk |
f9e10201 | 1324 | temperature (usually Attribute 194 or 231). It's annoying to get reports |
832b75ed GG |
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 | |
2127e193 | 1328 | .B \-r ID[!] |
cfbba5b9 GI |
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 | |
f9e10201 JD |
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 | |
832b75ed GG |
1336 | A common use of this Directive is to track the device Temperature |
1337 | (often ID=194 or 231). | |
f9e10201 JD |
1338 | .Sp |
1339 | If the optional flag \*(Aq!\*(Aq is appended, a change of the Normalized | |
2127e193 | 1340 | value is considered critical. The report will be logged as LOG_CRIT |
f9e10201 | 1341 | and a warning email will be sent if \*(Aq\-m\*(Aq is specified. |
832b75ed | 1342 | .TP |
2127e193 | 1343 | .B \-R ID[!] |
cfbba5b9 | 1344 | [ATA only] When tracking, report whenever the \fIRaw\fP value of Attribute |
832b75ed GG |
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 | |
f9e10201 JD |
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 | |
832b75ed GG |
1353 | Directive for the same Attribute, so that the Raw value of the |
1354 | Attribute is reported. | |
f9e10201 | 1355 | .Sp |
832b75ed GG |
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. | |
f9e10201 JD |
1360 | .Sp |
1361 | If the optional flag \*(Aq!\*(Aq is appended, a change of the Raw | |
2127e193 | 1362 | value is considered critical. The report will be logged as |
f9e10201 JD |
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. | |
832b75ed | 1365 | .TP |
2127e193 | 1366 | .B \-C ID[+] |
832b75ed GG |
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 | |
e9583e0c | 1373 | pending sectors). If the name of this Attribute is changed by a |
f9e10201 | 1374 | \*(Aq\-v 197,FORMAT,NAME\*(Aq directive, the default is changed to |
e9583e0c | 1375 | \fB\-C 0\fP. |
f9e10201 JD |
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 | |
2127e193 | 1379 | attribute when a bad sector is reallocated. |
f9e10201 JD |
1380 | See also \*(Aq\-v 197,increasing\*(Aq below. |
1381 | .Sp | |
d008864d GI |
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. | |
f9e10201 | 1385 | .Sp |
832b75ed | 1386 | A pending sector is a disk sector (containing 512 bytes of your data) |
f9e10201 | 1387 | which the device would like to mark as "bad" and reallocate. |
832b75ed GG |
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. | |
832b75ed | 1397 | .TP |
2127e193 | 1398 | .B \-U ID[+] |
832b75ed GG |
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 | |
e9583e0c | 1405 | offline uncorrectable sectors). If the name of this Attribute is changed |
f9e10201 JD |
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 | |
2127e193 | 1412 | attribute when a bad sector is reallocated. |
f9e10201 JD |
1413 | See also \*(Aq\-v 198,increasing\*(Aq below. |
1414 | .Sp | |
d008864d GI |
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. | |
f9e10201 | 1418 | .Sp |
832b75ed | 1419 | An offline uncorrectable sector is a disk sector which was not |
ee38a438 | 1420 | readable during an off-line scan or a self-test. This is important |
832b75ed | 1421 | to know, because if you have data stored in this disk sector, and you |
f9e10201 | 1422 | need to read it, the read will fail. Please see the previous \*(Aq\-C\*(Aq |
832b75ed | 1423 | option for more details. |
4d59bff9 GG |
1424 | .TP |
1425 | .B \-W DIFF[,INFO[,CRIT]] | |
1426 | Report if the current temperature had changed by at least \fBDIFF\fP | |
2127e193 GI |
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 | |
f9e10201 JD |
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 | |
d008864d GI |
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. | |
f9e10201 | 1437 | .Sp |
2127e193 | 1438 | If this directive is used in conjunction with state persistence |
f9e10201 JD |
1439 | (\*(Aq\-s\*(Aq option), the min and max temperature values are preserved |
1440 | across boot cycles. The minimum temperature value is not updated | |
2127e193 | 1441 | during the first 30 minutes after startup. |
f9e10201 | 1442 | .Sp |
4d59bff9 | 1443 | To disable any of the 3 reports, set the corresponding limit to 0. |
f9e10201 JD |
1444 | Trailing zero arguments may be omitted. By default, all temperature |
1445 | reports are disabled (\*(Aq\-W 0\*(Aq). | |
1446 | .Sp | |
4d59bff9 | 1447 | To track temperature changes of at least 2 degrees, use: |
f9e10201 | 1448 | .br |
f4e463df | 1449 | .B \-W 2 |
f9e10201 | 1450 | .br |
4d59bff9 | 1451 | To log informal messages on temperatures of at least 40 degrees, use: |
f9e10201 | 1452 | .br |
f4e463df | 1453 | .B \-W 0,40 |
f9e10201 | 1454 | .br |
4d59bff9 | 1455 | For warning messages/mails on temperatures of at least 45 degrees, use: |
f9e10201 | 1456 | .br |
f4e463df | 1457 | .B \-W 0,0,45 |
f9e10201 | 1458 | .br |
4d59bff9 | 1459 | To combine all of the above reports, use: |
f9e10201 | 1460 | .br |
f4e463df | 1461 | .B \-W 2,40,45 |
f9e10201 | 1462 | .Sp |
ee38a438 | 1463 | For ATA devices, smartd interprets Attribute 194 or 190 as Temperature Celsius |
f9e10201 JD |
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 | |
a86ec89e GI |
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. | |
f9e10201 | 1470 | .\" %ENDIF OS Darwin FreeBSD Linux NetBSD Windows Cygwin |
832b75ed GG |
1471 | .TP |
1472 | .B \-F TYPE | |
ee38a438 GI |
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: | |
f9e10201 | 1476 | .Sp |
832b75ed | 1477 | .I none |
e9583e0c | 1478 | \- Assume that the device firmware obeys the ATA specifications. This |
f9e10201 | 1479 | is the default, unless the device has presets for \*(Aq\-F\*(Aq in the |
d2e702cf | 1480 | drive database. Using this directive will override any preset values. |
f9e10201 | 1481 | .Sp |
ee38a438 GI |
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. | |
f9e10201 | 1486 | .Sp |
832b75ed GG |
1487 | .I samsung |
1488 | \- In some Samsung disks (example: model SV4012H Firmware Version: | |
ee38a438 GI |
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). | |
832b75ed | 1491 | Enabling this option tells \fBsmartd\fP to evaluate these quantities |
ee38a438 GI |
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; | |
832b75ed GG |
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. | |
f9e10201 | 1496 | .Sp |
832b75ed | 1497 | .I samsung2 |
e9583e0c GI |
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 | |
ee38a438 | 1500 | byte-reversed order. |
f9e10201 | 1501 | .Sp |
a37e7145 | 1502 | .I samsung3 |
ee38a438 GI |
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 | |
f9e10201 JD |
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 | |
ee38a438 GI |
1508 | .I xerrorlba |
1509 | \- This only affects \fBsmartctl\fP. | |
f9e10201 | 1510 | .Sp |
832b75ed | 1511 | [Please see the \fBsmartctl \-F\fP command-line option.] |
832b75ed | 1512 | .TP |
a23d5117 | 1513 | .B \-v ID,FORMAT[:BYTEORDER][,NAME] |
ee38a438 | 1514 | [ATA only] Sets a vendor-specific raw value print FORMAT, an optional |
a23d5117 | 1515 | BYTEORDER and an optional NAME for Attribute ID. |
bed94269 | 1516 | This directive may be used multiple times. |
f9e10201 JD |
1517 | Please see \fBsmartctl \-v\fP command-line option for further details. |
1518 | .Sp | |
bed94269 | 1519 | The following arguments affect smartd warning output: |
f9e10201 | 1520 | .Sp |
2127e193 GI |
1521 | .I 197,increasing |
1522 | \- Raw Attribute number 197 (Current Pending Sector Count) is not | |
f9e10201 JD |
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 | |
2127e193 GI |
1526 | .I 198,increasing |
1527 | \- Raw Attribute number 198 (Offline Uncorrectable Sector Count) is not | |
f9e10201 JD |
1528 | reset if uncorrectable sectors are reallocated. This sets \*(Aq\-U 198+\*(Aq |
1529 | if no other \*(Aq\-U\*(Aq directive is specified. | |
832b75ed GG |
1530 | .TP |
1531 | .B \-P TYPE | |
cfbba5b9 GI |
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: | |
f9e10201 | 1535 | .Sp |
832b75ed GG |
1536 | .I use |
1537 | \- use any presets that are available for this drive. This is the default. | |
f9e10201 | 1538 | .Sp |
832b75ed GG |
1539 | .I ignore |
1540 | \- do not use any presets for this drive. | |
f9e10201 | 1541 | .Sp |
832b75ed GG |
1542 | .I show |
1543 | \- show the presets listed for this drive in the database. | |
f9e10201 | 1544 | .Sp |
832b75ed GG |
1545 | .I showall |
1546 | \- show the presets that are available for all drives and then exit. | |
f9e10201 | 1547 | .Sp |
832b75ed GG |
1548 | [Please see the |
1549 | .B smartctl \-P | |
1550 | command-line option.] | |
832b75ed GG |
1551 | .TP |
1552 | .B \-a | |
f9e10201 JD |
1553 | Equivalent to turning on all of the following Directives: |
1554 | .B \*(Aq\-H\*(Aq | |
832b75ed | 1555 | to check the SMART health status, |
f9e10201 | 1556 | .B \*(Aq\-f\*(Aq |
832b75ed | 1557 | to report failures of Usage (rather than Prefail) Attributes, |
f9e10201 | 1558 | .B \*(Aq\-t\*(Aq |
832b75ed | 1559 | to track changes in both Prefailure and Usage Attributes, |
f9e10201 | 1560 | .B \*(Aq\-l\ error\*(Aq |
832b75ed | 1561 | to report increases in the number of ATA errors, |
f9e10201 | 1562 | .B \*(Aq\-l\ selftest\*(Aq |
d008864d | 1563 | to report increases in the number of Self-Test Log errors, |
f9e10201 | 1564 | .B \*(Aq\-l\ selfteststs\*(Aq |
d008864d | 1565 | to report changes of Self-Test execution status, |
f9e10201 | 1566 | .B \*(Aq\-C 197\*(Aq |
832b75ed | 1567 | to report nonzero values of the current pending sector count, and |
f9e10201 | 1568 | .B \*(Aq\-U 198\*(Aq |
832b75ed | 1569 | to report nonzero values of the offline pending sector count. |
f9e10201 | 1570 | .Sp |
832b75ed GG |
1571 | Note that \-a is the default for ATA devices. If none of these other |
1572 | Directives is given, then \-a is assumed. | |
832b75ed GG |
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: | |
f9e10201 JD |
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 | |
832b75ed | 1594 | .TP |
f9e10201 JD |
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 | |
832b75ed | 1599 | Directive. |
f9e10201 JD |
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 | |
832b75ed | 1604 | to the output of the smartd email warning message and sends it to ADDRESS. |
f9e10201 JD |
1605 | .Sp |
1606 | .Vb 4 | |
d2e702cf | 1607 | #! /bin/sh |
832b75ed GG |
1608 | |
1609 | # Save the email message (STDIN) to a file: | |
1610 | cat > /root/msg | |
1611 | ||
f9e10201 JD |
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 | |
832b75ed | 1615 | |
f9e10201 JD |
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 | |
832b75ed | 1623 | then powers down the machine. |
f9e10201 JD |
1624 | .Sp |
1625 | .Vb 4 | |
d2e702cf | 1626 | #! /bin/sh |
832b75ed GG |
1627 | |
1628 | # Warn all users of a problem | |
d2e702cf GI |
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 | ||
832b75ed GG |
1635 | # Wait half a minute |
1636 | sleep 30 | |
d2e702cf | 1637 | |
832b75ed | 1638 | # Power down the machine |
f9e10201 JD |
1639 | /sbin/shutdown \-hf now |
1640 | .Ve | |
1641 | .Sp | |
832b75ed | 1642 | Some example scripts are distributed with the smartmontools package, |
e9583e0c | 1643 | in /usr/local/share/doc/smartmontools/examplescripts/. |
f9e10201 | 1644 | .Sp |
832b75ed GG |
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. | |
f9e10201 | 1649 | .Sp |
832b75ed GG |
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. | |
f9e10201 | 1654 | .Sp |
d2e702cf GI |
1655 | .\" %IF NOT OS Windows |
1656 | .SH FILES | |
1657 | .TP | |
1658 | .B /usr/local/etc/smartd.conf | |
1659 | full path of this file. | |
f9e10201 | 1660 | .Sp |
d2e702cf GI |
1661 | .\" %ENDIF NOT OS Windows |
1662 | .SH SEE ALSO | |
1663 | \fBsmartd\fP(8), \fBsmartctl\fP(8), | |
1664 | \fBmail\fP(1), \fBregex\fP(7). | |
f9e10201 | 1665 | .Sp |
a86ec89e GI |
1666 | .SH PACKAGE VERSION |
1667 | CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV | |
1668 | .br | |
ff28b140 | 1669 | $Id: smartd.conf.5.in 4856 2018-12-11 21:42:16Z chrfranke $ |