[go: up one dir, main page]

File: smartd.8.in

package info (click to toggle)
smartmontools 5.32-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,692 kB
  • ctags: 1,555
  • sloc: ansic: 14,892; sh: 3,677; asm: 597; makefile: 275
file content (1504 lines) | stat: -rw-r--r-- 55,317 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
.ig
Copyright (C) 2002-4 Bruce Allen <smartmontools-support@lists.sourceforge.net>
 
$Id: smartd.8.in,v 1.46 2004/03/06 19:43:18 ballen4705 Exp $

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
 
You should have received a copy of the GNU General Public License (for
example COPYING); if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.
 
This code was originally developed as a Senior Thesis by Michael
Cornwell at the Concurrent Systems Laboratory (now part of the Storage
Systems Research Center), Jack Baskin School of Engineering,
University of California, Santa Cruz. http://ssrc.soe.ucsc.edu/
..
.TH SMARTD 8 CURRENT_CVS_DATE CURRENT_CVS_VERSION CURRENT_CVS_DATE
.SH NAME
\fBsmartd\fP \- SMART Disk Monitoring Daemon

.SH SYNOPSIS
.B smartd [options]

.SH FULL PATH
.B /usr/sbin/smartd

.SH PACKAGE VERSION
CURRENT_CVS_VERSION released CURRENT_CVS_DATE at CURRENT_CVS_TIME

.SH DESCRIPTION
\fBsmartd\fP is a daemon that monitors the Self\-Monitoring, Analysis
and Reporting Technology (SMART) system built into many ATA\-3 and
later ATA, IDE and SCSI\-3 hard drives. The purpose of SMART is to
monitor the reliability of the hard drive and predict drive failures,
and to carry out different types of drive self\-tests.  This version of
\fBsmartd\fP is compatible with ATA/ATAPI\-5 and earlier standards (see
\fBREFERENCES\fP below).

\fBsmartd\fP will attempt to enable SMART monitoring on ATA devices
(equivalent to \fBsmartctl \-s on\fP) and polls these and SCSI devices
every 30 minutes (configurable), logging SMART errors and changes of
SMART Attributes via the SYSLOG interface.  The default location for
these SYSLOG notifications and warnings is \fB/var/log/messages\fP.
To change this default location, please see the \fB\'\-l\'\fP
command-line option described below.

If you send a \fBUSR1\fP signal to \fBsmartd\fP it will immediately
check the status of the disks, and then return to polling the disks
every 30 minutes. See the \fB\'\-i\'\fP option below for additional
details.

\fBsmartd\fP can be configured at start-up using the configuration
file \fB/etc/smartd.conf\fP.  If the configuration file is
subsequently modified, \fBsmartd\fP can be told to re-read the
configuration file by sending it a \fBHUP\fP signal, for example with
the command:
.fi
\fBkillall -HUP smartd\fP.
.fi
On startup, if \fBsmartd\fP finds a syntax error in the configuration
file, it will print an error message and then exit. However if
\fBsmartd\fP is already running, then is told with a \fBHUP\fP signal
to re-read the configuration file, and then find a syntax error in
this file, it will print an error message and then continue, ignoring
the contents of the (faulty) configuration file, as if the \fBHUP\fP
signal had never been received.

When \fBsmartd\fP is running in debug mode, the \fBQUIT\fP signal
(normally generated from a shell with CONTROL\-C) is treated in the
same way as a \fBHUP\fP signal: it makes \fBsmartd\fP reload its
configuration file. To exit \fBsmartd\fP use CONTROL\-\e.

On startup, in the absence of the configuration file
\fB/etc/smartd.conf\fP, the \fBsmartd\fP daemon first scans for all
devices that support SMART.  The scanning is done as follows:
.RS
.IP \fBLINUX:\fP 9
Examine all entries \fB"/dev/hd[a-t]"\fP for IDE/ATA
devices, and \fB"/dev/sd[a-z]"\fP for SCSI devices.
.IP \fBFREEBSD:\fP 9
Examine all entries \fB"/dev/ad[0-9]+"\fP for IDE/ATA
devices and \fB"/dev/da[0-9]+"\fP for SCSI devices.
.IP \fBNETBSD:\fP 9
Authoritative list of disk devices is obtained from sysctl 
\'hw.disknames\'.
.IP \fBSOLARIS:\fP 9
Examine all entries \fB"/dev/rdsk/c?t?d?s?"\fP for IDE/ATA and SCSI disk
devices, and entries \fB"/dev/rmt/*"\fP for SCSI tape devices.
.IP \fBWINDOWS:\fP 9
Examine all entries \fB"/dev/hd[a-j]"\fP ("\\\\.\\PhysicalDisk[0-9]")
for IDE/ATA devices on WinNT4/2000/XP, \fB"/dev/hd[a-d]"\fP
(bitmask from "\\\\.\\SMARTVSD") for IDE/ATA devices on Win95/98/98SE/ME.
Scanning of SCSI/ASPI devices is not implemented yet.
.RE
.PP
\fBsmartd\fP then monitors
for \fIall\fP possible SMART errors (corresponding to the \fB\'\-a\'\fP
Directive in the configuration file; see \fBCONFIGURATION FILE\fP
below). Note that when there is no configuration file, and
\fBsmartd\fP scans for devices on startup, \fBwarning messages may
appear in SYSLOG\fP (by default \fB/var/log/messages\fP) about missing
block-major-xx devices.  These messages are usually
harmless. Alternatively, the configuration file can be used to exclude
non\-existent devices by giving a list of devices to monitor at
start-up.

.SH 
OPTIONS
Long options are not supported on all systems.  Use \fB\'smartd
\\-h\'\fP to see the available options.
.TP
.B \-d, \-\-debug
Runs \fBsmartd\fP in "debug" mode. In this mode, it displays status
information to STDOUT rather than logging it to SYSLOG and does not
\fBfork(2)\fP into the background and detach from the controlling
terminal.  In this mode, \fBsmartd\fP also prints more verbose
information about what it is doing than when operating in "daemon"
mode. In this mode, the \fBQUIT\fP signal (normally generated from a
terminal with CONTROL\-C) makes \fBsmartd\fP reload its configuration
file.  Please use CONTROL-\e to exit.
.TP
.B \-D, \-\-showdirectives
Prints a list (to STDOUT) of all the possible Directives which may
appear in the configuration file /etc/smartd.conf, and then exits.
These Directives are also described later in this man page. They may
appear in the configuration file following the device name.
.TP
.B \-h, \-\-help, \-\-usage
Prints usage message to STDOUT and exits.
.TP
.B \-i N, \-\-interval=N
Sets the interval between disk checks to \fIN\fP seconds, where
\fIN\fP is a decimal integer.  The minimum allowed value is ten and
the maximum is the largest positive integer that can be represented on
your system (often 2^31-1).  The default is 1800 seconds.

