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