1SMARTD.CONF(5)                    2006/12/20                    SMARTD.CONF(5)
2
3
4

NAME

6       smartd.conf - SMART Disk Monitoring Daemon Configuration File
7
8

FULL PATH

10       /etc/smartd.conf
11
12

PACKAGE VERSION

14       smartmontools-5.37 released 2006/12/20 at 20:37:59 UTC
15
16

DESCRIPTION

18       /etc/smartd.conf is the configuration file for the smartd daemon, which
19       monitors the Self-Monitoring, Analysis and Reporting Technology (SMART)
20       system built into many ATA-3 and later ATA, IDE and SCSI-3 hard drives.
21
22       If  the configuration file /etc/smartd.conf is present, smartd reads it
23       at startup, before fork(2)ing into the  background.  If  smartd  subse‐
24       quently  receives  a HUP signal, it will then re-read the configuration
25       file.  If smartd is running in debug mode, then an INT signal will also
26       make it re-read the configuration file. This signal can be generated by
27       typing <CONTROL-C> in the terminal window where smartd is running.
28
29
30

CONFIGURATION FILE /etc/smartd.conf

32       In the absence of a configuration file, under Linux smartd will try  to
33       open the 20 ATA devices /dev/hd[a-t] and the 26 SCSI devices /dev/sd[a-
34       z].  Under FreeBSD, smartd will try to open all  existing  ATA  devices
35       (with  entries  in  /dev)  /dev/ad[0-9]+  and all existing SCSI devices
36       /dev/da[0-9]+.  Under NetBSD/OpenBSD,  smartd  will  try  to  open  all
37       existing  ATA  devices  (with  entries  in /dev) /dev/wd[0-9]+c and all
38       existing SCSI devices /dev/sd[0-9]+c.  Under Solaris smartd will try to
39       open  all  entries  "/dev/rdsk/c?t?d?s?"  for  IDE/ATA  and  SCSI  disk
40       devices, and entries "/dev/rmt/*" for SCSI tape devices.  Under Windows
41       smartd  will  try  to  open  all  entries  "/dev/hd[a-j]"  ("\\.\Physi‐
42       calDrive[0-9]") for IDE/ATA devices on  WinNT4/2000/XP,  "/dev/hd[a-d]"
43       (bitmask  from "\\.\SMARTVSD") for IDE/ATA devices on Win95/98/98SE/ME,
44       and "/dev/scsi[0-9][0-7]" (ASPI adapter 0-9, ID 0-7) for  SCSI  devices
45       on  all  versions  of  Windows.  Under Darwin, smartd will open any ATA
46       block storage device.
47
48       This can be annoying if you have an ATA or SCSI device  that  hangs  or
49       misbehaves when receiving SMART commands.  Even if this causes no prob‐
50       lems, you may be annoyed by the string  of  error  log  messages  about
51       block-major devices that can´t be found, and SCSI devices that can´t be
52       opened.
53
54       One can avoid this problem, and gain more control  over  the  types  of
55       events   monitored   by   smartd,   by  using  the  configuration  file
56       /etc/smartd.conf.  This file contains a list  of  devices  to  monitor,
57       with  one device per line.  An example file is included with the smart‐
58       montools distribution. You will find this sample configuration file  in
59       /usr/share/doc/smartmontools-5.37/.  For  security,  the  configuration
60       file should not be writable by anyone but root. The syntax of the  file
61       is as follows:
62
63       ·   There  should  be one device listed per line, although you may have
64           lines that are entirely comments or white space.
65
66       ·   Any text following a hash sign ´#´ and up to the end of the line is
67           taken to be a comment, and ignored.
68
69       ·   Lines  may  be  continued by using a backslash ´\´ as the last non-
70           whitespace or non-comment item on a line.
71
72       ·   Note: a line whose first character is a hash sign ´#´ is treated as
73           a  white-space blank line, not as a non-existent line, and will end
74           a continuation line.
75
76       Here is an example configuration file.  It´s for illustrative  purposes
77       only;  please don´t copy it onto your system without reading to the end
78       of the DIRECTIVES Section below!
79
80       ################################################
81       # This is an example smartd startup config file
82       # /etc/smartd.conf for monitoring three
83       # ATA disks, three SCSI disks, six ATA disks
84       # behind two 3ware controllers, three SATA disks
85       # directly connected to the highpoint rocket-
86       # raid controller, two SATA disks connected to
87       # the highpoint rocketraid controller via a pmport
88       # device and one SATA disk.
89       #
90       # First ATA disk on two different interfaces. On
91       # the second disk, start a long self-test every
92       # Sunday between 3 and 4 am.
93       #
94         /dev/hda -a -m admin@example.com,root@localhost
95         /dev/hdc -a -I 194 -I 5 -i 12 -s L/../../7/03
96       #
97       # SCSI disks. Send a TEST warning email to admin on
98       # startup.
99       #
100         /dev/sda
101         /dev/sdb -m admin@example.com -M test
102       #
103       # Strange device. It´s SCSI. Start a scheduled
104       # long self test between 5 and 6 am Monday/Thursday
105         /dev/weird -d scsi -s L/../../(1|4)/05
106       #
107       # An ATA disk may appear as a SCSI device to the
108       # OS. If a SCSI to ATA Translation (SAT) layer
109       # is between the OS and the device then this can be
110       # flagged with the '-d sat' option. This situation
111       # may become common with SATA disks in SAS and FC
112       # environments.
113         /dev/sda -a -d sat
114       #
115       # Four ATA disks on a 3ware 6/7/8000 controller.
116       # Start short self-tests daily between midnight and 1am,
117       # 1-2, 2-3, and 3-4 am. Starting with the Linux 2.6
118       # kernel series, /dev/sdX is deprecated in favor of
119       # /dev/tweN. For example replace /dev/sdc by /dev/twe0
120       # and /dev/sdd by /dev/twe1.
121         /dev/sdc -d 3ware,0 -a -s S/../.././00
122         /dev/sdc -d 3ware,1 -a -s S/../.././01
123         /dev/sdd -d 3ware,2 -a -s S/../.././02
124         /dev/sdd -d 3ware,3 -a -s S/../.././03
125       #
126       # Two ATA disks on a 3ware 9000 controller.
127       # Start long self-tests Sundays between midnight and
128       # 1am and 2-3 am
129         /dev/twa0 -d 3ware,0 -a -s L/../../7/00
130         /dev/twa0 -d 3ware,1 -a -s L/../../7/02
131       #
132       # Three SATA disks on a highpoint rocketraid controller.
133       # Start short self-tests daily between 1-2, 2-3, and
134       # 3-4 am.
135         /dev/sde -d hpt,1/1 -a -s S/../.././01
136         /dev/sde -d hpt,1/2 -a -s S/../.././02
137         /dev/sde -d hpt,1/3 -a -s S/../.././03
138       #
139       # Two SATA disks connected to a highpoint rocketraid
140       # via a pmport device. Start long self-tests Sundays
141       # between midnight and 1am and 2-3 am.
142         /dev/sde -d hpt,1/4/1 -a -s L/../../7/00
143         /dev/sde -d hpt,1/4/2 -a -s L/../../7/02
144       #
145       # The following line enables monitoring of the
146       # ATA Error Log and the Self-Test Error Log.
147       # It also tracks changes in both Prefailure
148       # and Usage Attributes, apart from Attributes
149       # 9, 194, and 231, and shows continued lines:
150       #
151         /dev/hdd -l error \
152                  -l selftest \
153                  -t \      # Attributes not tracked:
154                  -I 194 \  # temperature
155                  -I 231 \  # also temperature
156                  -I 9      # power-on hours
157       #
158       ################################################
159
160

CONFIGURATION FILE DIRECTIVES

162       If the first non-comment entry in the configuration file  is  the  text
163       string  DEVICESCAN  in  capital  letters,  then  smartd will ignore any
164       remaining lines in the configuration file, and will scan  for  devices.
165       DEVICESCAN  may optionally be followed by Directives that will apply to
166       all devices that are found in the scan.  Please  see  below  for  addi‐
167       tional details.
168
169
170
171       The  following  are the Directives that may appear following the device
172       name or DEVICESCAN on any line of  the  /etc/smartd.conf  configuration
173       file.  Note  that  these  are NOT command-line options for smartd.  The
174       Directives below may appear in any order, following the device name.
175
176       For an ATA device, if no Directives appear, then  the  device  will  be
177       monitored  as  if the ´-a´ Directive (monitor all SMART properties) had
178       been given.
179
180       If a SCSI disk is listed, it will be monitored at  the  maximum  imple‐
181       mented  level: roughly equivalent to using the ´-H -l selftest´ options
182       for an ATA disk.  So with the exception of ´-d´, ´-m´,  ´-l  selftest´,
183       ´-s´,  and  ´-M´, the Directives below are ignored for SCSI disks.  For
184       SCSI disks, the ´-m´ Directive sends a warning email if the SMART  sta‐
185       tus indicates a disk failure or problem, if the SCSI inquiry about disk
186       status fails, or if new errors appear in the self-test log.
187
188       If a 3ware controller is used then the corresponding SCSI (/dev/sd?) or
189       character  device  (/dev/twe?  or /dev/twa?) must be listed, along with
190       the ´-d 3ware,N´ Directive  (see  below).   The  individual  ATA  disks
191       hosted  by the 3ware controller appear to smartd as normal ATA devices.
192       Hence all the ATA directives can be used for these disks (but see  note
193       below).
194
195
196       -d TYPE
197              Specifies  the  type  of the device.  This Directive may be used
198              multiple times for one device, but the arguments ata, scsi, sat,
199              marvell,  cciss,N  and  3ware,N  are mutually-exclusive. If more
200              than one is given then  smartd  will  use  the  last  one  which
201              appears.
202
203              If  none  of  these  three  arguments is given, then smartd will
204              first attempt to guess the device type by looking at whether the
205              sixth  character  in  the device name is an ´s´ or an ´h´.  This
206              will work for device names like /dev/hda or /dev/sdb, and corre‐
207              sponds  to  choosing  ata  or scsi respectively. If smartd can´t
208              guess from this sixth character, then  it  will  simply  try  to
209              access the device using first ATA and then SCSI ioctl()s.
210
211              The valid arguments to this Directive are:
212
213              ata - the device type is ATA.  This prevents smartd from issuing
214              SCSI commands to an ATA device.
215
216              scsi - the device type is SCSI.  This prevents smartd from issu‐
217              ing ATA commands to a SCSI device.
218
219              sat  - the device type is SCSI to ATA Translation (SAT).  smartd
220              will generate ATA (smart) commands and then package them in  the
221              SAT  defined  ATA  PASS  THROUGH SCSI commands. The commands are
222              then routed through the SCSI pass through interface to the oper‐
223              ating  system. There are two types of ATA PASS THROUGH SCSI com‐
224              mands: a 12 byte and 16 byte variant.  smartd can use either and
225              defaults  to  the  16  byte variant. This can be overridden with
226              this syntax: ´-d sat,12´ or ´-d sat,16´.
227
228              marvell - Under Linux, interact with SATA disks  behind  Marvell
229              chip-set  controllers  (using  the  Marvell  rather  than libata
230              driver).
231
232              3ware,N - the device consists of one or more ATA disks connected
233              to  a  3ware RAID controller. The non-negative integer N (in the
234              range from 0 to 23 inclusive) denotes which  disk  on  the  con‐
235              troller is monitored.  In log files and email messages this disk
236              will be identified as 3ware_disk_XX with XX in the range from 00
237              to 23 inclusive.
238
239              This  Directive may at first appear confusing, because the 3ware
240              controller is a SCSI device (such as  /dev/sda)  and  should  be
241              listed  as such in the the configuration file.  However when the
242              ´-d 3ware,N´ Directive is used, then the corresponding  disk  is
243              addressed  using  native ATA commands which are ´passed through´
244              the SCSI driver. All ATA Directives listed in this man page  may
245              be used.  Note that while you may use any of the 3ware SCSI log‐
246              ical devices /dev/sd? to  address  any  of  the  physical  disks
247              (3ware  ports),  error and log messages will make the most sense
248              if you always list the 3ware SCSI logical  device  corresponding
249              to  the  particular physical disks.  Please see the smartctl man
250              page for further details.
251
252              ATA disks behind 3ware controllers may alternatively be accessed
253              via   a   character   device   interface   /dev/twe0-15   (3ware
254              6000/7000/8000 controllers) and /dev/twa0-15 (3ware 9000  series
255              controllers).  Note that the 9000 series controllers may only be
256              accessed using the character device interface  /dev/twa0-15  and
257              not the SCSI device interface /dev/sd?.  Please see the smartctl
258              man page for further details.
259
260              Note  that  older  3w-xxxx  drivers  do  not  pass  the  ´Enable
261              Autosave´  (-S  on)  and ´Enable Automatic Offline´ (-o on) com‐
262              mands to the disk, if the SCSI interface is  used,  and  produce
263              these types of harmless syslog error messages instead: ´3w-xxxx:
264              tw_ioctl(): Passthru size (123392) too big´. This can  be  fixed
265              by  upgrading  to  version  1.02.00.037  or later of the 3w-xxxx
266              driver,  or  by  applying  a  patch  to  older  versions.    See
267              http://smartmontools.sourceforge.net/  for instructions.  Alter‐
268              natively use the character device interfaces /dev/twe0-15 (3ware
269              6/7/8000  series controllers) or /dev/twa0-15 (3ware 9000 series
270              controllers).
271
272              cciss,N - the device consists of one or  more  SCSI  disks  con‐
273              nected  to  a  cciss RAID controller. The non-negative integer N
274              (in the range from 0 to 15 inclusive) denotes which disk on  the
275              controller  is  monitored.  In log files and email messages this
276              disk will be identified as cciss_disk_XX with XX  in  the  range
277              from 00 to 15 inclusive.
278
279              3ware  and  cciss controllers are currently ONLY supported under
280              Linux.
281
282              hpt,L/M/N - the device consists of one or more  ATA  disks  con‐
283              nected  to  a HighPoint RocketRAID controller.  The integer L is
284              the controller id, the integer M is the channel number, and  the
285              integer  N  is the PMPort number if it is available. The allowed
286              values of L are from 1 to 4 inclusive, M are from 1 to 8  inclu‐
287              sive and N from 1 to 4 if PMPort available.  And also these val‐
288              ues are limited by the model of the  HighPoint  RocketRAID  con‐
289              troller.   In  log  files  and  email messages this disk will be
290              identified as hpt_X/X/X and X/X/X is the same as L/M/N, note  if
291              no N indicated, N set to the default value 1.
292
293              HighPoint  RocketRAID  controllers  are currently ONLY supported
294              under Linux.
295
296              removable - the device or its media is  removable.   This  indi‐
297              cates  to  smartd  that  it should continue (instead of exiting,
298              which is the default behavior) if the device does not appear  to
299              be  present  when smartd is started.  This Directive may be used
300              in conjunction with the other ´-d´ Directives.
301
302
303       -n POWERMODE[,q]
304              This ´nocheck´ Directive is used to prevent a  disk  from  being
305              spun-up when it is periodically polled by smartd.
306
307              ATA disks have five different power states. In order of increas‐
308              ing power  consumption  they  are:  ´OFF´,  ´SLEEP´,  ´STANDBY´,
309              ´IDLE´,  and ´ACTIVE´.  Typically in the OFF, SLEEP, and STANDBY
310              modes the disk´s platters are  not  spinning.  But  usually,  in
311              response  to  SMART commands issued by smartd, the disk platters
312              are spun up.  So if this option is not used, then a  disk  which
313              is  in  a  low-power  mode  may  be  spun  up  and  put  into  a
314              higher-power mode when it is periodically polled by smartd.
315
316              Note that if the disk is in SLEEP mode when smartd  is  started,
317              then  it won't respond to smartd commands, and so the disk won't
318              be registered as a device for smartd to monitor. If a disk is in
319              any  other low-power mode, then the commands issued by smartd to
320              register the disk will probably cause it to spin-up.
321
322              The ´-n´ (nocheck)  Directive  specifies  if  smartd´s  periodic
323              checks  should  still  be  carried  out  when the device is in a
324              low-power mode.  It may be used to prevent  a  disk  from  being
325              spun-up  by periodic smartd polling.  The allowed values of POW‐
326              ERMODE are:
327
328              never - smartd will poll (check) the device  regardless  of  its
329              power  mode.  This  may  cause  a  disk which is spun-down to be
330              spun-up when smartd checks it.  This is the default behavior  if
331              the '-n' Directive is not given.
332
333              sleep - check the device unless it is in SLEEP mode.
334
335              standby  -  check  the  device  unless it is in SLEEP or STANDBY
336              mode.  In these modes most disks are not  spinning,  so  if  you
337              want  to  prevent  a laptop disk from spinning up each time that
338              smartd polls, this is probably what you want.
339
340              idle - check the device unless it is in SLEEP, STANDBY  or  IDLE
341              mode.  In the IDLE state, most disks are still spinning, so this
342              is probably not what you want.
343
344              When a self test is scheduled (see ´-s´  Directive  below),  the
345              ´-n´ Directive is ignored, and all tests are carried out.
346
347              When  a  periodic  test  is  skipped,  smartd normally writes an
348              informal log message. The message can be suppressed by appending
349              the  option  ´,q´ to POWERMODE (like ´-n standby,q´).  This pre‐
350              vents a laptop disk from spinning up due to this message.
351
352
353       -T TYPE
354              Specifies how tolerant smartd should be of SMART  command  fail‐
355              ures.  The valid arguments to this Directive are:
356
357              normal  -  do  not  try to monitor the disk if a mandatory SMART
358              command fails, but continue if an optional SMART command  fails.
359              This is the default.
360
361              permissive  - try to monitor the disk even if it appears to lack
362              SMART capabilities.  This may be required  for  some  old  disks
363              (prior  to  ATA-3  revision 4) that implemented SMART before the
364              SMART standards were incorporated into the ATA/ATAPI  Specifica‐
365              tions.  This may also be needed for some Maxtor disks which fail
366              to comply with the ATA Specifications and don't  properly  indi‐
367              cate support for error- or self-test logging.
368
369              [Please see the smartctl -T command-line option.]
370
371       -o VALUE
372              Enables  or disables SMART Automatic Offline Testing when smartd
373              starts up and has no further effect.   The  valid  arguments  to
374              this Directive are on and off.
375
376              The  delay  between  tests  is vendor-specific, but is typically
377              four hours.
378
379              Note that SMART Automatic Offline Testing is not part of the ATA
380              Specification.   Please  see the smartctl -o command-line option
381              documentation for further information about this feature.
382
383       -S VALUE
384              Enables or disables Attribute Autosave when smartd starts up and
385              has  no  further  effect.  The valid arguments to this Directive
386              are on and off.  Also affects SCSI  devices.   [Please  see  the
387              smartctl -S command-line option.]
388
389       -H     Check  the  SMART  health status of the disk.  If any Prefailure
390              Attributes are less than or equal  to  their  threshold  values,
391              then disk failure is predicted in less than 24 hours, and a mes‐
392              sage at  loglevel  ´LOG_CRITICAL´  will  be  logged  to  syslog.
393              [Please see the smartctl -H command-line option.]
394
395       -l TYPE
396              Reports  increases  in  the  number  of errors in one of the two
397              SMART logs.  The valid arguments to this Directive are:
398
399              error - report if the number of ATA errors reported in  the  ATA
400              Error Log has increased since the last check.
401
402              selftest  - report if the number of failed tests reported in the
403              SMART Self-Test Log has increased since the last  check,  or  if
404              the  timestamp  associated  with the most recent failed test has
405              increased.  Note that such errors will only be logged if you run
406              self-tests  on  the disk (and it fails a test!).  Self-Tests can
407              be run automatically by smartd: please see  the  ´-s´  Directive
408              below.   Self-Tests  can  also  be  run  manually  by  using the
409              ´-t short´ and ´-t long´ options of smartctl and the results  of
410              the  testing  can  be  observed using the smartctl ´-l selftest´
411              command-line option.]
412
413              [Please see the smartctl -l and -t command-line options.]
414
415       -s REGEXP
416              Run Self-Tests or Offline Immediate Tests, at  scheduled  times.
417              A  Self-  or  Offline  Immediate  Test will be run at the end of
418              periodic device polling, if all  12  characters  of  the  string
419              T/MM/DD/d/HH match the extended regular expression REGEXP. Here:
420
421              T   is the type of the test.  The values that smartd will try to
422                  match (in turn) are: ´L´ for a Long  Self-Test,  ´S´  for  a
423                  Short  Self-Test, ´C´ for a Conveyance Self-Test (ATA only),
424                  and ´O´ for an Offline Immediate Test (ATA only).   As  soon
425                  as  a  match is found, the test will be started and no addi‐
426                  tional matches will be  sought  for  that  device  and  that
427                  polling cycle.
428
429              MM  is the month of the year, expressed with two decimal digits.
430                  The range is from 01 (January) to 12  (December)  inclusive.
431                  Do  not  use a single decimal digit or the match will always
432                  fail!
433
434              DD  is the day of the month, expressed with two decimal  digits.
435                  The  range  is from 01 to 31 inclusive.  Do not use a single
436                  decimal digit or the match will always fail!
437
438              d   is the day of the week, expressed with  one  decimal  digit.
439                  The range is from 1 (Monday) to 7 (Sunday) inclusive.
440
441              HH  is the hour of the day, written with two decimal digits, and
442                  given in hours after midnight.  The range is 00 (midnight to
443                  just before 1am) to 23 (11pm to just before midnight) inclu‐
444                  sive.  Do not use a single decimal digit or the  match  will
445                  always fail!
446
447              Some  examples  follow.   In reading these, keep in mind that in
448              extended regular expressions a dot ´.´ matches any single  char‐
449              acter,  and a parenthetical expression such as ´(A|B|C)´ denotes
450              any one of the three possibilities A, B, or C.
451
452              To schedule a short Self-Test between 2-3am every morning, use:
453               -s S/../.././02
454              To schedule a long Self-Test between 4-5am every Sunday morning,
455              use:
456               -s L/../../7/04
457              To  schedule  a  long Self-Test between 10-11pm on the first and
458              fifteenth day of each month, use:
459               -s L/../(01|15)/./22
460              To schedule an Offline Immediate test after every midnight, 6am,
461              noon,and  6pm,  plus a Short Self-Test daily at 1-2am and a Long
462              Self-Test every Saturday at 3-4am, use:
463               -s (O/../.././(00|06|12|18)|S/../.././01|L/../../6/03)
464
465              Scheduled tests are run  immediately  following  the  regularly-
466              scheduled  device  polling, if the current local date, time, and
467              test type, match REGEXP.   By  default  the  regularly-scheduled
468              device  polling  occurs  every  thirty  minutes  after  starting
469              smartd.  Take caution if you use the ´-i´ option  to  make  this
470              polling  interval  more  than  sixty minutes: the poll times may
471              fail to coincide with any of the testing  times  that  you  have
472              specified  with REGEXP, and so the self tests may not take place
473              as you wish.
474
475              Before running an offline or self-test, smartd checks to be sure
476              that  a  self-test  is  not  already running.  If a self-test is
477              already running, then this running self test will not be  inter‐
478              rupted to begin another test.
479
480              smartd  will not attempt to run any type of test if another test
481              was already started or run in the same hour.
482
483              Each time a test is run, smartd will log  an  entry  to  SYSLOG.
484              You  can  use these or the '-q showtests' command-line option to
485              verify that you  constructed  REGEXP  correctly.   The  matching
486              order  (L  before  S before C before O) ensures that if multiple
487              test types are all scheduled for the same hour, the longer  test
488              type has precedence.  This is usually the desired behavior.
489
490              Unix  users:  please  beware that the rules for extended regular
491              expressions [regex(7)]  are  not  the  same  as  the  rules  for
492              file-name  pattern matching by the shell [glob(7)].  smartd will
493              issue harmless informational  warning  messages  if  it  detects
494              characters  in REGEXP that appear to indicate that you have made
495              this mistake.
496
497
498       -m ADD Send a warning email to the email address ADD if the ´-H´, ´-l´,
499              ´-f´,  ´-C´, or ´-O´ Directives detect a failure or a new error,
500              or if a SMART command to the disk  fails.  This  Directive  only
501              works  in  conjunction  with these other Directives (or with the
502              equivalent default ´-a´ Directive).
503
504              To prevent your email in-box from getting filled up with warning
505              messages, by default only a single warning will be sent for each
506              of the enabled alert types, ´-H´, ´-l´, ´-f´, ´-C´, or ´-O´ even
507              if  more than one failure or error is detected or if the failure
508              or error persists.  [This behavior can be modified; see the ´-M´
509              Directive below.]
510
511              To  send  email  to more than one user, please use the following
512              "comma      separated"      form      for      the      address:
513              user1@add1,user2@add2,...,userN@addN (with no spaces).
514
515              To  test  that  email is being sent correctly, use the ´-M test´
516              Directive described below to send  one  test  email  message  on
517              smartd startup.
518
519              By  default,  email  is  sent using the system mail command.  In
520              order that smartd find the mail command (normally /bin/mail)  an
521              executable  named  ´mail´  must  be  in the path of the shell or
522              environment from which smartd was started.  If you wish to spec‐
523              ify  an  explicit  path  to  the  mail  executable  (for example
524              /usr/local/bin/mail) or a custom script to run, please  use  the
525              ´-M exec´ Directive below.
526
527              Note  that  by default under Solaris, in the previous paragraph,
528              ´mailx´ and ´/bin/mailx´ are  used,  since  Solaris  ´/bin/mail´
529              does not accept a ´-s´ (Subject) command-line argument.
530
531              On  Windows, the ´Blat´ mailer (http://blat.sourceforge.net/) is
532              used by default.  This mailer uses a different command line syn‐
533              tax, see ´-M exec´ below.
534
535              Note  also that there is a special argument <nomailer> which can
536              be given to the ´-m´ Directive in conjunction with the ´-M exec´
537              Directive. Please see below for an explanation of its effect.
538
539              If the mailer or the shell running it produces any STDERR/STDOUT
540              output, then a snippet of that output will be copied to  SYSLOG.
541              The  remainder  of  the  output  is  discarded.  If problems are
542              encountered in sending mail, this should help you to  understand
543              and  fix  them.  If you have mail problems, we recommend running
544              smartd in debug mode with the ´-d´ flag,  using  the  ´-M  test´
545              Directive described below.
546
547              The  following  extension is available on Windows: By specifying
548              ´msgbox´ as a mail address, a warning "email" is displayed as  a
549              message box on the screen.  Using both ´msgbox´ and regular mail
550              addresses is possible, if ´msgbox´ is  the  first  word  in  the
551              comma  separated list.  With ´sysmsgbox´, a system modal (always
552              on top) message box is used. If running as a service, a  service
553              notification  message box (always shown on current visible desk‐
554              top) is used.
555
556
557       -M TYPE
558              These Directives modify the behavior of the smartd  email  warn‐
559              ings  enabled  with  the  ´-m´  email Directive described above.
560              These ´-M´ Directives only work in  conjunction  with  the  ´-m´
561              Directive and can not be used without it.
562
563              Multiple  -M  Directives  may be given.  If more than one of the
564              following three -M Directives are given  (example:  -M  once  -M
565              daily) then the final one (in the example, -M daily) is used.
566
567              The  valid arguments to the -M Directive are (one of the follow‐
568              ing three):
569
570              once - send only one warning email for each type of disk problem
571              detected.  This is the default.
572
573              daily  -  send additional warning reminder emails, once per day,
574              for each type of disk problem detected.
575
576              diminishing - send additional warning reminder emails,  after  a
577              one-day  interval,  then  a  two-day  interval,  then a four-day
578              interval, and so on for each type of disk problem detected. Each
579              interval is twice as long as the previous interval.
580
581              In  addition,  one  may add zero or more of the following Direc‐
582              tives:
583
584              test - send a single test email immediately upon smartd startup.
585              This  allows  one  to  verify that email is delivered correctly.
586              Note that if this Directive is used, smartd will also  send  the
587              normal email warnings that were enabled with the ´-m´ Directive,
588              in addition to the single test email!
589
590              exec PATH - run the executable PATH instead of the default  mail
591              command, when smartd needs to send email.  PATH must point to an
592              executable binary file or script.
593
594              By setting PATH to point to a customized script,  you  can  make
595              smartd  perform  useful  tricks  when a disk problem is detected
596              (beeping the console, shutting down  the  machine,  broadcasting
597              warnings  to  all logged-in users, etc.)  But please be careful.
598              smartd will block until the executable PATH returns, so if  your
599              executable  hangs,  then  smartd  will  also  hang.  Some sample
600              scripts are included in  /usr/share/doc/smartmontools-5.37/exam‐
601              plescripts/.
602
603              The  return  status  of  the executable is recorded by smartd in
604              SYSLOG. The executable is not expected to  write  to  STDOUT  or
605              STDERR.  If it does, then this is interpreted as indicating that
606              something is going wrong with your executable, and a fragment of
607              this  output  is  logged to SYSLOG to help you to understand the
608              problem.  Normally, if you wish to leave some record behind, the
609              executable should send mail or write to a file or device.
610
611              Before  running the executable, smartd sets a number of environ‐
612              ment variables.  These environment variables may be used to con‐
613              trol  the  executable´s  behavior.   The  environment  variables
614              exported by smartd are:
615
616              SMARTD_MAILER
617                  is set to the argument of -M exec, if  present  or  else  to
618                  ´mail´ (examples: /bin/mail, mail).
619
620              SMARTD_DEVICE
621                  is set to the device path (examples: /dev/hda, /dev/sdb).
622
623              SMARTD_DEVICETYPE
624                  is  set  to  the  device  type  (possible values: ata, scsi,
625                  3ware,N, hpt,L/M/N).  Here N=0,...,23 denotes the  ATA  disk
626                  behind  a  3ware  RAID controller and L/M/N denotes the SATA
627                  disk behind a HighPoint RocketRAID controller.
628
629              SMARTD_DEVICESTRING
630                  is set to the device description.  For SMARTD_DEVICETYPE  of
631                  ata  or  scsi, this is the same as SMARTD_DEVICE.  For 3ware
632                  RAID   controllers,   the    form    used    is    ´/dev/sdc
633                  [3ware_disk_01]´.   For HighPoint RocketRAID controller, the
634                  form is ´/dev/sdd [hpt_1/1/1]´.  In these cases  the  device
635                  string  contains  a  space  and  is  NOT  quoted.  So to use
636                  $SMARTD_DEVICESTRING in a bash script  you  should  probably
637                  enclose it in double quotes.
638
639              SMARTD_FAILTYPE
640                  gives the reason for the warning or message email.  The pos‐
641                  sible values that it takes and their meanings are:
642                  EmailTest: this is an email test message.
643                  Health: the SMART health status indicates imminent failure.
644                  Usage: a usage Attribute has failed.
645                  SelfTest: the number of self-test failures has increased.
646                  ErrorCount: the number of errors in the ATA  error  log  has
647                  increased.
648                  CurrentPendingSector:  one of more disk sectors could not be
649                  read and are marked to be reallocated (replaced  with  spare
650                  sectors).
651                  OfflineUncorrectableSector:   during  off-line  testing,  or
652                  self-testing, one or more disk sectors could not be read.
653                  FailedHealthCheck: the SMART health status command failed.
654                  FailedReadSmartData: the command  to  read  SMART  Attribute
655                  data failed.
656                  FailedReadSmartErrorLog: the command to read the SMART error
657                  log failed.
658                  FailedReadSmartSelfTestLog: the command to  read  the  SMART
659                  self-test log failed.
660                  FailedOpenDevice: the open() command to the device failed.
661
662              SMARTD_ADDRESS
663                  is determined by the address argument ADD of the ´-m´ Direc‐
664                  tive.  If ADD is <nomailer>, then SMARTD_ADDRESS is not set.
665                  Otherwise,  it  is  set to the comma-separated-list of email
666                  addresses  given  by  the  argument  ADD,  with  the  commas
667                  replaced  by  spaces  (example:admin@example.com  root).  If
668                  more than one email address is given, then this string  will
669                  contain  space characters and is NOT quoted, so to use it in
670                  a bash script you may want to enclose it in double quotes.
671
672              SMARTD_MESSAGE
673                  is set to the one sentence  summary  warning  email  message
674                  string  from  smartd.   This  message  string contains space
675                  characters and is NOT quoted. So to use $SMARTD_MESSAGE in a
676                  bash script you should probably enclose it in double quotes.
677
678              SMARTD_FULLMESSAGE
679                  is  set  to the contents of the entire email warning message
680                  string from smartd.  This message string contains space  and
681                  return   characters   and   is   NOT   quoted.   So  to  use
682                  $SMARTD_FULLMESSAGE in a bash  script  you  should  probably
683                  enclose it in double quotes.
684
685              SMARTD_TFIRST
686                  is a text string giving the time and date at which the first
687                  problem of this type was reported. This text string contains
688                  space  characters  and  no  newlines, and is NOT quoted. For
689                  example:
690                  Sun Feb  9 14:58:19 2003 CST
691
692              SMARTD_TFIRSTEPOCH
693                  is an integer, which is the unix epoch  (number  of  seconds
694                  since Jan 1, 1970) for SMARTD_TFIRST.
695
696              The  shell  which  is  used to run PATH is system-dependent. For
697              vanilla Linux/glibc it´s bash. For other systems, the  man  page
698              for popen(3) should say what shell is used.
699
700              If  the  ´-m ADD´ Directive is given with a normal address argu‐
701              ment, then the executable pointed to by PATH will be  run  in  a
702              shell  with  STDIN  receiving the body of the email message, and
703              with the same command-line arguments:
704              -s "$SMARTD_SUBJECT" $SMARTD_ADDRESS
705              that would normally be provided to ´mail´.  Examples include:
706              -m user@home -M exec /bin/mail
707              -m admin@work -M exec /usr/local/bin/mailto
708              -m root -M exec /Example_1/bash/script/below
709
710              Note that on Windows, the syntax of the ´Blat´ mailer is used:
711              - -q -subject "$SMARTD_SUBJECT" -to "$SMARTD_ADDRESS"
712
713              If the ´-m ADD´ Directive is  given  with  the  special  address
714              argument  <nomailer>  then  the executable pointed to by PATH is
715              run in a shell with no STDIN and no command-line arguments,  for
716              example:
717              -m <nomailer> -M exec /Example_2/bash/script/below
718              If the executable produces any STDERR/STDOUT output, then smartd
719              assumes that something is going wrong, and  a  snippet  of  that
720              output will be copied to SYSLOG.  The remainder of the output is
721              then discarded.
722
723              Some EXAMPLES of scripts that can be used  with  the  ´-M  exec´
724              Directive are given below. Some sample scripts are also included
725              in /usr/share/doc/smartmontools-5.37/examplescripts/.
726
727
728       -f     Check  for  ´failure´  of  any  Usage  Attributes.    If   these
729              Attributes  are less than or equal to the threshold, it does NOT
730              indicate imminent disk failure.  It "indicates an advisory  con‐
731              dition  where  the  usage  or age of the device has exceeded its
732              intended design life period."  [Please see the smartctl -A  com‐
733              mand-line option.]
734
735       -p     Report  anytime  that  a Prefail Attribute has changed its value
736              since the last check, 30 minutes ago. [Please see  the  smartctl
737              -A command-line option.]
738
739       -u     Report  anytime  that  a  Usage  Attribute has changed its value
740              since the last check, 30 minutes ago. [Please see  the  smartctl
741              -A command-line option.]
742
743       -t     Equivalent  to  turning on the two previous flags ´-p´ and ´-u´.
744              Tracks changes in all device  Attributes  (both  Prefailure  and
745              Usage). [Please see the smartctl -A command-line option.]
746
747       -i ID  Ignore  device  Attribute number ID when checking for failure of
748              Usage Attributes.  ID must be a decimal  integer  in  the  range
749              from 1 to 255.  This Directive modifies the behavior of the ´-f´
750              Directive and has no effect without it.
751
752              This is useful, for example, if you have a  very  old  disk  and
753              don´t  want to keep getting messages about the hours-on-lifetime
754              Attribute (usually Attribute 9)  failing.   This  Directive  may
755              appear multiple times for a single device, if you want to ignore
756              multiple Attributes.
757
758       -I ID  Ignore  device  Attribute  ID  when  tracking  changes  in   the
759              Attribute  values.   ID  must  be a decimal integer in the range
760              from 1 to 255.  This Directive  modifies  the  behavior  of  the
761              ´-p´, ´-u´, and ´-t´ tracking Directives and has no effect with‐
762              out one of them.
763
764              This is useful, for example, if one of the device Attributes  is
765              the disk temperature (usually Attribute 194 or 231). It´s annoy‐
766              ing to get reports each  time  the  temperature  changes.   This
767              Directive  may appear multiple times for a single device, if you
768              want to ignore multiple Attributes.
769
770       -r ID  When tracking, report the Raw value of Attribute ID  along  with
771              its  (normally reported) Normalized value.  ID must be a decimal
772              integer in the range from 1 to 255.  This Directive modifies the
773              behavior of the ´-p´, ´-u´, and ´-t´ tracking Directives and has
774              no effect without one of them.  This Directive may be given mul‐
775              tiple times.
776
777              A  common  use of this Directive is to track the device Tempera‐
778              ture (often ID=194 or 231).
779
780
781       -R ID  When tracking, report whenever the Raw  value  of  Attribute  ID
782              changes.   (Normally  smartd  only tracks/reports changes of the
783              Normalized Attribute values.)  ID must be a decimal  integer  in
784              the  range  from 1 to 255.  This Directive modifies the behavior
785              of the ´-p´, ´-u´, and  ´-t´  tracking  Directives  and  has  no
786              effect  without one of them.  This Directive may be given multi‐
787              ple times.
788
789              If this Directive is given, it automatically  implies  the  ´-r´
790              Directive  for  the same Attribute, so that the Raw value of the
791              Attribute is reported.
792
793              A common use of this Directive is to track the  device  Tempera‐
794              ture (often ID=194 or 231).  It is also useful for understanding
795              how different types of system behavior  affects  the  values  of
796              certain Attributes.
797
798
799       -C ID  [ATA  only]  Report  if the current number of pending sectors is
800              non-zero.  Here ID is the id number of the Attribute  whose  raw
801              value is the Current Pending Sector count.  The allowed range of
802              ID is 0 to 255 inclusive.   To  turn  off  this  reporting,  use
803              ID = 0.   If  the -C ID option is not given, then it defaults to
804              -C 197 (since Attribute 197 is generally used to monitor pending
805              sectors).
806
807              A  pending sector is a disk sector (containing 512 bytes of your
808              data) which the device would like to mark as ``bad" and  reallo‐
809              cate.   Typically  this  is  because your computer tried to read
810              that sector, and the read failed because the data on it has been
811              corrupted  and  has  inconsistent  Error Checking and Correction
812              (ECC) codes.  This is important to know, because it  means  that
813              there  is some unreadable data on the disk.  The problem of fig‐
814              uring out what file this data belongs to is operating system and
815              file  system  specific.   You  can typically force the sector to
816              reallocate by writing to it (translation: make the  device  sub‐
817              stitute a spare good sector for the bad one) but at the price of
818              losing the 512 bytes of data stored there.
819
820
821       -U ID  [ATA only] Report if the number of offline uncorrectable sectors
822              is  non-zero.   Here  ID is the id number of the Attribute whose
823              raw value  is  the  Offline  Uncorrectable  Sector  count.   The
824              allowed  range  of  ID  is 0 to 255 inclusive.  To turn off this
825              reporting, use ID = 0.  If the -U ID option is not  given,  then
826              it  defaults to -U 198 (since Attribute 198 is generally used to
827              monitor offline uncorrectable sectors).
828
829
830              An offline uncorrectable sector is a disk sector which  was  not
831              readable during an off-line scan or a self-test.  This is impor‐
832              tant to know, because if you have data stored in this disk  sec‐
833              tor,  and  you  need to read it, the read will fail.  Please see
834              the previous ´-C´ option for more details.
835
836
837       -W DIFF[,INFO[,CRIT]]
838              Report if the current temperature had changed by at  least  DIFF
839              degrees  since last report. Report or Warn if the temperature is
840              greater or equal than one of INFO or CRIT  degrees  Celsius.  If
841              the  limit  CRIT is reached, a message with loglevel ´LOG_CRITI‐
842              CAL´ will be logged to syslog and a warning email will  be  send
843              if  '-m' is specified. If only the limit INFO is reached, a mes‐
844              sage with loglevel ´LOG_INFO´ will be logged.
845
846              To disable any of the 3 reports, set the corresponding limit  to
847              0.  Trailing zero arguments may be omitted. By default, all tem‐
848              perature reports are disabled (´-W 0´).
849
850              To track temperature changes of at least 2 degrees, use:
851               -W 2
852              To log informal messages on temperatures of at least 40 degrees,
853              use:
854               -W 0,40
855              For  warning  messages/mails  on  temperatures  of  at  least 45
856              degrees, use:
857               -W 0,0,45
858              To combine all of the above reports, use:
859               -W 2,40,45
860
861              For ATA devices, smartd interprets Attribute 194 as  Temperature
862              Celsius by default. This can be changed to Attribute 9 or 220 by
863              the drive database or by the ´-v´ directive, see below.
864
865
866       -F TYPE
867              [ATA only] Modifies the behavior of  smartd  to  compensate  for
868              some known and understood device firmware bug.  The arguments to
869              this Directive are exclusive, so that only the  final  Directive
870              given is used.  The valid values are:
871
872              none  - Assume that the device firmware obeys the ATA specifica‐
873              tions.  This is the default, unless the device has  presets  for
874              ´-F´ in the device database.
875
876              samsung - In some Samsung disks (example: model SV4012H Firmware
877              Version: RM100-08) some of the two- and four-byte quantities  in
878              the  SMART data structures are byte-swapped (relative to the ATA
879              specification).  Enabling this option tells smartd  to  evaluate
880              these  quantities  in byte-reversed order.  Some signs that your
881              disk needs this option are (1) no self-test  log  printed,  even
882              though  you  have  run self-tests; (2) very large numbers of ATA
883              errors reported in the ATA error log; (3) strange and impossible
884              values for the ATA error log timestamps.
885
886              samsung2 - In more recent Samsung disks (firmware revisions end‐
887              ing in "-23") the number of ATA errors reported is byte swapped.
888              Enabling  this  option tells smartd to evaluate this quantity in
889              byte-reversed order.
890
891              Note that an explicit ´-F´ Directive will over-ride  any  preset
892              values for ´-F´ (see the ´-P´ option below).
893
894
895              [Please see the smartctl -F command-line option.]
896
897
898       -v N,OPTION
899              Modifies  the labeling for Attribute N, for disks which use non-
900              standard Attribute definitions.  This is  useful  in  connection
901              with the Attribute tracking/reporting Directives.
902
903              This  Directive  may  appear  multiple times. Valid arguments to
904              this Directive are:
905
906              9,minutes - Raw Attribute number 9 is power-on time in  minutes.
907              Its  raw value will be displayed in the form ´Xh+Ym´.  Here X is
908              hours, and Y is minutes in  the  range  0-59  inclusive.   Y  is
909              always  printed  with  two  digits,  for example ´06´ or ´31´ or
910              ´00´.
911
912              9,seconds - Raw Attribute number 9 is power-on time in  seconds.
913              Its  raw value will be displayed in the form ´Xh+Ym+Zs´.  Here X
914              is hours, Y is minutes in the range 0-59  inclusive,  and  Z  is
915              seconds in the range 0-59 inclusive.  Y and Z are always printed
916              with two digits, for example ´06´ or ´31´ or ´00´.
917
918              9,halfminutes - Raw Attribute number 9 is  power-on  time,  mea‐
919              sured  in units of 30 seconds.  This format is used by some Sam‐
920              sung disks.  Its  raw  value  will  be  displayed  in  the  form
921              ´Xh+Ym´.   Here  X  is hours, and Y is minutes in the range 0-59
922              inclusive.  Y is always printed with  two  digits,  for  example
923              ´06´ or ´31´ or ´00´.
924
925              9,temp  - Raw Attribute number 9 is the disk temperature in Cel‐
926              sius.
927
928              192,emergencyretractcyclect - Raw Attribute number  192  is  the
929              Emergency Retract Cycle Count.
930
931              193,loadunload  -  Raw Attribute number 193 contains two values.
932              The first is the number of load cycles.  The second is the  num‐
933              ber  of  unload cycles.  The difference between these two values
934              is the number of times that the drive was  unexpectedly  powered
935              off  (also  called an emergency unload). As a rule of thumb, the
936              mechanical stress created by one emergency unload is  equivalent
937              to that created by one hundred normal unloads.
938
939              194,10xCelsius  - Raw Attribute number 194 is ten times the disk
940              temperature in Celsius.  This is  used  by  some  Samsung  disks
941              (example: model SV1204H with RK100-13 firmware).
942
943              194,unknown  - Raw Attribute number 194 is NOT the disk tempera‐
944              ture, and its interpretation is unknown. This is primarily  use‐
945              ful for the -P (presets) Directive.
946
947              198,offlinescanuncsectorct  -  Raw  Attribute  number 198 is the
948              Offline Scan UNC Sector Count.
949
950              200,writeerrorcount - Raw Attribute  number  200  is  the  Write
951              Error Count.
952
953              201,detectedtacount  -  Raw Attribute number 201 is the Detected
954              TA Count.
955
956              220,temp - Raw Attribute number 220 is the disk  temperature  in
957              Celsius.
958
959              Note: a table of hard drive models, listing which Attribute cor‐
960              responds    to     temperature,     can     be     found     at:
961              http://www.guzu.net/linux/hddtemp.db
962
963              N,raw8  -  Print  the  Raw  value  of  Attribute  N as six 8-bit
964              unsigned base-10 integers.  This may be useful for decoding  the
965              meaning  of  the Raw value.  The form ´N,raw8´ prints Raw values
966              for ALL  Attributes  in  this  form.   The  form  (for  example)
967              ´123,raw8´  only  prints the Raw value for Attribute 123 in this
968              form.
969
970              N,raw16 - Print the Raw value of Attribute  N  as  three  16-bit
971              unsigned  base-10 integers.  This may be useful for decoding the
972              meaning of the Raw value.  The form ´N,raw16´ prints Raw  values
973              for  ALL  Attributes  in  this  form.   The  form  (for example)
974              ´123,raw16´ only prints the Raw value for Attribute 123 in  this
975              form.
976
977              N,raw48  -  Print  the  Raw  value  of  Attribute  N as a 48-bit
978              unsigned base-10 integer.  This may be useful for  decoding  the
979              meaning  of the Raw value.  The form ´N,raw48´ prints Raw values
980              for ALL  Attributes  in  this  form.   The  form  (for  example)
981              ´123,raw48´  only prints the Raw value for Attribute 123 in this
982              form.
983
984
985       -P TYPE
986              Specifies whether smartd should use any preset options that  are
987              available for this drive.  The valid arguments to this Directive
988              are:
989
990              use - use any presets that are available for this  drive.   This
991              is the default.
992
993              ignore - do not use any presets for this drive.
994
995              show - show the presets listed for this drive in the database.
996
997              showall - show the presets that are available for all drives and
998              then exit.
999
1000              [Please see the smartctl -P command-line option.]
1001
1002
1003       -a     Equivalent to turning on all of the following  Directives:  ´-H´
1004              to  check  the  SMART  health status, ´-f´ to report failures of
1005              Usage (rather than Prefail) Attributes, ´-t´ to track changes in
1006              both  Prefailure  and  Usage Attributes, ´-l selftest´ to report
1007              increases in the number of Self-Test Log errors,  ´-l error´  to
1008              report increases in the number of ATA errors, ´-C 197´ to report
1009              nonzero values of the current pending sector count, and ´-U 198´
1010              to report nonzero values of the offline pending sector count.
1011
1012              Note  that  -a is the default for ATA devices.  If none of these
1013              other Directives is given, then -a is assumed.
1014
1015
1016       #      Comment: ignore the remainder of the line.
1017
1018       \      Continuation character: if this is the last  non-white  or  non-
1019              comment  character  on a line, then the following line is a con‐
1020              tinuation of the current one.
1021
1022       If you are not sure which Directives to use,  I  suggest  experimenting
1023       for  a  few  minutes with smartctl to see what SMART functionality your
1024       disk(s) support(s).  If you do not like voluminous syslog  messages,  a
1025       good choice of smartd configuration file Directives might be:
1026       -H -l selftest -l error -f.
1027       If you want more frequent information, use: -a.
1028
1029
1030       ADDITIONAL DETAILS ABOUT DEVICESCAN
1031              If  the first non-comment entry in the configuration file is the
1032              text string DEVICESCAN in  capital  letters,  then  smartd  will
1033              ignore  any  remaining lines in the configuration file, and will
1034              scan for devices.
1035
1036              If DEVICESCAN is not followed by  any  Directives,  then  smartd
1037              will  scan  for  both ATA and SCSI devices, and will monitor all
1038              possible SMART properties of any devices that are found.
1039
1040              DEVICESCAN may optionally be followed by any  valid  Directives,
1041              which will be applied to all devices that are found in the scan.
1042              For example
1043              DEVICESCAN -m root@example.com
1044              will scan for all devices, and then monitor them.  It will  send
1045              one email warning per device for any problems that are found.
1046              DEVICESCAN -d ata -m root@example.com
1047              will do the same, but restricts the scan to ATA devices only.
1048              DEVICESCAN -H -d ata -m root@example.com
1049              will  do  the same, but only monitors the SMART health status of
1050              the devices, (rather than the default  -a,  which  monitors  all
1051              SMART properties).
1052
1053
1054       EXAMPLES OF SHELL SCRIPTS FOR ´-M exec´
1055              These  are  two  examples of shell scripts that can be used with
1056              the ´-M exec PATH´ Directive described previously.  The paths to
1057              these  scripts  and  similar executables is the PATH argument to
1058              the ´-M exec PATH´ Directive.
1059
1060              Example 1: This script is for  use  with  ´-m  ADDRESS  -M  exec
1061              PATH´.   It  appends  the output of smartctl -a to the output of
1062              the smartd email warning message and sends it to ADDRESS.
1063
1064              #! /bin/bash
1065
1066              # Save the email message (STDIN) to a file:
1067              cat > /root/msg
1068
1069              # Append the output of smartctl -a to the message:
1070              /usr/sbin/smartctl -a -d $SMART_DEVICETYPE $SMARTD_DEVICE >> /root/msg
1071
1072              # Now email the message to the user at address ADD:
1073              /bin/mail -s "$SMARTD_SUBJECT" $SMARTD_ADDRESS < /root/msg
1074
1075              Example 2: This script is for use with ´-m  <nomailer>  -M  exec
1076              PATH´.  It  warns  all users about a disk problem, waits 30 sec‐
1077              onds, and then powers down the machine.
1078
1079              #! /bin/bash
1080
1081              # Warn all users of a problem
1082              wall ´Problem detected with disk: ´ "$SMARTD_DEVICESTRING"
1083              wall ´Warning message from smartd is: ´ "$SMARTD_MESSAGE"
1084              wall ´Shutting down machine in 30 seconds... ´
1085
1086              # Wait half a minute
1087              sleep 30
1088
1089              # Power down the machine
1090              /sbin/shutdown -hf now
1091
1092              Some example scripts  are  distributed  with  the  smartmontools
1093              package, in /usr/share/doc/smartmontools-5.37/examplescripts/.
1094
1095              Please  note  that  these  scripts typically run as root, so any
1096              files that they read/write should not be  writable  by  ordinary
1097              users  or  reside  in directories like /tmp that are writable by
1098              ordinary users and may expose your system to symlink attacks.
1099
1100              As previously described, if  the  scripts  write  to  STDOUT  or
1101              STDERR,  this  is  interpreted  as  indicating that there was an
1102              internal error within the script, and a snippet of STDOUT/STDERR
1103              is logged to SYSLOG.  The remainder is flushed.
1104
1105
1106