Note that the superuser can make \fBsmartd\fP check the status of the
disks at any time by sending it the \fBSIGUSR1\fP signal, for example
with the command:
.nf
.B kill -SIGUSR1 <pid>
.fi
where \fB<pid>\fP is the process id number of \fBsmartd\fP.  One may
also use:
.nf
.B killall -USR1 smartd
.fi
for the same purpose.
.TP
.B \-l FACILITY, \-\-logfacility=FACILITY
Uses syslog facility FACILITY to log the messages from \fBsmartd\fP.
Here FACILITY is one of \fIlocal0\fP, \fIlocal1\fP, ..., \fIlocal7\fP,
or \fIdaemon\fP [default].  If this command-line option is not used,
then by default messages from \fBsmartd\fP are logged to the facility
\fIdaemon\fP.

If you would like to have \fBsmartd\fP messages logged somewhere other
than the default \fB/var/log/messages\fP location, this can typically
be accomplished with (for example) the following steps:
.RS 7
.IP \fB[1]\fP 4
Modify the script that starts \fBsmartd\fP to include the \fBsmartd\fP
command-line argument \'\-l local3\'.  This tells \fBsmartd\fP to log its
messages to facility \fBlocal3\fP.
.IP \fB[2]\fP 4
Modify the \fBsyslogd\fP configuration file (typically
\fB/etc/syslog.conf\fP) by adding a line of the form:
.nf
\fBlocal3.* /var/log/smartd.log\fP
.fi
This tells \fBsyslogd\fP to log all the messages from facility \fBlocal3\fP to
the designated file: /var/log/smartd.log.
.IP \fB[3]\fP 4
Tell \fBsyslogd\fP to re\-read its configuration file, typically by
sending the \fBsyslogd\fP process a \fBSIGHUP\fP hang\-up signal.
.IP \fB[4]\fP 4
Start (or restart) the \fBsmartd\fP daemon.
.RE
.RS 6

For more detailed information, please refer to the man pages for
\fBsyslog.conf\fP, \fBsyslogd\fP, and \fBsyslog\fP.  You may also want
to modify the log rotation configuration files; see the man pages for
\fBlogrotate\fP and examine your system\'s /etc/logrotate.conf file.
.RE
.TP
.B \-p NAME, \-\-pidfile=NAME
Writes pidfile \fINAME\fP containing the \fBsmartd\fP Process ID
number (PID).  To avoid symlink attacks make sure the directory to
which pidfile is written is only writeable for root.  Without this
option, or if the \-\-debug option is given, no PID file is written on
startup.  If \fBsmartd\fP is killed with a maskable signal then the
pidfile is removed.
.TP
.B \-q WHEN, \-\-quit=WHEN
Specifies when, if ever, \fBsmartd\fP should exit.  The valid
arguments are to this option are:

.I nodev
\- Exit if there are no devices to monitor, or if any errors are found
at startup in the configuration file.  This is the default.

.I errors
\- Exit if there are no devices to monitor, or if any errors are found
in the configuration file /etc/smartd.conf at startup or whenever it
is reloaded.

.I nodevstartup
\- Exit if there are no devices to monitor at startup.  But continue
to run if no devices are found whenever the configuration file is
reloaded.

.I never
\- Only exit if a fatal error occurs (no remaining system memory,
invalid command line arguments). In this mode, even if there are no
devices to monitor, or if the configuration file
\fB/etc/smartd.conf\fP has errors, \fBsmartd\fP will continue to run,
waiting to load a configuration file listing valid devices.

.I onecheck
\- Start \fBsmartd\fP in debug mode, then register devices, then check
device\'s SMART status once, and then exit with zero exit status if all
of these steps worked correctly.

This last option is intended for \'distribution\-writers\' who want to
create automated scripts to determine whether or not to automatically
start up \fBsmartd\fP after installing smartmontools.  After starting
\fBsmartd\fP with this command\-line option, the distribution\'s install
scripts should wait a reasonable length of time (say ten seconds).  If
\fBsmartd\fP has not exited with zero status by that time, the script
should send \fBsmartd\fP a SIGTERM or SIGKILL and assume that
\fBsmartd\fP will not operate correctly on the host.  Conversely, if
\fBsmartd\fP exits with zero status, then it is safe to run
\fBsmartd\fP in normal daemon mode. If \fBsmartd\fP is unable to
monitor any devices or encounters other problems then it will return
with non\-zero exit status.
.TP
.B \-r TYPE, \-\-report=TYPE
Intended primarily to help
.B smartmontools
developers understand the behavior of
.B smartmontools
on non\-conforming or poorly conforming hardware.  This option reports
details of
\fBsmartd\fP
transactions with the device.  The option can be used multiple times.
When used just once, it shows a record of the ioctl() transactions
with the device.  Whe used more than once, the detail of these ioctl()
transactions are reported in greater detail.  The valid arguments to
this option are:

.I ioctl
\- report all ioctl() transactions.

.I ataioctl
\- report only ioctl() transactions with ATA devices.

.I scsiioctl
\- report only ioctl() transactions with SCSI devices.

Any argument may include a positive integer to specify the level of
detail that should be reported.  The argument should be followed by a
comma then the integer with no spaces.  For example, \fIataioctl,2\fP
The default level is 1, so \'\-r ataioctl,1\' and \'\-r ataioctl\' are
equivalent.
.TP
.B \-V, \-\-version, \-\-license, \-\-copyright
Prints license, copyright, and CVS version information onto
STDOUT and then exits. Please include this information if you are
reporting bugs, or have specific questions about the behavior of
\fBsmartd\fP.

.SH EXAMPLES

.B
smartd
.fi
Runs the daemon in forked mode. This is the normal way to run
\fBsmartd\fP.
Entries are logged to SYSLOG (by default
.B /var/log/messages.)

.B
smartd \-d \-i 30
.fi
Run in foreground (debug) mode, checking the disk status
every 30 seconds.

.B
smartd \-q onecheck
.fi
Registers devices, and checks the status of the devices exactly
once. The exit status (the bash
.B $?
variable) will be zero if all went well, and nonzero if no devices
were detected or some other problem was encountered.

.\" DO NOT MODIFY THIS OR THE FOLLOWING TWO LINES. THIS MATERIAL
.\" IS AUTOMATICALLY INCLUDED IN THE FILE smartd.conf.5
.\" STARTINCLUDE

.SH CONFIGURATION FILE /etc/smartd.conf
In the absence of a configuration file,
\fBsmartd\fP 
will try to open the 20 ATA devices 
.B /dev/hd[a\-t] 
and the 26 SCSI devices
.B /dev/sd[a\-z]
under Linux. Under FreeBSD, 
\fBsmartd\fP
will try to open all existing ATA devices (with entries in /dev)
.B /dev/ad[0\-9]+
and all existing SCSI devices
.B /dev/da[0\-9]+.
This can be annoying if you have an ATA or SCSI device that hangs or
misbehaves when receiving SMART commands.  Even if this causes no
problems, you may be annoyed by the string of error log messages about
block\-major devices that can\'t be found, and SCSI devices that can\'t
be opened.

One can avoid this problem, and gain more control over the types of
events monitored by
\fBsmartd\fP,
by using the configuration file
.B /etc/smartd.conf.
This file contains a list of devices to monitor, with one device per
line.  An example file is included with the
.B smartmontools
distribution. You will find this sample configuration file in
\fB/usr/share/doc/smartmontools\-5.1/\fP. For security, the configuration file
should not be writable by anyone but root. The syntax of the file is as
follows:

.IP
There should be one device listed per line, although you may have
lines that are entirely comments or white space.

