]>
Commit | Line | Data |
---|---|---|
832b75ed | 1 | .ig |
a86ec89e GI |
2 | Copyright (C) 2002-10 Bruce Allen |
3 | Copyright (C) 2004-16 Christian Franke | |
ee38a438 | 4 | |
a86ec89e | 5 | $Id: smartd.8.in 4299 2016-04-16 19:45:57Z chrfranke $ |
832b75ed GG |
6 | |
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. | |
ee38a438 GI |
11 | |
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/>. | |
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/ | |
19 | ||
832b75ed | 20 | .. |
a86ec89e | 21 | .TH SMARTD 8 "CURRENT_SVN_DATE" "CURRENT_SVN_VERSION" "SMART Monitoring Tools" |
832b75ed GG |
22 | .SH NAME |
23 | \fBsmartd\fP \- SMART Disk Monitoring Daemon | |
24 | ||
25 | .SH SYNOPSIS | |
26 | .B smartd [options] | |
27 | ||
832b75ed | 28 | .SH DESCRIPTION |
d008864d GI |
29 | .\" %IF NOT OS ALL |
30 | .\"! [This man page is generated for the OS_MAN_FILTER version of smartmontools. | |
31 | .\"! It does not contain info specific to other platforms.] | |
32 | .\"! .PP | |
33 | .\" %ENDIF NOT OS ALL | |
ee38a438 GI |
34 | \fBsmartd\fP is a daemon that monitors the Self-Monitoring, Analysis and |
35 | Reporting Technology (SMART) system built into most ATA/SATA and SCSI/SAS | |
36 | hard drives and solid-state drives. | |
37 | The purpose of SMART is to monitor the reliability of the hard drive | |
38 | and predict drive failures, and to carry out different types of drive | |
39 | self-tests. | |
40 | This version of \fBsmartd\fP is compatible with | |
d2e702cf | 41 | ACS-3, ACS-2, ATA8-ACS, ATA/ATAPI-7 and earlier standards |
ee38a438 | 42 | (see \fBREFERENCES\fP below). |
832b75ed GG |
43 | |
44 | \fBsmartd\fP will attempt to enable SMART monitoring on ATA devices | |
45 | (equivalent to \fBsmartctl -s on\fP) and polls these and SCSI devices | |
46 | every 30 minutes (configurable), logging SMART errors and changes of | |
47 | SMART Attributes via the SYSLOG interface. The default location for | |
e9583e0c GI |
48 | these SYSLOG notifications and warnings is system-dependent |
49 | (typically \fB/var/log/messages\fP or \fB/var/log/syslog\fP). | |
832b75ed GG |
50 | To change this default location, please see the \fB\'-l\'\fP |
51 | command-line option described below. | |
52 | ||
53 | In addition to logging to a file, \fBsmartd\fP can also be configured | |
54 | to send email warnings if problems are detected. Depending upon the | |
ee38a438 | 55 | type of problem, you may want to run self-tests on the disk, back up |
832b75ed GG |
56 | the disk, replace the disk, or use a manufacturer\'s utility to force |
57 | reallocation of bad or unreadable disk sectors. If disk problems are | |
58 | detected, please see the \fBsmartctl\fP manual page and the | |
59 | \fBsmartmontools\fP web page/FAQ for further guidance. | |
60 | ||
61 | If you send a \fBUSR1\fP signal to \fBsmartd\fP it will immediately | |
62 | check the status of the disks, and then return to polling the disks | |
63 | every 30 minutes. See the \fB\'\-i\'\fP option below for additional | |
64 | details. | |
65 | ||
66 | \fBsmartd\fP can be configured at start-up using the configuration | |
e9583e0c | 67 | file \fB/usr/local/etc/smartd.conf\fP (Windows: \fBEXEDIR/smartd.conf\fP). |
832b75ed GG |
68 | If the configuration file is subsequently modified, \fBsmartd\fP |
69 | can be told to re-read the configuration file by sending it a | |
70 | \fBHUP\fP signal, for example with the command: | |
d2e702cf | 71 | .br |
832b75ed | 72 | \fBkillall -HUP smartd\fP. |
d2e702cf | 73 | .br |
d008864d | 74 | .\" %IF OS Windows |
832b75ed | 75 | (Windows: See NOTES below.) |
d008864d | 76 | .\" %ENDIF OS Windows |
832b75ed GG |
77 | |
78 | On startup, if \fBsmartd\fP finds a syntax error in the configuration | |
79 | file, it will print an error message and then exit. However if | |
80 | \fBsmartd\fP is already running, then is told with a \fBHUP\fP signal | |
81 | to re-read the configuration file, and then find a syntax error in | |
82 | this file, it will print an error message and then continue, ignoring | |
83 | the contents of the (faulty) configuration file, as if the \fBHUP\fP | |
84 | signal had never been received. | |
85 | ||
86 | When \fBsmartd\fP is running in debug mode, the \fBINT\fP signal | |
ee38a438 | 87 | (normally generated from a shell with CONTROL-C) is treated in the |
832b75ed GG |
88 | same way as a \fBHUP\fP signal: it makes \fBsmartd\fP reload its |
89 | configuration file. To exit \fBsmartd\fP use CONTROL-\e | |
d008864d | 90 | .\" %IF OS Windows |
ee38a438 | 91 | (Windows: CONTROL-Break). |
d008864d | 92 | .\" %ENDIF OS Windows |
832b75ed GG |
93 | |
94 | On startup, in the absence of the configuration file | |
95 | \fB/usr/local/etc/smartd.conf\fP, the \fBsmartd\fP daemon first scans for all | |
96 | devices that support SMART. The scanning is done as follows: | |
d008864d | 97 | .\" %IF OS Linux |
832b75ed GG |
98 | .IP \fBLINUX:\fP 9 |
99 | Examine all entries \fB"/dev/hd[a-t]"\fP for IDE/ATA | |
7f0798ef | 100 | devices, and \fB"/dev/sd[a-z]"\fP, \fB"/dev/sd[a-c][a-z]"\fP |
a86ec89e | 101 | for ATA/SATA or SCSI/SAS devices. |
ee38a438 | 102 | Disks behind RAID controllers are not included. |
a86ec89e GI |
103 | |
104 | [NEW EXPERIMENTAL SMARTD FEATURE] | |
105 | If directive \'\-d nvme\' | |
106 | .\" %IF ENABLE_NVME_DEVICESCAN | |
107 | or no \'\-d\' directive | |
108 | .\" %ENDIF ENABLE_NVME_DEVICESCAN | |
109 | is specified, examine all entries \fB"/dev/nvme[0-99]"\fP for NVMe devices. | |
d008864d GI |
110 | .\" %ENDIF OS Linux |
111 | .\" %IF OS FreeBSD | |
832b75ed | 112 | .IP \fBFREEBSD:\fP 9 |
eb07ddf2 | 113 | Authoritative list of disk devices is obtained from SCSI (CAM) and ATA subsystems. |
ee38a438 | 114 | Disks behind RAID controllers are not included. |
d008864d GI |
115 | .\" %ENDIF OS FreeBSD |
116 | .\" %IF OS NetBSD OpenBSD | |
832b75ed GG |
117 | .IP \fBNETBSD/OPENBSD:\fP 9 |
118 | Authoritative list of disk devices is obtained from sysctl | |
119 | \'hw.disknames\'. | |
d008864d GI |
120 | .\" %ENDIF OS NetBSD OpenBSD |
121 | .\" %IF OS Solaris | |
832b75ed | 122 | .IP \fBSOLARIS:\fP 9 |
f4e463df | 123 | Examine all entries \fB"/dev/rdsk/*s0"\fP for IDE/ATA and SCSI disk |
832b75ed | 124 | devices, and entries \fB"/dev/rmt/*"\fP for SCSI tape devices. |
d008864d GI |
125 | .\" %ENDIF OS Solaris |
126 | .\" %IF OS Darwin | |
832b75ed GG |
127 | .IP \fBDARWIN:\fP 9 |
128 | The IOService plane is scanned for ATA block storage devices. | |
d008864d | 129 | .\" %ENDIF OS Darwin |
d008864d | 130 | .\" %IF OS Windows Cygwin |
ee38a438 GI |
131 | .IP \fBWINDOWS\fP: 9 |
132 | Examine all entries \fB"/dev/sd[a\-z]"\fP, \fB"/dev/sd[a\-c][a\-z]"\fP | |
133 | and \fB"/dev/sdd[a\-x]"\fP ("\\\\.\\PhysicalDrive[0\-127]") for | |
134 | IDE/(S)ATA and SCSI disk devices. | |
a37e7145 | 135 | |
4d59bff9 | 136 | If a 3ware 9000 controller is installed, examine all entries |
a37e7145 GG |
137 | \fB"/dev/sdX,N"\fP for the first logical drive (\'unit\' |
138 | \fB"/dev/sdX"\fP) and all physical disks (\'ports\' \fB",N"\fP) | |
4d59bff9 | 139 | detected behind this controller. Same for a second controller if present. |
cfbba5b9 | 140 | |
f4e463df GI |
141 | If directive \'\-d csmi\' or no \'\-d\' directive is specified, |
142 | examine all entries \fB"/dev/csmi[0\-9],N"\fP for drives behind an Intel | |
143 | ICHxR controller with RST driver. | |
ee38a438 GI |
144 | |
145 | Disks behind Areca RAID controllers are not included. | |
a86ec89e GI |
146 | |
147 | [NEW EXPERIMENTAL SMARTD FEATURE] | |
148 | If directive \'\-d nvme\' | |
149 | .\" %IF ENABLE_NVME_DEVICESCAN | |
150 | or no \'\-d\' directive | |
151 | .\" %ENDIF ENABLE_NVME_DEVICESCAN | |
152 | is specified, examine all entries \fB"/dev/nvme[0-9]"\fP for NVMe devices. | |
d008864d | 153 | .\" %ENDIF OS Windows Cygwin |
832b75ed GG |
154 | .PP |
155 | \fBsmartd\fP then monitors | |
156 | for \fIall\fP possible SMART errors (corresponding to the \fB\'\-a\'\fP | |
ee38a438 | 157 | Directive in the configuration file; see the \fBsmartd.conf\fP(5) man page). |
832b75ed | 158 | |
d2e702cf | 159 | .SH OPTIONS |
832b75ed | 160 | .TP |
2127e193 | 161 | .B \-A PREFIX, \-\-attributelog=PREFIX |
ee38a438 GI |
162 | Writes \fBsmartd\fP attribute information (normalized and raw |
163 | attribute values) to files \'PREFIX\'\'MODEL\-SERIAL.ata.csv\' or \'PREFIX\'\'VENDOR\-MODEL\-SERIAL.scsi.csv\'. At each | |
cfbba5b9 GI |
164 | check cycle attributes are logged as a line of semicolon separated triplets |
165 | of the form "attribute-ID;attribute-norm-value;attribute-raw-value;". | |
ee38a438 | 166 | For SCSI devices error counters and temperature recorded in the form "counter-name;counter-value;" |
cfbba5b9 | 167 | Each line is led by a date string of the form "yyyy-mm-dd HH:MM:SS" (in UTC). |
2127e193 | 168 | |
d008864d | 169 | .\" %IF ENABLE_ATTRIBUTELOG |
2127e193 GI |
170 | If this option is not specified, attribute information is written to files |
171 | \'/usr/local/var/lib/smartmontools/attrlog.MODEL\-SERIAL.ata.csv\'. | |
172 | To disable attribute log files, specify this option with an empty string | |
173 | argument: \'-A ""\'. | |
d008864d | 174 | .\" %ENDIF ENABLE_ATTRIBUTELOG |
2127e193 GI |
175 | MODEL and SERIAL are build from drive identify information, invalid |
176 | characters are replaced by underline. | |
177 | ||
178 | If the PREFIX has the form \'/path/dir/\' (e.g. \'/var/lib/smartd/\'), then | |
179 | files \'MODEL\-SERIAL.ata.csv\' are created in directory \'/path/dir\'. | |
180 | If the PREFIX has the form \'/path/name\' (e.g. \'/var/lib/misc/attrlog\-\'), | |
181 | then files 'nameMODEL\-SERIAL.ata.csv' are created in directory '/path/'. | |
182 | The path must be absolute, except if debug mode is enabled. | |
2127e193 GI |
183 | .TP |
184 | .B \-B [+]FILE, \-\-drivedb=[+]FILE | |
cfbba5b9 GI |
185 | [ATA only] Read the drive database from FILE. The new database replaces |
186 | the built in database by default. If \'+\' is specified, then the new entries | |
187 | prepend the built in entries. | |
bed94269 | 188 | Please see the \fBsmartctl\fP(8) man page for further details. |
2127e193 GI |
189 | .TP |
190 | .B \-c FILE, \-\-configfile=FILE | |
832b75ed | 191 | Read \fBsmartd\fP configuration Directives from FILE, instead of from |
e9583e0c | 192 | the default location \fB/usr/local/etc/smartd.conf\fP (Windows: \fBEXEDIR/smartd.conf\fP). |
832b75ed GG |
193 | If FILE does \fBnot\fP exist, then \fBsmartd\fP will print an error |
194 | message and exit with nonzero status. Thus, \'\-c /usr/local/etc/smartd.conf\' | |
195 | can be used to verify the existence of the default configuration file. | |
196 | ||
197 | By using \'\-\' for FILE, the configuration is read from standard | |
198 | input. This is useful for commands like: | |
199 | .nf | |
a86ec89e | 200 | .B echo /dev/sdb \-m user@home \-M test | smartd \-c \- \-q onecheck |
832b75ed GG |
201 | .fi |
202 | to perform quick and simple checks without a configuration file. | |
d008864d | 203 | .\" %IF ENABLE_CAPABILITIES |
a23d5117 GI |
204 | .TP |
205 | .B \-C, \-\-capabilities | |
a86ec89e GI |
206 | [Linux only] Use libcap-ng to drop unneeded Linux process \fBcapabilities\fP(7). |
207 | The following capabilities are kept: CAP_SYS_ADMIN, CAP_SYS_RAWIO, CAP_MKNOD. | |
a23d5117 GI |
208 | |
209 | Warning: Mail notification does not work when used. | |
d008864d | 210 | .\" %ENDIF ENABLE_CAPABILITIES |
832b75ed GG |
211 | .TP |
212 | .B \-d, \-\-debug | |
213 | Runs \fBsmartd\fP in "debug" mode. In this mode, it displays status | |
214 | information to STDOUT rather than logging it to SYSLOG and does not | |
d2e702cf | 215 | \fBfork\fP(2) into the background and detach from the controlling |
832b75ed GG |
216 | terminal. In this mode, \fBsmartd\fP also prints more verbose |
217 | information about what it is doing than when operating in "daemon" | |
e165493d | 218 | mode. In this mode, the \fBINT\fP signal (normally generated from a |
ee38a438 | 219 | terminal with CONTROL-C) makes \fBsmartd\fP reload its configuration |
832b75ed | 220 | file. Please use CONTROL-\e to exit |
d008864d | 221 | .\" %IF OS Windows |
ee38a438 | 222 | (Windows: CONTROL-Break). |
832b75ed | 223 | |
f4e463df | 224 | [Windows only] The "debug" mode can be toggled by the command |
832b75ed GG |
225 | \fBsmartd sigusr2\fP. A new console for debug output is opened when |
226 | debug mode is enabled. | |
d008864d | 227 | .\" %ENDIF OS Windows |
832b75ed GG |
228 | .TP |
229 | .B \-D, \-\-showdirectives | |
230 | Prints a list (to STDOUT) of all the possible Directives which may | |
231 | appear in the configuration file /usr/local/etc/smartd.conf, and then exits. | |
d2e702cf GI |
232 | These Directives are described in the \fBsmartd.conf\fP(5) man page. |
233 | They may appear in the configuration file following the device name. | |
832b75ed GG |
234 | .TP |
235 | .B \-h, \-\-help, \-\-usage | |
236 | Prints usage message to STDOUT and exits. | |
237 | .TP | |
238 | .B \-i N, \-\-interval=N | |
239 | Sets the interval between disk checks to \fIN\fP seconds, where | |
240 | \fIN\fP is a decimal integer. The minimum allowed value is ten and | |
241 | the maximum is the largest positive integer that can be represented on | |
242 | your system (often 2^31-1). The default is 1800 seconds. | |
243 | ||
244 | Note that the superuser can make \fBsmartd\fP check the status of the | |
245 | disks at any time by sending it the \fBSIGUSR1\fP signal, for example | |
246 | with the command: | |
247 | .nf | |
248 | .B kill -SIGUSR1 <pid> | |
249 | .fi | |
250 | where \fB<pid>\fP is the process id number of \fBsmartd\fP. One may | |
251 | also use: | |
252 | .nf | |
253 | .B killall -USR1 smartd | |
254 | .fi | |
255 | for the same purpose. | |
d2e702cf | 256 | .br |
d008864d | 257 | .\" %IF OS Windows |
832b75ed | 258 | (Windows: See NOTES below.) |
d008864d | 259 | .\" %ENDIF OS Windows |
832b75ed GG |
260 | .TP |
261 | .B \-l FACILITY, \-\-logfacility=FACILITY | |
262 | Uses syslog facility FACILITY to log the messages from \fBsmartd\fP. | |
263 | Here FACILITY is one of \fIlocal0\fP, \fIlocal1\fP, ..., \fIlocal7\fP, | |
264 | or \fIdaemon\fP [default]. If this command-line option is not used, | |
265 | then by default messages from \fBsmartd\fP are logged to the facility | |
266 | \fIdaemon\fP. | |
267 | ||
268 | If you would like to have \fBsmartd\fP messages logged somewhere other | |
d2e702cf GI |
269 | than the default location, include (for example) \'\-l local3\' in its |
270 | start up argument list. | |
271 | Tell the syslog daemon to log all messages from facility \fBlocal3\fP | |
272 | to (for example) \'/var/log/smartd.log\'. | |
273 | ||
832b75ed | 274 | For more detailed information, please refer to the man pages for |
d2e702cf GI |
275 | the local syslog daemon, typically \fBsyslogd\fP(8), \fBsyslog-ng\fP(8) |
276 | or \fBrsyslogd\fP(8). | |
d008864d | 277 | .\" %IF OS Cygwin |
832b75ed | 278 | |
d008864d GI |
279 | Cygwin: If no \fBsyslogd\fP is running, the \'\-l\' option has no effect. |
280 | In this case, all \fBsyslog\fP messages are written to Windows event log. | |
281 | .\" %ENDIF OS Cygwin | |
282 | .\" %IF OS Windows | |
832b75ed GG |
283 | |
284 | Windows: Some \fBsyslog\fP functionality is implemented | |
285 | internally in \fBsmartd\fP as follows: If no \'\-l\' option | |
286 | (or \'\-l daemon\') is specified, messages are written to Windows | |
287 | event log or to file \fB./smartd.log\fP if event log is not available | |
ee38a438 | 288 | (access denied). By specifying other values of FACILITY, |
832b75ed GG |
289 | log output is redirected as follows: |
290 | \'\-l local0\' to file \fB./smartd.log\fP, | |
291 | \'\-l local1\' to standard output (redirect with \'>\' to any file), | |
292 | \'\-l local2\' to standard error, | |
293 | \'\-l local[3-7]\': to file \fB./smartd[1-5].log\fP. | |
d008864d | 294 | .\" %ENDIF OS Windows |
a37e7145 GG |
295 | .TP |
296 | .B \-n, \-\-no\-fork | |
297 | Do not fork into background; this is useful when executed from modern | |
a86ec89e | 298 | init methods like initng, minit, supervise or systemd. |
d008864d | 299 | .\" %IF OS Cygwin |
a37e7145 GG |
300 | |
301 | On Cygwin, this allows running \fBsmartd\fP as service via cygrunsrv, | |
302 | see NOTES below. | |
d008864d GI |
303 | .\" %ENDIF OS Cygwin |
304 | .\" %IF OS Windows | |
a37e7145 GG |
305 | |
306 | On Windows, this option is not available, use \'\-\-service\' instead. | |
d008864d | 307 | .\" %ENDIF OS Windows |
832b75ed GG |
308 | .TP |
309 | .B \-p NAME, \-\-pidfile=NAME | |
310 | Writes pidfile \fINAME\fP containing the \fBsmartd\fP Process ID | |
311 | number (PID). To avoid symlink attacks make sure the directory to | |
312 | which pidfile is written is only writable for root. Without this | |
313 | option, or if the \-\-debug option is given, no PID file is written on | |
314 | startup. If \fBsmartd\fP is killed with a maskable signal then the | |
315 | pidfile is removed. | |
316 | .TP | |
317 | .B \-q WHEN, \-\-quit=WHEN | |
318 | Specifies when, if ever, \fBsmartd\fP should exit. The valid | |
319 | arguments are to this option are: | |
320 | ||
321 | .I nodev | |
322 | \- Exit if there are no devices to monitor, or if any errors are found | |
323 | at startup in the configuration file. This is the default. | |
324 | ||
325 | .I errors | |
326 | \- Exit if there are no devices to monitor, or if any errors are found | |
327 | in the configuration file /usr/local/etc/smartd.conf at startup or whenever it | |
328 | is reloaded. | |
329 | ||
330 | .I nodevstartup | |
331 | \- Exit if there are no devices to monitor at startup. But continue | |
332 | to run if no devices are found whenever the configuration file is | |
333 | reloaded. | |
334 | ||
335 | .I never | |
336 | \- Only exit if a fatal error occurs (no remaining system memory, | |
337 | invalid command line arguments). In this mode, even if there are no | |
338 | devices to monitor, or if the configuration file | |
339 | \fB/usr/local/etc/smartd.conf\fP has errors, \fBsmartd\fP will continue to run, | |
340 | waiting to load a configuration file listing valid devices. | |
341 | ||
342 | .I onecheck | |
343 | \- Start \fBsmartd\fP in debug mode, then register devices, then check | |
344 | device\'s SMART status once, and then exit with zero exit status if all | |
345 | of these steps worked correctly. | |
346 | ||
347 | This last option is intended for \'distribution-writers\' who want to | |
348 | create automated scripts to determine whether or not to automatically | |
349 | start up \fBsmartd\fP after installing smartmontools. After starting | |
350 | \fBsmartd\fP with this command-line option, the distribution\'s install | |
351 | scripts should wait a reasonable length of time (say ten seconds). If | |
352 | \fBsmartd\fP has not exited with zero status by that time, the script | |
353 | should send \fBsmartd\fP a SIGTERM or SIGKILL and assume that | |
354 | \fBsmartd\fP will not operate correctly on the host. Conversely, if | |
355 | \fBsmartd\fP exits with zero status, then it is safe to run | |
356 | \fBsmartd\fP in normal daemon mode. If \fBsmartd\fP is unable to | |
357 | monitor any devices or encounters other problems then it will return | |
358 | with non-zero exit status. | |
359 | ||
360 | .I showtests | |
361 | \- Start \fBsmartd\fP in debug mode, then register devices, then write | |
362 | a list of future scheduled self tests to stdout, and then exit with zero | |
363 | exit status if all of these steps worked correctly. | |
364 | Device's SMART status is not checked. | |
365 | ||
ee38a438 | 366 | This option is intended to test whether the '\-s REGEX' directives in |
832b75ed GG |
367 | smartd.conf will have the desired effect. The output lists the next test |
368 | schedules, limited to 5 tests per type and device. This is followed by a | |
369 | summary of all tests of each device within the next 90 days. | |
370 | .TP | |
371 | .B \-r TYPE, \-\-report=TYPE | |
372 | Intended primarily to help | |
373 | .B smartmontools | |
374 | developers understand the behavior of | |
375 | .B smartmontools | |
376 | on non-conforming or poorly-conforming hardware. This option reports | |
377 | details of | |
378 | \fBsmartd\fP | |
379 | transactions with the device. The option can be used multiple times. | |
380 | When used just once, it shows a record of the ioctl() transactions | |
381 | with the device. When used more than once, the detail of these ioctl() | |
382 | transactions are reported in greater detail. The valid arguments to | |
383 | this option are: | |
384 | ||
385 | .I ioctl | |
386 | \- report all ioctl() transactions. | |
387 | ||
388 | .I ataioctl | |
389 | \- report only ioctl() transactions with ATA devices. | |
390 | ||
391 | .I scsiioctl | |
392 | \- report only ioctl() transactions with SCSI devices. | |
393 | ||
a86ec89e GI |
394 | .\" %IF OS FreeBSD Linux Windows Cygwin |
395 | .I nvmeioctl | |
396 | \- [FreeBSD, Linux, Windows and Cygwin only] | |
397 | [NEW EXPERIMENTAL SMARTD FEATURE] | |
398 | report only ioctl() transactions with NVMe devices. | |
399 | ||
400 | .\" %ENDIF OS FreeBSD Linux Windows Cygwin | |
832b75ed GG |
401 | Any argument may include a positive integer to specify the level of |
402 | detail that should be reported. The argument should be followed by a | |
403 | comma then the integer with no spaces. For example, \fIataioctl,2\fP | |
404 | The default level is 1, so \'\-r ataioctl,1\' and \'\-r ataioctl\' are | |
405 | equivalent. | |
2127e193 GI |
406 | .TP |
407 | .B \-s PREFIX, \-\-savestates=PREFIX | |
ee38a438 GI |
408 | Reads/writes \fBsmartd\fP state information from/to files |
409 | \'PREFIX\'\'MODEL\-SERIAL.ata.state\' or \'PREFIX\'\'VENDOR\-MODEL\-SERIAL.scsi.state\'. | |
410 | This preserves SMART attributes, drive min and max temperatures (\-W directive), | |
411 | info about last sent warning email | |
2127e193 GI |
412 | (\-m directive), and the time of next check of the self-test REGEXP |
413 | (\-s directive) across boot cycles. | |
414 | ||
d008864d | 415 | .\" %IF ENABLE_SAVESTATES |
2127e193 | 416 | If this option is not specified, state information is maintained in files |
ee38a438 GI |
417 | \'/usr/local/var/lib/smartmontools/smartd.MODEL\-SERIAL.ata.state\' for ATA devices and |
418 | \'/usr/local/var/lib/smartmontools/smartd.VENDOR\-MODEL\-SERIAL.scsi.state\' for SCSI devices. | |
2127e193 | 419 | To disable state files, specify this option with an empty string |
ee38a438 | 420 | argument: \'\-s ""\'. |
d008864d | 421 | .\" %ENDIF ENABLE_SAVESTATES |
2127e193 GI |
422 | MODEL and SERIAL are build from drive identify information, invalid |
423 | characters are replaced by underline. | |
424 | ||
425 | If the PREFIX has the form \'/path/dir/\' (e.g. \'/var/lib/smartd/\'), then | |
426 | files \'MODEL\-SERIAL.ata.state\' are created in directory \'/path/dir\'. | |
427 | If the PREFIX has the form \'/path/name\' (e.g. \'/var/lib/misc/smartd\-\'), | |
428 | then files 'nameMODEL\-SERIAL.ata.state' are created in directory '/path/'. | |
429 | The path must be absolute, except if debug mode is enabled. | |
430 | ||
431 | The state information files are read on smartd startup. The files are | |
432 | always (re)written after reading the configuration file, before rereading | |
433 | the configuration file (SIGHUP), before smartd shutdown, and after a check | |
434 | forced by SIGUSR1. After a normal check cycle, a file is only rewritten if | |
435 | an important change (which usually results in a SYSLOG output) occurred. | |
ee38a438 GI |
436 | .TP |
437 | .B \-w PATH, \-\-warnexec=PATH | |
ee38a438 GI |
438 | Run the executable PATH instead of the default script when smartd |
439 | needs to send warning messages. PATH must point to an executable binary | |
440 | file or script. | |
441 | The default script is | |
442 | .\" %IF NOT OS Windows | |
443 | \fB/usr/local/etc/smartd_warning.sh\fP. | |
444 | .\" %ENDIF NOT OS Windows | |
445 | .\" %IF OS ALL | |
446 | (Windows: EXEDIR/smartd_warning.cmd) | |
447 | .\" %ENDIF OS ALL | |
448 | .\" %IF OS Windows | |
449 | .\"! \fBEXEDIR/smartd_warning.cmd\fP. | |
450 | .\" %ENDIF OS Windows | |
d008864d | 451 | .\" %IF OS Windows |
832b75ed GG |
452 | .TP |
453 | .B \-\-service | |
f4e463df | 454 | [Windows only] Enables \fBsmartd\fP to run as a Windows service. |
832b75ed GG |
455 | The option must be specified in the service command line as the first |
456 | argument. It should not be used from console. | |
457 | See NOTES below for details. | |
d008864d | 458 | .\" %ENDIF OS Windows |
832b75ed GG |
459 | .TP |
460 | .B \-V, \-\-version, \-\-license, \-\-copyright | |
2127e193 GI |
461 | Prints version, copyright, license, home page and SVN revision |
462 | information for your copy of \fBsmartd\fP to STDOUT and then exits. | |
463 | Please include this information if you are reporting bugs or problems. | |
832b75ed GG |
464 | |
465 | .SH EXAMPLES | |
d2e702cf GI |
466 | .B smartd |
467 | .br | |
832b75ed GG |
468 | Runs the daemon in forked mode. This is the normal way to run |
469 | \fBsmartd\fP. | |
e9583e0c | 470 | Entries are logged to SYSLOG. |
832b75ed | 471 | |
d2e702cf GI |
472 | .B smartd -d -i 30 |
473 | .br | |
832b75ed GG |
474 | Run in foreground (debug) mode, checking the disk status |
475 | every 30 seconds. | |
476 | ||
d2e702cf GI |
477 | .B smartd -q onecheck |
478 | .br | |
832b75ed | 479 | Registers devices, and checks the status of the devices exactly |
d2e702cf | 480 | once. The exit status (the shell |
832b75ed GG |
481 | .B $? |
482 | variable) will be zero if all went well, and nonzero if no devices | |
483 | were detected or some other problem was encountered. | |
484 | ||
a86ec89e | 485 | .\" %IF ENABLE_INITSCRIPT |
832b75ed GG |
486 | Note that \fBsmartmontools\fP provides a start-up script in |
487 | \fB/usr/local/etc/rc.d/init.d/smartd\fP which is responsible for starting and | |
488 | stopping the daemon via the normal init interface. Using this script, | |
489 | you can start \fBsmartd\fP by giving the command: | |
490 | .nf | |
491 | .B /usr/local/etc/rc.d/init.d/smartd start | |
492 | .fi | |
493 | and stop it by using the command: | |
494 | .nf | |
495 | .B /usr/local/etc/rc.d/init.d/smartd stop | |
832b75ed | 496 | .fi |
d2e702cf | 497 | |
a86ec89e | 498 | .\" %ENDIF ENABLE_INITSCRIPT |
d008864d | 499 | .SH CONFIGURATION |
d2e702cf GI |
500 | The syntax of the \fBsmartd.conf\fP(5) file is discussed separately. |
501 | ||
832b75ed GG |
502 | .SH NOTES |
503 | \fBsmartd\fP | |
504 | will make log entries at loglevel | |
505 | .B LOG_INFO | |
506 | if the Normalized SMART Attribute values have changed, as reported using the | |
507 | .B \'\-t\', \'\-p\', | |
508 | or | |
509 | .B \'\-u\' | |
510 | Directives. For example: | |
511 | .nf | |
a86ec89e | 512 | .B \'Device: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93\' |
832b75ed GG |
513 | .fi |
514 | Note that in this message, the value given is the \'Normalized\' not the \'Raw\' | |
515 | Attribute value (the disk temperature in this case is about 22 | |
516 | Celsius). The | |
517 | .B \'-R\' | |
518 | and | |
519 | .B \'-r\' | |
520 | Directives modify this behavior, so that the information is printed | |
521 | with the Raw values as well, for example: | |
522 | .nf | |
a86ec89e | 523 | .B \'Device: /dev/sda, SMART Attribute: 194 Temperature_Celsius changed from 94 [Raw 22] to 93 [Raw 23]\' |
832b75ed GG |
524 | .fi |
525 | Here the Raw values are the actual disk temperatures in Celsius. The | |
526 | way in which the Raw values are printed, and the names under which the | |
527 | Attributes are reported, is governed by the various | |
528 | .B \'-v Num,Description\' | |
529 | Directives described previously. | |
530 | ||
531 | Please see the | |
532 | .B smartctl | |
533 | manual page for further explanation of the differences between | |
534 | Normalized and Raw Attribute values. | |
535 | ||
536 | \fBsmartd\fP | |
537 | will make log entries at loglevel | |
538 | .B LOG_CRIT | |
539 | if a SMART Attribute has failed, for example: | |
540 | .nf | |
a86ec89e | 541 | .B \'Device: /dev/sdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct\' |
832b75ed GG |
542 | .fi |
543 | This loglevel is used for reporting enabled by the | |
544 | .B \'\-H\', \-f\', \'\-l\ selftest\', | |
545 | and | |
546 | .B \'\-l\ error\' | |
547 | Directives. Entries reporting failure of SMART Prefailure Attributes | |
548 | should not be ignored: they mean that the disk is failing. Use the | |
549 | .B smartctl | |
550 | utility to investigate. | |
551 | ||
d008864d | 552 | .\" %IF OS Solaris |
832b75ed GG |
553 | Under Solaris with the default \fB/etc/syslog.conf\fP configuration, |
554 | messages below loglevel \fBLOG_NOTICE\fP will \fBnot\fP be recorded. | |
555 | Hence all \fBsmartd\fP messages with loglevel \fBLOG_INFO\fP will be | |
556 | lost. If you want to use the existing daemon facility to log all | |
557 | messages from \fBsmartd\fP, you should change \fB/etc/syslog.conf\fP | |
558 | from: | |
559 | .nf | |
560 | ...;daemon.notice;... /var/adm/messages | |
561 | .fi | |
562 | to read: | |
563 | .nf | |
564 | ...;daemon.info;... /var/adm/messages | |
565 | .fi | |
566 | Alternatively, you can use a local facility to log messages: please | |
ee38a438 | 567 | see the \fBsmartd\fP '\-l' command-line option described above. |
832b75ed | 568 | |
d008864d GI |
569 | .\" %ENDIF OS Solaris |
570 | .\" %IF OS Cygwin | |
571 | The Cygwin Version of \fBsmartd\fP can be run as a service via the | |
a86ec89e GI |
572 | cygrunsrv tool. |
573 | .\" %IF ENABLE_INITSCRIPT | |
574 | The start-up script provides Cygwin-specific commands to install and | |
575 | remove the service: | |
d008864d GI |
576 | .nf |
577 | .B /usr/local/etc/rc.d/init.d/smartd install [options] | |
578 | .B /usr/local/etc/rc.d/init.d/smartd remove | |
579 | .fi | |
580 | The service can be started and stopped by the start-up script as usual | |
581 | (see \fBEXAMPLES\fP above). | |
a86ec89e | 582 | .\" %ENDIF ENABLE_INITSCRIPT |
d008864d GI |
583 | |
584 | .\" %ENDIF OS Cygwin | |
585 | .\" %IF OS Windows | |
586 | On Windows, the log messages are written to the event log or to a file. | |
ee38a438 | 587 | See documentation of the '\-l FACILITY' option above for details. |
832b75ed GG |
588 | |
589 | On Windows, the following built-in commands can be used to control | |
590 | \fBsmartd\fP, if running as a daemon: | |
591 | ||
592 | \'\fBsmartd status\fP\' \- check status | |
593 | ||
594 | \'\fBsmartd stop\fP\' \- stop smartd | |
595 | ||
596 | \'\fBsmartd reload\fP\' \- reread config file | |
597 | ||
598 | \'\fBsmartd restart\fP\' \- restart smartd | |
599 | ||
600 | \'\fBsmartd sigusr1\fP\' \- check disks now | |
601 | ||
602 | \'\fBsmartd sigusr2\fP\' \- toggle debug mode | |
603 | ||
832b75ed GG |
604 | The Windows Version of \fBsmartd\fP has buildin support for services: |
605 | ||
606 | \'\fBsmartd install [options]\fP\' installs a service | |
607 | named "smartd" (display name "SmartD Service") using the command line | |
d008864d | 608 | \'/INSTALLPATH/smartd.exe \-\-service [options]\'. |
ee38a438 GI |
609 | This also installs smartd.exe as a event message file for the Windows |
610 | event viewer. | |
832b75ed | 611 | |
ee38a438 GI |
612 | \'\fBsmartd remove\fP\' can later be used to remove the service and |
613 | event message entries from the registry. | |
832b75ed GG |
614 | |
615 | Upon startup, the smartd service changes the working directory | |
616 | to its own installation path. If smartd.conf and blat.exe are stored | |
617 | in this directory, no \'-c\' option and \'-M exec\' directive is needed. | |
618 | ||
ee38a438 | 619 | The debug mode (\'\-d\', \'\-q onecheck\') does not work if smartd is |
832b75ed GG |
620 | running as service. |
621 | ||
622 | The service can be controlled as usual with Windows commands \'net\' | |
623 | or \'sc\' (\'\fBnet start smartd\fP\', \'\fBnet stop smartd\fP\'). | |
624 | ||
625 | Pausing the service (\'\fBnet pause smartd\fP\') sets the interval between | |
ee38a438 | 626 | disk checks (\'\-i N\') to infinite. |
832b75ed GG |
627 | |
628 | Continuing the paused service (\'\fBnet continue smartd\fP\') resets the | |
629 | interval and rereads the configuration file immediately (like \fBSIGHUP\fP): | |
630 | ||
631 | Continuing a still running service (\'\fBnet continue smartd\fP\' without | |
632 | preceding \'\fBnet pause smartd\fP\') does not reread configuration but | |
633 | checks disks immediately (like \fBSIGUSR1\fP). | |
634 | ||
d008864d | 635 | .\" %ENDIF OS Windows |
832b75ed | 636 | .SH LOG TIMESTAMP TIMEZONE |
832b75ed GG |
637 | When \fBsmartd\fP makes log entries, these are time-stamped. The time |
638 | stamps are in the computer's local time zone, which is generally set | |
639 | using either the environment variable \'\fBTZ\fP\' or using a | |
640 | time-zone file such as \fB/etc/localtime\fP. You may wish to change | |
641 | the timezone while \fBsmartd\fP is running (for example, if you carry | |
642 | a laptop to a new time-zone and don't reboot it). Due to a bug in the | |
d2e702cf | 643 | \fBtzset\fP(3) function of many unix standard C libraries, the |
832b75ed GG |
644 | time-zone stamps of \fBsmartd\fP might not change. For some systems, |
645 | \fBsmartd\fP will work around this problem \fIif\fP the time-zone is | |
646 | set using \fB/etc/localtime\fP. The work-around \fIfails\fP if the | |
647 | time-zone is set using the \'\fBTZ\fP\' variable (or a file that it | |
648 | points to). | |
649 | ||
a86ec89e GI |
650 | .SH EXIT STATUS |
651 | The exit status (return value) of \fBsmartd\fP can have the following values: | |
832b75ed GG |
652 | .TP |
653 | .B 0: | |
654 | Daemon startup successful, or \fBsmartd\fP was killed by a SIGTERM (or in debug mode, a SIGQUIT). | |
655 | .TP | |
656 | .B 1: | |
657 | Commandline did not parse. | |
658 | .TP | |
659 | .B 2: | |
660 | There was a syntax error in the config file. | |
661 | .TP | |
662 | .B 3: | |
663 | Forking the daemon failed. | |
664 | .TP | |
665 | .B 4: | |
666 | Couldn\'t create PID file. | |
667 | .TP | |
668 | .B 5: | |
ee38a438 | 669 | Config file does not exist (only returned in conjunction with the \'\-c\' option). |
832b75ed GG |
670 | .TP |
671 | .B 6: | |
672 | Config file exists, but cannot be read. | |
673 | .TP | |
674 | .B 8: | |
675 | \fBsmartd\fP | |
676 | ran out of memory during startup. | |
677 | .TP | |
f4e463df | 678 | .B 10: |
832b75ed GG |
679 | An inconsistency was found in \fBsmartd\fP\'s internal data |
680 | structures. This should never happen. It must be due to either a | |
681 | coding or compiler bug. \fIPlease\fP report such failures to | |
a86ec89e | 682 | smartmontools developers, see REPORTING BUGS below. |
832b75ed GG |
683 | .TP |
684 | .B 16: | |
685 | A device explicitly listed in | |
686 | .B /usr/local/etc/smartd.conf | |
687 | can\'t be monitored. | |
688 | .TP | |
689 | .B 17: | |
690 | \fBsmartd\fP | |
691 | didn\'t find any devices to monitor. | |
692 | .TP | |
693 | .B 254: | |
694 | When in daemon mode, | |
695 | \fBsmartd\fP | |
696 | received a SIGINT or SIGQUIT. (Note that in debug mode, SIGINT has | |
697 | the same effect as SIGHUP, and makes \fBsmartd\fP reload its | |
698 | configuration file. SIGQUIT has the same effect as SIGTERM and causes | |
699 | \fBsmartd\fP to exit with zero exit status. | |
700 | .TP | |
701 | .B 132 and above | |
702 | \fBsmartd\fP | |
703 | was killed by a signal that is not explicitly listed above. The exit | |
704 | status is then 128 plus the signal number. For example if | |
705 | \fBsmartd\fP | |
706 | is killed by SIGKILL (signal 9) then the exit status is 137. | |
707 | ||
d2e702cf GI |
708 | .\" %IF NOT OS Windows |
709 | .SH FILES | |
710 | .TP | |
711 | .B /usr/local/sbin/smartd | |
712 | full path of this executable. | |
713 | .TP | |
714 | .B /usr/local/etc/smartd.conf | |
715 | configuration file (see \fBsmartd.conf\fP(5) man page). | |
716 | .TP | |
717 | .B /usr/local/etc/smartd_warning.sh | |
718 | script run on warnings (see \'\-M exec\' directive on | |
719 | \fBsmartd.conf\fP(5) man page). | |
720 | .\" %IF ENABLE_SMARTDPLUGINDIR | |
721 | .TP | |
722 | .B /usr/local/etc/smartd_warning.d/ | |
723 | plugin directory for smartd warning script (see \'\-m\' directive on | |
724 | \fBsmartd.conf\fP(5) man page). | |
725 | .\" %ENDIF ENABLE_SMARTDPLUGINDIR | |
726 | .\" %IF ENABLE_DRIVEDB | |
727 | .TP | |
728 | .B /usr/local/share/smartmontools/drivedb.h | |
729 | drive database (see \'\-B\' option). | |
730 | .\" %ENDIF ENABLE_DRIVEDB | |
731 | .TP | |
732 | .B /usr/local/etc/smart_drivedb.h | |
733 | optional local drive database (see \'\-B\' option). | |
734 | ||
735 | .\" %ENDIF NOT OS Windows | |
ee38a438 | 736 | .SH AUTHORS |
a86ec89e | 737 | \fBBruce Allen\fP (project initiator), |
d2e702cf | 738 | .br |
a86ec89e | 739 | \fBChristian Franke\fP (project manager, Windows port and all sort of things), |
d2e702cf | 740 | .br |
a86ec89e | 741 | \fBDouglas Gilbert\fP (SCSI subsystem), |
d2e702cf | 742 | .br |
a86ec89e | 743 | \fBVolker Kuhlmann\fP (moderator of support and database mailing list), |
d2e702cf | 744 | .br |
a86ec89e | 745 | \fBGabriele Pohl\fP (wiki & development team support), |
d2e702cf | 746 | .br |
a86ec89e GI |
747 | \fBAlex Samorukov\fP (FreeBSD port and more, new Trac wiki). |
748 | ||
749 | Many other individuals have made contributions and corrections, | |
750 | see AUTHORS, ChangeLog and repository files. | |
751 | ||
752 | The first smartmontools code was derived from the smartsuite package, | |
753 | written by Michael Cornwell and Andre Hedrick. | |
754 | ||
755 | .SH REPORTING BUGS | |
756 | To submit a bug report, create a ticket in smartmontools wiki: | |
d2e702cf | 757 | .br |
a86ec89e | 758 | <\fBhttp://www.smartmontools.org/\fP>. |
d2e702cf | 759 | .br |
a86ec89e | 760 | Alternatively send the info to the smartmontools support mailing list: |
d2e702cf | 761 | .br |
a86ec89e | 762 | <\fBhttps://lists.sourceforge.net/lists/listinfo/smartmontools-support\fB>. |
832b75ed | 763 | |
d2e702cf | 764 | .SH SEE ALSO |
a86ec89e GI |
765 | \fBsmartd.conf\fP(5), \fBsmartctl\fP(8). |
766 | .\" %IF ENABLE_UPDATE_SMART_DRIVEDB | |
767 | .br | |
768 | \fBupdate-smart-drivedb\fP(8). | |
769 | .\" %ENDIF ENABLE_UPDATE_SMART_DRIVEDB | |
d2e702cf GI |
770 | |
771 | .SH REFERENCES | |
772 | Please see the following web site for more info: | |
a86ec89e | 773 | \fBhttp://www.smartmontools.org/\fP |
832b75ed | 774 | |
832b75ed GG |
775 | An introductory article about smartmontools is \fIMonitoring Hard |
776 | Disks with SMART\fP, by Bruce Allen, Linux Journal, January 2004, | |
ee38a438 | 777 | pages 74-77. This is \fBhttp://www.linuxjournal.com/article/6983\fP |
832b75ed GG |
778 | online. |
779 | ||
780 | If you would like to understand better how SMART works, and what it | |
781 | does, a good place to start is with Sections 4.8 and 6.54 of the first | |
ee38a438 | 782 | volume of the \'AT Attachment with Packet Interface-7\' (ATA/ATAPI-7) |
e9583e0c GI |
783 | specification Revision 4b. This documents the SMART functionality which the |
784 | \fBsmartmontools\fP utilities provide access to. | |
832b75ed | 785 | |
ee38a438 GI |
786 | The functioning of SMART was originally defined by the SFF-8035i |
787 | revision 2 and the SFF-8055i revision 1.4 specifications. These are | |
e9583e0c GI |
788 | publications of the Small Form Factors (SFF) Committee. |
789 | ||
790 | Links to these and other documents may be found on the Links page of the | |
d2e702cf | 791 | \fBsmartmontools\fP Wiki at \fBhttp://www.smartmontools.org/wiki/Links\fP . |
832b75ed | 792 | |
a86ec89e GI |
793 | .SH PACKAGE VERSION |
794 | CURRENT_SVN_VERSION CURRENT_SVN_DATE CURRENT_SVN_REV | |
795 | .br | |
796 | $Id: smartd.8.in 4299 2016-04-16 19:45:57Z chrfranke $ |