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