Any text following a hash sign \'#\' and up to the end of the line is
taken to be a comment, and ignored.

Lines may be continued by using a backslash \'\e\' as the last
non-whitespace or non-comment item on a line.

[Note: a line whose first character is a hash sign \'#\' is treated as
a white-space blank line, \fBnot\fP as a non-existent line, and will
end a continuation line.]

.PP 0
.fi
Here is an example configuration file.  It\'s for illustrative purposes
only; please don\'t copy it onto your system without reading to the end
of the
.B DIRECTIVES
Section below!

.nf
.B ################################################
.B # This is an example smartd startup config
.B # file /etc/smartd.conf for monitoring three ATA
.B # disks, three SCSI disks, and three ATA disks
.B # behind a 3ware controller.
.B #
.nf
.B # First ATA disk on each of two interfaces. On
.B # the second disk, do a long self-test every
.B # Sunday at 3am.
.B #
.B \ \ /dev/hda -a -m admin@example.com,root@localhost 
.B \ \ /dev/hdc -a -I 194 -I 5 -i 12 -s L/../../7/03
.B #
.nf
.B # SCSI disks.  Send a TEST warning email to admin on
.B # startup.
.B #
.B \ \ /dev/sda
.B \ \ /dev/sdb -m admin@example.com -M test
.B #
.nf
.B # Strange device.  It\'s SCSI. Do a scheduled
.B # long self test at 5am Monday/Thursday
.B \ \ /dev/weird -d scsi -s L/../../(1|4)/05
.B #
.nf
.B # Four ATA disks connected to a 3ware controller.
.B # Do short self-tests daily at midnight, 1, 2, and 3 am
.B \ \ /dev/sdc -d 3ware,0 -a -s S/../.././00
.B \ \ /dev/sdc -d 3ware,1 -a -s S/../.././01
.B \ \ /dev/sdd -d 3ware,2 -a -s S/../.././02
.B \ \ /dev/sdd -d 3ware,3 -a -s S/../.././03
.B #
.nf
.B # The following line enables monitoring of the 
.B # ATA Error Log and the Self\-Test Error Log.  
.B # It also tracks changes in both Prefailure
.B # and Usage Attributes, apart from Attributes
.B # 9, 194, and 231, and shows  continued lines:
.B #
.B \ \ /dev/hdd\ -l\ error\ \e
.B \ \ \ \ \ \ \ \ \ \ \ -l\ selftest\ \e
.B \ \ \ \ \ \ \ \ \ \ \ -t\ \e\ \ \ \ \ \ # Attributes not tracked:
.B \ \ \ \ \ \ \ \ \ \ \ -I\ 194\ \e\ \ # temperature
.B \ \ \ \ \ \ \ \ \ \ \ -I\ 231\ \e\ \ # also temperature
.B \ \ \ \ \ \ \ \ \ \ \ -I 9\ \ \ \ \ \ # power-on hours
.B #
.B ################################################
.fi

.PP 
.SH CONFIGURATION FILE DIRECTIVES
.PP

If the first non\-comment entry in the configuration file is the text
string
.B DEVICESCAN
in capital letters, then
\fBsmartd\fP
will ignore any remaining lines in the configuration file, and will
scan for devices.
.B DEVICESCAN
may optionally be followed by Directives that will apply to all
devices that are found in the scan.  Please see below for additional
details.

.sp 2
The following are the Directives that may appear following the device
name or
.B DEVICESCAN
on any line of the
.B /etc/smartd.conf
configuration file. Note that
.B these are NOT command-line options for 
\fBsmartd\fP.
The Directives below may appear in any order, following the device
name. 

.B For an ATA device,
if no Directives appear, then the device will be monitored
as if the \'\-a\' Directive (monitor all SMART properties) had been given.

.B If a SCSI disk is listed,
it will be monitored at the maximum implemented level: roughly
equivalent to using the \'\-H \-l selftest\' options for an ATA disk.
So with the exception of \'\-d\', \'\-m\', \'\-l selftest\', \'\-s\', and
\'\-M\', the Directives below are ignored for SCSI disks.  For SCSI
disks, the \'\-m\' Directive sends a warning email if the SMART status
indicates a disk failure or problem, if the SCSI inquiry about disk
status fails, or if new errors appear in the self-test log.

.B If a 3ware controller is used
then the corresponding SCSI device must be listed, along with the
\'\-d 3ware,N\' Directive (see below).  The individual ATA disks
hosted by the 3ware controller appear to \fBsmartd\fP as normal ATA
devices.  Hence all the ATA directives can be used for these disks
(but see note below).

.TP
.B \-d TYPE
Specifies the type of the device.  This Directive may be used multiple times
for one device, but the arguments \fIata\fP, \fIscsi\fP, and \fI3ware,N\fP are
mutually-exclusive. If more than one is given then
\fBsmartd\fP
will use the last one which appears.

If none of these three arguments is given, then \fBsmartd\fP will
first attempt to guess the device type by looking at whether the sixth
character in the device name is an \'s\' or an \'h\'.  This will work for
device names like /dev/hda or /dev/sdb, and corresponds to choosing
\fIata\fP or \fIscsi\fP respectively. If
\fBsmartd\fP
can\'t guess from this sixth character, then it will simply try to
access the device using first ATA and then SCSI ioctl()s.

The valid arguments to this Directive are:

.I ata
\- the device type is ATA.  This prevents
\fBsmartd\fP
from issuing SCSI commands to an ATA device.

.I scsi
\- the device type is SCSI.  This prevents
\fBsmartd\fP
from issuing ATA commands to a SCSI device.

.I 3ware,N
\- the device consists of one or more ATA disks connected to a 3ware
RAID controller. The non-negative integer N (in the range from 0 to 15
inclusive) denotes which disk on the controller is monitored.

This Directive may at first appear confusing, because the 3ware
controller is a SCSI device (such as /dev/sda) and should be listed as
such in the the configuration file.  However when the \'\-d 3ware,N\'
Directive is used, then the corresponding disk is addressed using
native ATA commands which are \'passed through\' the SCSI driver. All
ATA Directives listed in this man page may be used.  Note that while
you may use \fBany\fP of the 3ware SCSI logical devices /dev/sd? to
address \fBany\fP of the physical disks (3ware ports), error and log
messages will make the most sense if you always list the 3ware SCSI
logical device corresponding to the particular physical disks.  Please
see the \fBsmartctl\fP man page for further details.

Note that older 3w\-xxxx drivers do not pass the \'Enable Autosave\'
(\fB-S on\fP) and \'Enable Automatic Offline\' (\fB\-o on\fP) commands
to the disk, and produce these types of harmless syslog error messages
instead: \fB\'3w\-xxxx: tw_ioctl(): Passthru size (123392) too big\'\fP. This
can be fixed by upgrading to version 1.02.00.037 or later of the
3w\-xxxx driver, or by applying a patch to older versions. See
\fBhttp://smartmontools.sourceforge.net/\fP for instructions.

.B 3ware controllers are currently ONLY supported under Linux.