AUTHOR

1108       Bruce Allen smartmontools-support@lists.sourceforge.net
1109       University of Wisconsin - Milwaukee Physics Department
1110
1111

CONTRIBUTORS

1113       The following have made large contributions to smartmontools:
1114       Casper Dik (Solaris SCSI interface)
1115       Christian Franke (Windows interface and Cygwin package)
1116       Douglas Gilbert (SCSI subsystem)
1117       Guido Guenther (Autoconf/Automake packaging)
1118       Geoffrey Keating (Darwin ATA interface)
1119       Eduard Martinescu (FreeBSD interface)
1120       Frederic L. W. Meunier (Web site and Mailing list)
1121       Keiji Sawada (Solaris ATA interface)
1122       Sergey Svishchev (NetBSD interface)
1123       David Snyder and Sergey Svishchev (OpenBSD interface)
1124       Phil Williams (User interface and drive database)
1125       Shengfeng Zhou (Linux Highpoint RocketRaid interface)
1126       Many other individuals have made smaller contributions and corrections.
1127
1128

CREDITS

1130       This  code  was derived from the smartsuite package, written by Michael
1131       Cornwell, and from the previous ucsc  smartsuite  package.  It  extends
1132       these  to  cover  ATA-5  disks. This code was originally developed as a
1133       Senior Thesis by Michael Cornwell at the Concurrent Systems  Laboratory
1134       (now  part  of the Storage Systems Research Center), Jack Baskin School
1135       of    Engineering,    University    of    California,    Santa    Cruz.
1136       http://ssrc.soe.ucsc.edu/ .
1137

HOME PAGE FOR SMARTMONTOOLS:

1139       Please  see  the following web site for updates, further documentation,
1140       bug reports and patches:
1141       http://smartmontools.sourceforge.net/
1142
1143

SEE ALSO:

1145       smartd(8),  smartctl(8),  syslogd(8),   syslog.conf(5),   badblocks(8),
1146       ide-smart(8), regex(7).
1147
1148

CVS ID OF THIS PAGE:

1150       $Id: smartd.conf.5.in,v 1.82 2006/12/20 07:30:43 sxzzsf Exp $
1151
1152
1153
1154smartmontools-5.37                2006/12/20                    SMARTD.CONF(5)
Impressum