.I removable
\- the device or its media is removable.  This indicates to
\fBsmartd\fP
that it should continue (instead of exiting, which is the default
behavior) if the device does not appear to be present when
\fBsmartd\fP is started.  This Directive may be used in conjunction
with the other \'\-d\' Directives.
.TP
.B \-n POWERMODE
ATA disks have five different power states. In order of increasing
power consumption they are: \'OFF\', \'SLEEP\', \'STANDBY\', \'IDLE\',
and \'ACTIVE\'.  Typically in the OFF, SLEEP, and STANDBY modes the
disk\'s platters are not spinning. But usually, in response to SMART
commands issued by \fBsmartd\fP, the disk platters are spun up.  So if
this option is not used, then a disk which is in a low\-power mode may
be spun up and put into a higher\-power mode when it is periodically
polled by \fBsmartd\fP.

Note that if the disk is in SLEEP mode when \fBsmartd\fP is started,
then it won't respond to \fBsmartd\fP commands, and so it won't be
registered as a device for \fBsmartd\fP to monitor. If a disk is in
any other low\-power mode, then the commands issued by \fBsmartd\fP to
register it will probably cause it to spin\-up.

The \'\fB\-n\fP\' (nocheck) Directive specifies if \fBsmartd\fP\'s
periodic checks should still be carried out when the device is in a
low\-power mode.  It may be used to prevent a disk from being spun\-up
by periodic \fBsmartd\fP polling.  The allowed values of POWERMODE
are:

.I never
\- \fBsmartd\fP will poll (check) the device regardless of its power
mode. This may cause a disk which is spun\-down to be spun\-up when
\fBsmartd\fP checks it.  This is the default behavior if the '\-n'
Directive is not given.

.I sleep
\- do not check the device if it is in SLEEP mode.

.I standby
\- do not check the device if it is in SLEEP or STANDBY mode.  In
these modes most disks are not spinning, so if you want to prevent
a laptop disk from spinning up each time that \fBsmartd\fP polls,
this is probably what you want.

.I idle
\- do not check the device if it is in SLEEP, STANDBY or IDLE mode.
In the IDLE state, most disks are still spinning, so this is probably
not what you want.


.TP
.B \-T TYPE
Specifies how tolerant
\fBsmartd\fP
should be of SMART command failures.  The valid arguments to this
Directive are:

.I normal
\- do not try to monitor the disk if a mandatory SMART command fails, but
continue if an optional SMART command fails.  This is the default.

.I permissive
\- try to monitor the disk even if it appears to lack SMART
capabilities.  This may be required for some old disks (prior to
ATA\-3 revision 4) that implemented SMART before the SMART standards
were incorporated into the ATA/ATAPI Specifications.  This may also be
needed for some Maxtor disks which fail to comply with the ATA
Specifications and don't properly indicate support for error\- or
self\-test logging.

[Please see the .B smartctl \-T command-line option.]
.TP
.B \-o VALUE
Enables or disables SMART Automatic Offline Testing when
\fBsmartd\fP
starts up and has no further effect.  The valid arguments to this
Directive are \fIon\fP and \fIoff\fP.

The delay between tests is vendor\-specific, but is typically four
hours.

Note that SMART Automatic Offline Testing is \fBnot\fP part of the ATA
Specification.  Please see the
.B smartctl \-o
command\-line option documentation for further information about this
feature.
.TP
.B \-S VALUE
Enables or disables Attribute Autosave when \fBsmartd\fP
starts up and has no further effect.  The valid arguments to this
Directive are \fIon\fP and \fIoff\fP.  Also affects SCSI devices.
[Please see the \fBsmartctl \-S\fP command-line option.]
.TP
.B \-H
Check the SMART health status of the disk.  If any Prefailure
Attributes are less than or equal to their threshold values, then disk
failure is predicted in less than 24 hours, and a message at loglevel
.B \'LOG_CRITICAL\'
will be logged to syslog.  [Please see the
.B smartctl \-H
command-line option.]
.TP
.B \-l TYPE
Reports increases in the number of errors in one of the two SMART logs.  The
valid arguments to this Directive are:

.I error
\- report if that the number of ATA errors reported in the ATA Error Log has
increased since the last check.

.I selftest
\- report if the number of failed tests reported in the SMART
Self-Test Log has increased since the last check, or if the timestamp
associated with the more recent failed test has increased.  Note that
such errors will \fBonly\fP be logged if you run self-tests on the
disk (and it fails a test!).
Self-Tests can be run automatically by \fBsmartd\fP: please see the \fB\'\-s\'\fP
Directive below.
Self-Tests can also be run manually by using the
\fB\'\-t\ short\'\fP and \fB\'\-t\ long\'\fP options of \fBsmartctl\fP
and the results of the testing can be observed using the \fBsmartctl
\'\-l\ selftest\'\fP command\-line option.]

[Please see the
\fBsmartctl \-l\fP
command\-line option.]
.TP
.B \-s REGEXP
Run Self-Tests or Offline Immediate Tests, at scheduled times.  A
Self- or Offline Immediate Test will be run at the end of periodic
device polling, if all 12 characters of the string \fBT/MM/DD/d/HH\fP
match the extended regular expression \fBREGEXP\fP. Here:
.RS 7
.IP \fBT\fP 4
is the type of the test.  The values that \fBsmartd\fP will try to
match (in turn) are: \'L\' for a \fBL\fPong Self-Test, \'S\' for a \fBS\fPhort
Self-Test, \'C\' for a \fBC\fPonveyance Self-Test (ATA only), and \'O\'
for an \fBO\fPffline Immediate Test (ATA only).  As soon as a match is
found, the test will be started and no additional matches will be
sought for that device and that polling cycle.
.IP \fBMM\fP 4
is the month of the year, expressed with two decimal digits.  The
range is from 01 (January) to 12 (December) inclusive.
.IP \fBDD\fP 4
is the day of the month, expressed with two decimal digits. The
range is from 01 to 31 inclusive.
.IP \fBd\fP 4
is the day of the week, expressed with one decimal digit.  The
range is from 1 (Monday) to 7 (Sunday) inclusive.
.IP \fBHH\fP 4
is the hour of the day, written with two decimal digits, and given in
hours after midnight.  The range is 00 (midnight to just before 1am) to 23 (11pm
to just before midnight) inclusive.
.RE
.RS 7
.PP
Some examples follow.  In reading these, keep in mind that in extended
regular expressions a dot \fB\'.\'\fP matches any single character, and
a parenthetical expression such as \fB\'(A|B|C)\'\fP denotes any one of the three possibilities \fBA\fP,
\fBB\fP, or \fBC\fP.

To schedule a short Self-Test between 2-3am every morning, use:
.nf
\fB \-s S/../.././02\fP
.fi
To schedule a long Self-Test between 4-5am every Sunday morning, use:
.nf
\fB \-s L/../../7/04\fP
.fi
To schedule a long Self-Test between 10-11pm on the first and
fifteenth day of each month, use:
.nf
\fB \-s L/../(01|15)/./22\fP
.fi
To schedule an Offline Immediate test after every midnight, 6am,
noon,and 6pm, plus a Short Self-Test daily at 1-2am and a Long
Self-Test every Saturday at 3-4am, use:
.nf
\fB \-s (O/../.././(00|06|12|18)|S/../.././01|L/../../6/03)
.fi
.PP

Scheduled tests are run immediately following the regularly-scheduled
device polling, if the current local date, time, and test type, match
\fBREGEXP\fP.  By default the regularly-scheduled device polling
occurs every thirty minutes after starting \fBsmartd\fP.  Take caution
if you use the \'\-i\' option to make this polling interval more than
sixty minutes: the poll times may fail to coincide with any of the
testing times that you have specified with \fBREGEXP\fP, and so the
self tests may not take place as you wish.

Before running an offline or self-test, \fBsmartd\fP checks to be sure
that a self-test is not already running.  If a self-test \fBis\fP
already running, then this running self test will \fBnot\fP be
interrupted to begin another test.

\fBsmartd\fP will not attempt to run \fBany\fP type of test if another
test was already started or run in the same hour.

Each time a test is run, \fBsmartd\fP will log an entry to SYSLOG.
You can use these to verify that you constructed \fBREGEXP\fP
correctly.  The matching order (\fBL\fP before \fBS\fP before \fBC\fP
before \fBO\fP) ensures that if multiple test types are all scheduled
for the same hour, the longer test type has precedence.  This is
usually the desired behavior.

.RE

.TP
.B \-m ADD
Send a warning email to the email address
.B ADD
if the \'\-H\', \'\-l\', or \'\-f\' Directives detect a failure or a new
error, or if a SMART command to the disk fails. This Directive only
works in conjunction with these other Directives (or with the
equivalent default \'\-a\' Directive).

To prevent your email in-box from getting filled up with warning
messages, by default only a single warning will be sent for each of
the enabled test types, \'\-H\', \'\-l\', or \'\-f\', even if more than one
failure or error is detected or if the failure or error persists.
[This behavior can be modified; see the \'\-M\' Directive below.]

To send email to more than one user, please use the following "comma
separated" form for the address: \fBuser1@add1,user2@add2,...,userN@addN\fP
(with no spaces).

To test that email is being sent correctly, use the \'\-M test\'
Directive described below to send one test email message on
\fBsmartd\fP
startup.

By default, email is sent using the system 
.B mail
command.  In order that
\fBsmartd\fP
find the mail command (normally /bin/mail) an executable named
.B \'mail\'
must be in the path of the shell or environment from which
\fBsmartd\fP
was started.  If you wish to specify an explicit path to the mail
executable (for example /usr/local/bin/mail) or a custom script to
run, please use the \'\-M exec\' Directive below.

Note that by default under Solaris, in the previous paragraph,
\'\fBmailx\fP\' and \'\fB/bin/mailx\fP\' are used, since Solaris
\'/bin/mail\' does not accept a \'\-s\' (Subject) command-line
argument.

Note also that there is a special argument
.B <nomailer>
which can be given to the \'\-m\' Directive in conjunction with the \'\-M
exec\' Directive. Please see below for an explanation of its effect.

If the mailer or the shell running it produces any STDERR/STDOUT
output, then a snippet of that output will be copied to SYSLOG.  The
remainder of the output is discarded. If problems are encountered in
sending mail, this should help you to understand and fix them.  If
you have mail problems, we recommend running \fBsmartd\fP in debug
mode with the \'-d\' flag, using the \'-M test\' Directive described
below.

.TP
.B \-M TYPE
These Directives modify the behavior of the
\fBsmartd\fP
email warnings enabled with the \'\-m\' email Directive described above.
These \'\-M\' Directives only work in conjunction with the \'\-m\'
Directive and can not be used without it.

Multiple \-M Directives may be given.  If conflicting \-M Directives
are given (example: \-M once \-M daily) then the final one (in the
example, \-M daily) is used.

The valid arguments to the \-M Directive are:

.I once
\- send only one warning email for each type of disk problem detected.  This
is the default.

.I daily
\- send additional warning reminder emails, once per day, for each type
of disk problem detected.

.I diminishing
\- send additional warning reminder emails, after a one-day interval,
then a two-day interval, then a four-day interval, and so on for each
type of disk problem detected. Each interval is twice as long as the
previous interval.

.I test
\- send a single test email
immediately upon
\fBsmartd\fP
startup.  This allows one to verify that email is delivered correctly.

.I exec PATH
\- run the executable PATH instead of the default mail command, when
\fBsmartd\fP
needs to send email.  PATH must point to an executable binary file or
script.

By setting PATH to point to a customized script, you can make
\fBsmartd\fP perform useful tricks when a disk problem is detected
(beeping the console, shutting down the machine, broadcasting warnings
to all logged-in users, etc.)  But please be careful. \fBsmartd\fP
will \fBblock\fP until the executable PATH returns, so if your
executable hangs, then \fBsmartd\fP will also hang. Some sample
scripts are included in
/usr/share/doc/smartmontools-5.1/examplescripts/.

The return status of the executable is recorded by \fBsmartd\fP in
SYSLOG. The executable is not expectected to write to STDOUT or
STDERR.  If it does, then this is interpreted as indicating that
something is going wrong with your executable, and a fragment of this
output is logged to SYSLOG to help you to understand the problem.
Normally, if you wish to leave some record behind, the executable
should send mail or write to a file or device.

Before running the executable, \fBsmartd\fP sets a number of
environment variables.  These environment variables may be used to
control the executable\'s behavior.  The environment variables
exported by \fBsmartd\fP are:
.nf
.fi
.B SMARTD_MAILER
is set to the argument of \-M exec, if present or else to \'mail\'
(examples: /bin/mail, mail).
.nf
.fi
.B SMARTD_DEVICE
is set to the device path (examples: /dev/hda, /dev/sdb).
.nf
.fi
.B SMARTD_DEVICETYPE
is set to the device type (possible values: ata, scsi, 3ware,N). Here
N=0,...,15 denotes the ATA disk behind a 3ware RAID controller.
.nf
.fi
.B SMARTD_DEVICESTRING
is set to the device description.  For SMARTD_DEVICETYPE of ata or
scsi, this is the same as SMARTD_DEVICE.  For 3ware RAID controllers,
the form used is \'/dev/sdc [3ware_disk_01]\'. In this case the device
string contains a space and is NOT quoted.  So to use
$SMARTD_DEVICESTRING in a bash script you should probably enclose it
in double quotes.
.nf
.fi
.B SMARTD_FAILTYPE
gives the reason for the warning or message email.  The possible values that
it takes, and their significance, are:
.I emailtest
(this is an email test message);
.I health
(the SMART health status indicates imminent failure);
.I usage
(a usage Attribute has failed);
.I selftest
(the number of self-test failures has increased);
.I errorcount
(the number of errors in the ATA error log has increased);
.I FAILEDhealthcheck
(the SMART health status command failed);
.I FAILEDreadsmartdata
(the command to read SMART Attribute data failed);
.I FAILEDreadsmarterrorlog
(the command to read the SMART error log failed);
.I FAILEDreadsmartsefltestlog
(the command to read the SMART self-test log failed); abd
.I FAILEDopendevice
(the open() command to the device failed).
.nf
.fi
.B SMARTD_ADDRESS
is determined by the address argument ADD of the \'\-m\' Directive.
If ADD is \fB<nomailer>\fP, then \fBSMARTD_ADDRESS\fP is not set.
Otherwise, it is set to the comma-separated-list of email addresses
given by the argument ADD, with the commas replaced by spaces
(example:admin@example.com root).  If more than one email address is
given, then this string will contain space characters and is NOT
quoted, so to use it in a bash script you may want to enclose it in
double quotes.
.nf
.fi
.B SMARTD_MESSAGE
is set to the warning email message string from
\fBsmartd\fP. 
This message string contains space characters and is NOT quoted. So to
use $SMARTD_MESSAGE in a bash script you should probably enclose it in
double quotes.
.nf
.fi
.B SMARTD_TFIRST
is a text string giving the time and date at which the first problem
of this type was reported. This text string contains space characters
and no newlines, and is NOT quoted. For example:
.nf
.fi
Sun Feb  9 14:58:19 2003 CST
.nf
.fi
.B SMARTD_TFIRSTEPOCH
is an integer, which is the unix epoch (number of seconds since Jan 1,
1970) for
.B SMARTD_TFIRST.

The shell which is used to run PATH is system-dependent. For vanilla
Linux/glibc it\'s bash. For other systems, the man page for
\fBpopen\fP(3) should say what shell is used.

If the \'\-m ADD\' Directive is given with a normal address argument,
then the executable pointed to by PATH will be run in a shell with
STDIN receiving the body of the email message, and with the same
command-line arguments:
.nf
-s "$SMARTD_SUBJECT" $SMARTD_ADDRESS
.fi
that would normally be provided to \'mail\'.  Examples include:
.nf
.B -m user@home -M exec /bin/mail
.B -m admin@work -M exec /usr/local/bin/mailto
.B -m root -M exec /Example_1/bash/script/below
.fi

If the \'\-m ADD\' Directive is given with the special address argument
.B <nomailer>
then the executable pointed to by PATH is run in a shell with
.B no
STDIN and
.B no
command-line arguments, for example:
.nf
.B -m <nomailer> -M exec /Example_2/bash/script/below
.fi
If the executable produces any STDERR/STDOUT output, then \fBsmartd\fP
assumes that something is going wrong, and a snippet of that output
will be copied to SYSLOG.  The remainder of the output is then
discarded.

Some EXAMPLES of scripts that can be used with the \'\-M exec\'
Directive are given below. Some sample scripts are also included in
/usr/share/doc/smartmontools-5.1/examplescripts/.

.TP
.B \-f
Check for \'failure\' of any Usage Attributes.  If these Attributes are
less than or equal to the threshold, it does NOT indicate imminent
disk failure.  It "indicates an advisory condition where the usage or
age of the device has exceeded its intended design life period."
[Please see the \fBsmartctl \-A\fP command-line option.]
.TP
.B \-p
Report anytime that a Prefail Attribute has changed
its value since the last check, 30 minutes ago. [Please see the
.B smartctl \-A
command-line option.]
.TP
.B \-u
Report anytime that a Usage Attribute has changed its value
since the last check, 30 minutes ago. [Please see the
.B smartctl \-A
command-line option.]
.TP
.B \-t
Equivalent to turning on the two previous flags \'\-p\' and \'\-u\'.
Tracks changes in \fIall\fP device Attributes (both Prefailure and
Usage). [Please see the \fBsmartctl\fP \-A command-line option.]
.TP
.B \-i ID
Ignore device Attribute number \fBID\fP when checking for failure of
Usage Attributes.  \fBID\fP must be a decimal integer in the range
from 1 to 255.  This Directive modifies the behavior of the \'\-f\'
Directive and has no effect without it.

This is useful, for example, if you have a very old disk and don\'t
want to keep getting messages about the hours-on-lifetime Attribute
(usually Attribute 9) failing.  This Directive may appear multiple
times for a single device, if you want to ignore multiple Attributes.
.TP
.B \-I ID
Ignore device Attribute \fBID\fP when tracking changes in the
Attribute values.  \fBID\fP must be a decimal integer in the range
from 1 to 255.  This Directive modifies the behavior of the \'\-p\',
\'\-u\', and \'\-t\' tracking Directives and has no effect without one
of them.

This is useful, for example, if one of the device Attributes is the disk
temperature (usually Attribute 194 or 231). It\'s annoying to get reports
each time the temperature changes.  This Directive may appear multiple
times for a single device, if you want to ignore multiple Attributes.
.TP
.B \-r ID
When tracking, report the \fIRaw\fP value of Attribute \fBID\fP along
with its (normally reported) \fINormalized\fP value.  \fBID\fP must be
a decimal integer in the range from 1 to 255.  This Directive modifies
the behavior of the \'\-p\', \'\-u\', and \'\-t\' tracking Directives
and has no effect without one of them.  This Directive may be given
multiple times.

A common use of this Directive is to track the device Temperature
(often ID=194 or 231).

.TP
.B \-R ID
When tracking, report whenever the \fIRaw\fP value of Attribute
\fBID\fP changes.  (Normally \fBsmartd\fP only tracks/reports changes
of the \fINormalized\fP Attribute values.)  \fBID\fP must be a decimal
integer in the range from 1 to 255.  This Directive modifies the
behavior of the \'\-p\', \'\-u\', and \'\-t\' tracking Directives and
has no effect without one of them.  This Directive may be given
multiple times.

If this Directive is given, it automatically implies the \'\-r\'
Directive for the same Attribute, so that the Raw value of the
Attribute is reported.

A common use of this Directive is to track the device Temperature
(often ID=194 or 231).  It is also useful for understanding how
different types of system behavior affects the values of certain
Attributes.

.TP
.B \-F TYPE
Modifies the behavior of \fBsmartd\fP to compensate for some known and
understood device firmware bug.  The arguments to this Directive are
exclusive, so that only the final Directive given is used.  The valid
values are:

.I none
\- Assume that the device firmware obeys the ATA specifications.  This is
the default, unless the device has presets for \'\-F\' in the device
database.

.I samsung
\- In some Samsung disks (example: model SV4012H Firmware Version:
RM100-08) some of the two- and four-byte quantities in the SMART data
structures are byte-swapped (relative to the ATA specification).
Enabling this option tells \fBsmartd\fP to evaluate these quantities
in byte-reversed order.  Some signs that your disk needs this option
are (1) no self-test log printed, even though you have run self-tests;
(2) very large numbers of ATA errors reported in the ATA error log;
(3) strange and impossible values for the ATA error log timestamps.

.I samsung2
\- In more recent Samsung disks (firmware revisions ending in "\-23") the
number of ATA errors reported is byte swapped.  Enabling this option
tells \fBsmartd\fP to evaluate this quantity in byte-reversed order.

Note that an explicit \'\-F\' Directive will over-ride any preset
values for \'\-F\' (see the \'\-P\' option below).


[Please see the \fBsmartctl \-F\fP command-line option.]

.TP
.B \-v N,OPTION
Modifies the labeling for Attribute N, for disks which use
non-standard Attribute definitions.  This is useful in connection with
the Attribute tracking/reporting Directives.

This Directive may appear multiple times. Valid arguments to this
Directive are:

.I 9,minutes
\- Raw Attribute number 9 is power-on time in minutes.  Its raw value
will be displayed in the form \'Xh+Ym\'.  Here X is hours, and Y is
minutes in the range 0-59 inclusive.  Y is always printed with two
digits, for example \'06\' or \'31\' or \'00\'.

.I 9,seconds
\- Raw Attribute number 9 is power-on time in seconds.  Its raw value
will be displayed in the form \'Xh+Ym+Zs\'.  Here X is hours, Y is
minutes in the range 0-59 inclusive, and Z is seconds in the range
0-59 inclusive.  Y and Z are always printed with two digits, for
example \'06\' or \'31\' or \'00\'.

.I 9,halfminutes
\- Raw Attribute number 9 is power-on time, measured in units of 30
seconds.  This format is used by some Samsung disks.  Its raw value
will be displayed in the form \'Xh+Ym\'.  Here X is hours, and Y is
minutes in the range 0-59 inclusive.  Y is always printed with two
digits, for example \'06\' or \'31\' or \'00\'.

.I 9,temp
\- Raw Attribute number 9 is the disk temperature in Celsius.

.I 192,emergencyretractcyclect
\- Raw Attribute number 192 is the Emergency Retract Cycle Count.

.I 193,loadunload
\- Raw Attribute number 193 contains two values. The first is the
number of load cycles.  The second is the number of unload cycles.
The difference between these two values is the number of times that
the drive was unexpectedly powered off (also called an emergency
unload). As a rule of thumb, the mechanical stress created by one
emergency unload is equivalent to that created by one hundred normal
unloads.

.I 194,10xCelsius
\- Raw Attribute number 194 is ten times the disk temperature in
Celsius.  This is used by some Samsung disks (example: model SV1204H
with RK100-13 firmware).

.I 194,unknown
\- Raw Attribute number 194 is NOT the disk temperature, and its
interpretation is unknown. This is primarily useful for the -P
(presets) Directive.

.I 198,offlinescanuncsectorct
\- Raw Attribute number 198 is the Offline Scan UNC Sector Count.

.I 200,writeerrorcount
\- Raw Attribute number 200 is the Write Error Count.

.I 201,detectedtacount
\- Raw Attribute number 201 is the Detected TA Count.

.I 220,temp
\- Raw Attribute number 220 is the disk temperature in Celsius.

Note: a table of hard drive models, listing which Attribute
corresponds to temperature, can be found at:
http://coredump.free.fr/linux/hddtemp.db

.I N,raw8
\- Print the Raw value of Attribute N as six 8-bit unsigned base-10
integers.  This may be useful for decoding the meaning of the Raw
value.  The form \'N,raw8\' prints Raw values for ALL Attributes in this
form.  The form (for example) \'123,raw8\' only prints the Raw value for
Attribute 123 in this form.

.I N,raw16
\- Print the Raw value of Attribute N as three 16-bit unsigned base-10
integers.  This may be useful for decoding the meaning of the Raw
value.  The form \'N,raw16\' prints Raw values for ALL Attributes in this
form.  The form (for example) \'123,raw16\' only prints the Raw value for
Attribute 123 in this form.

.I N,raw48
\- Print the Raw value of Attribute N as a 48-bit unsigned base-10
integer.  This may be useful for decoding the meaning of the Raw
value.  The form \'N,raw48\' prints Raw values for ALL Attributes in
this form.  The form (for example) \'123,raw48\' only prints the Raw
value for Attribute 123 in this form.

.TP
.B \-P TYPE
Specifies whether
\fBsmartd\fP
should use any preset options that are available for this drive.  The
valid arguments to this Directive are:

.I use
\- use any presets that are available for this drive.  This is the default.

.I ignore
\- do not use any presets for this drive.

.I show
\- show the presets listed for this drive in the database.

.I showall
\- show the presets that are available for all drives and then exit.

[Please see the
.B smartctl \-P
command-line option.]

.TP
.B \-a
Equivalent to turning on all of the following Directives: 
.B \'\-H\' 
to check the SMART health status,
.B \'\-f\' 
to report failures of Usage (rather than Prefail) Attributes,
.B \'\-t\' 
to track changes in both Prefailure and Usage Attributes,
.B \'\-l\ selftest\' 
to report increases in the number of Self-Test Log errors, and
.B \'\-l\ error\' 
to report increases in the number of ATA errors.

Note that \-a is the default for ATA devices.  If none of these other
Directives is given, then \-a is assumed.

.TP
.B #
Comment: ignore the remainder of the line.
.TP
.B \e
Continuation character: if this is the last non-white or non-comment
character on a line, then the following line is a continuation of the current
one.
.PP
If you are not sure which Directives to use, I suggest experimenting
for a few minutes with
.B smartctl
to see what SMART functionality your disk(s) support(s).  If you do
not like voluminous syslog messages, a good choice of
\fBsmartd\fP
configuration file Directives might be:
.nf
.B \-H \-l\ selftest \-l\ error \-f.
.fi
If you want more frequent information, use:
.B -a.

.TP
.B ADDITIONAL DETAILS ABOUT DEVICESCAN
If the first non-comment entry in the configuration file is the text
string
.B DEVICESCAN
in capital letters, then
\fBsmartd\fP
will ignore any remaining lines in the configuration file, and will
scan for devices.

If
.B DEVICESCAN 
is not followed by any Directives, then smartd will scan for both ATA
and SCSI devices, and will monitor all possible SMART properties of
any devices that are found.

.B DEVICESCAN
may optionally be followed by any valid Directives, which will be
applied to all devices that are found in the scan.  For example
.nf
.B DEVICESCAN -m root@example.com
.fi
will scan for all devices, and then monitor them.  It will send one
email warning per device for any problems that are found.
.nf
.B  DEVICESCAN -d ata -m root@example.com
.fi
will do the same, but restricts the scan to ATA devices only.  
.nf
.B  DEVICESCAN -H -d ata -m root@example.com
.fi
will do the same, but only monitors the SMART health status of the
devices, (rather than the default \-a, which monitors all SMART
properties).

.TP
.B EXAMPLES OF SHELL SCRIPTS FOR \'\-M exec\'
These are two examples of shell scripts that can be used with the \'\-M
exec PATH\' Directive described previously.  The paths to these scripts
and similar executables is the PATH argument to the \'\-M exec PATH\'
Directive.

Example 1: This script is for use with \'\-m ADDRESS -M exec PATH\'.  It appends
the output of
.B smartctl -a
to the output of the smartd email warning message and sends it to ADDRESS.

.nf
\fB
#! /bin/bash

# Save the email message (STDIN) to a file:
cat > /root/msg

# Append the output of smartctl -a to the message:
/usr/sbin/smartctl -a -d $SMART_DEVICETYPE $SMARTD_DEVICE >> /root/msg
 
# Now email the message to the user at address ADD:
/bin/mail -s "$SMARTD_SUBJECT" $SMARTD_ADDRESS < /root/msg
\fP
.fi

Example 2: This script is for use with \'\-m <nomailer> \-M exec
PATH\'. It warns all users about a disk problem, waits 30 seconds, and
then powers down the machine.

.nf
\fB
#! /bin/bash

# Warn all users of a problem
wall \'Problem detected with disk: \' "$SMARTD_DEVICESTRING"
wall \'Warning message from smartd is: \' "$SMARTD_MESSAGE"
wall \'Shutting down machine in 30 seconds... \'
 
# Wait half a minute
sleep 30
 
# Power down the machine
/sbin/shutdown -hf now
\fP
.fi

Some example scripts are distributed with the smartmontools package,
in /usr/share/doc/smartmontools-5.1/examplescripts/.

Please note that these scripts typically run as root, so any files
that they read/write should not be writable by ordinary users or
reside in directories like /tmp that are writable by ordinary users
and may expose your system to symlink attacks.

As previously described, if the scripts write to STDOUT or STDERR,
this is interpreted as indicating that there was an internal error
within the script, and a snippet of STDOUT/STDERR is logged to SYSLOG.
The remainder is flushed.

.\" ENDINCLUDE
.\" DO NOT MODIFY THIS OR PREVIOUS/NEXT LINES. THIS DEFINES THE 
.\" END OF THE INCLUDE SECTION FOR smartd.conf.5

.SH NOTES
\fBsmartd\fP
will make log entries at loglevel 
.B LOG_INFO
if the Normalized SMART Attribute values have changed, as reported using the
.B \'\-t\', \'\-p\',
or
.B \'\-u\'
Directives. For example:
.nf
.B \'Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed from 94 to 93\'
.fi
Note that in this message, the value given is the \'Normalized\' not the \'Raw\' 
Attribute value (the disk temperature in this case is about 22
Celsius).  The 
.B \'-R\'
and 
.B \'-r\'
Directives modify this behavior, so that the information is printed
with the Raw values as well, for example:
.nf
.B \'Device: /dev/hda, SMART Attribute: 194 Temperature_Celsius changed from 94 [Raw 22] to 93 [Raw 23]\'
.fi
Here the Raw values are the actual disk temperatures in Celsius.  The
way in which the Raw values are printed, and the names under which the
Attributes are reported, is governed by the various
.B \'-v Num,Description\'
Directives described previously.

Please see the
.B smartctl
manual page for further explanation of the differences between
Normalized and Raw Attribute values.

\fBsmartd\fP
will make log entries at loglevel
.B LOG_CRIT
if a SMART Attribute has failed, for example:
.nf
.B \'Device: /dev/hdc, Failed SMART Attribute: 5 Reallocated_Sector_Ct\'
.fi
 This loglevel is used for reporting enabled by the
.B \'\-H\', \-f\', \'\-l\ selftest\',
and
.B \'\-l\ error\'
Directives. Entries reporting failure of SMART Prefailure Attributes
should not be ignored: they mean that the disk is failing.  Use the
.B smartctl
utility to investigate. 

Under Solaris with the default \fB/etc/syslog.conf\fP configuration,
messages below loglevel \fBLOG_NOTICE\fP will \fBnot\fP be recorded.
Hence all \fBsmartd\fP messages with loglevel \fBLOG_INFO\fP will be
lost.  If you want to use the existing daemon facility to log all
messages from \fBsmartd\fP, you should change \fB/etc/syslog.conf\fP
from:
.nf
       ...;daemon.notice;...        /var/adm/messages
.fi
to read:
.nf
       ...;daemon.info;...          /var/adm/messages
.fi
Alternatively, you can use a local facility to log messages: please
see the \fBsmartd\fP '-l' command-line option described above.

.SH RETURN VALUES
The return value (exit status) of 
\fBsmartd\fP
can have the following values:
.TP
.B 0:
Daemon startup successful, or \fBsmartd\fP was killed by a SIGTERM (or in debug mode, a SIGQUIT).
.TP
.B 1:
Commandline did not parse.
.TP
.B 2:
There was a problem opening or parsing \fB/etc/smartd.conf\fP.
.TP
.B 3:
Forking the daemon failed.
.TP
.B 4:
Couldn\'t create PID file.
.TP
.B 8:
\fBsmartd\fP
ran out of memory during startup.
.TP
.B 9:
A compile time constant of\fB smartd\fP was too small.  This can be caused by an
excessive number of disks, or by lines in \fB /etc/smartd.conf\fP that are too long.
Please report this problem to \fB smartmontools-support@lists.sourceforge.net\fP.
.TP
.B 10
An inconsistency was found in \fBsmartd\fP\'s internal data
structures. This should never happen.  It must be due to either a
coding or compiler bug.  \fIPlease\fP report such failures to
smartmontools-support@lists.sourceforge.net.
.TP
.B 16:
A device explicitly listed in
.B /etc/smartd.conf
can\'t be monitored.
.TP
.B 17:
\fBsmartd\fP
didn\'t find any devices to monitor.
.TP
.B 254:
When in daemon mode,
\fBsmartd\fP
received a SIGINT or SIGQUIT.  (Note that in debug mode, SIGINT has
the same effect as SIGHUP, and makes \fBsmartd\fP reload its
configuration file. SIGQUIT has the same effect as SIGTERM and causes
\fBsmartd\fP to exit with zero exit status.
.TP
.B 132 and above
\fBsmartd\fP
was killed by a signal that is not explicitly listed above.  The exit
status is then 128 plus the signal number.  For example if
\fBsmartd\fP
is killed by SIGKILL (signal 9) then the exit status is 137.

.PP
.SH AUTHOR
Bruce Allen
.B smartmontools-support@lists.sourceforge.net
.fi
University of Wisconsin - Milwaukee Physics Department

.PP
.SH CREDITS
.fi
This code was derived from the smartsuite package, written by Michael
Cornwell, and from the previous ucsc smartsuite package. It extends
these to cover ATA-5 disks. This code was originally developed as a
Senior Thesis by Michael Cornwell at the Concurrent Systems Laboratory
(now part of the Storage Systems Research Center), Jack Baskin School
of Engineering, University of California, Santa
Cruz. \fBhttp://ssrc.soe.ucsc.edu/\fP .
.SH
HOME PAGE FOR SMARTMONTOOLS: 
.fi
Please see the following web site for updates, further documentation, bug
reports and patches:
.nf
.B
http://smartmontools.sourceforge.net/

.SH
SEE ALSO:
\fBsmartd.conf\fP(5),
\fBsmartctl\fP(8),
\fBsyslogd\fP(8),
\fBsyslog.conf\fP(5).
.SH
REFERENCES FOR SMART
.fi
If you would like to understand better how SMART works, and what
it does, a good place to start is  Section 8.41 of the \'AT
Attachment with Packet Interface-5\' (ATA/ATAPI-5) specification.  This
documents the SMART functionality which the smartmontools
utilities provide access to.  You can find Revision 1 of this document
at \fBhttp://www.t13.org/project/d1321r1c.pdf\fP .

.fi
Future versions of the specifications (ATA/ATAPI-6 and ATA/ATAPI-7),
and later revisions (2, 3) of the ATA/ATAPI-5 specification are
available from \fBhttp://www.t13.org/#FTP_site\fP .

.fi
The functioning of SMART was originally defined by the SFF-8035i
revision 2 and the SFF-8055i revision 1.4 specifications.  These are
publications of the Small Form Factors (SFF) Committee.  Links to
these documents may be found in the References section of the
smartmontools home page at \fBhttp://smartmontools.sourceforge.net/\fP .

.SH
CVS ID OF THIS PAGE:
$Id: smartd.8.in,v 1.46 2004/03/06 19:43:18 ballen4705 Exp $