-.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/local/share/doc/smartmontools-5.1/examplescripts/.
-
-The return status of the executable is recorded by \fBsmartd\fP in
-SYSLOG. The executable is not expected 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:
-.RS 7
-.IP \fBSMARTD_MAILER\fP 4
-is set to the argument of \-M exec, if present or else to \'mail\'
-(examples: /bin/mail, mail).
-.IP \fBSMARTD_DEVICE\fP 4
-is set to the device path (examples: /dev/hda, /dev/sdb).
-.IP \fBSMARTD_DEVICETYPE\fP 4
-is set to the device type (possible values: ata, scsi, 3ware,N, hpt,L/M/N).
-Here N=0,...,15 denotes the ATA disk behind a 3ware RAID controller and
-L/M/N denotes the SATA disk behind a HighPoint RocketRAID controller.
-.IP \fBSMARTD_DEVICESTRING\fP 4
-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]\'. For HighPoint RocketRAID
-controller, the form is \'/dev/sdd [hpt_1/1/1]\'. In these cases 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.
-.IP \fBSMARTD_FAILTYPE\fP 4
-gives the reason for the warning or message email. The possible values that
-it takes and their meanings are:
-.nf
-.fi
-\fIEmailTest\fP: this is an email test message.
-.nf
-.fi
-\fIHealth\fP: the SMART health status indicates imminent failure.
-.nf
-.fi
-\fIUsage\fP: a usage Attribute has failed.
-.nf
-.fi
-\fISelfTest\fP: the number of self-test failures has increased.
-.nf
-.fi
-\fIErrorCount\fP: the number of errors in the ATA error log has increased.
-.nf
-.fi
-\fICurrentPendingSector\fP: one of more disk sectors could not be
-read and are marked to be reallocated (replaced with spare sectors).
-.nf
-.fi
-\fIOfflineUncorrectableSector\fP: during off\-line testing, or self\-testing,
-one or more disk sectors could not be read.
-.nf
-.fi
-\fIFailedHealthCheck\fP: the SMART health status command failed.
-.nf
-.fi
-\fIFailedReadSmartData\fP: the command to read SMART Attribute data failed.
-.nf
-.fi
-\fIFailedReadSmartErrorLog\fP: the command to read the SMART error log failed.
-.nf
-.fi
-\fIFailedReadSmartSelfTestLog\fP: the command to read the SMART self-test log failed.
-.nf
-.fi
-\fIFailedOpenDevice\fP: the open() command to the device failed.
-.IP \fBSMARTD_ADDRESS\fP 4
-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.
-.IP \fBSMARTD_MESSAGE\fP 4
-is set to the one sentence summary 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.
-.IP \fBSMARTD_FULLMESSAGE\fP 4
-is set to the contents of the entire email warning message string from
-\fBsmartd\fP.
-This message string contains space and return characters and is NOT quoted. So to
-use $SMARTD_FULLMESSAGE in a bash script you should probably enclose it in
-double quotes.
-.IP \fBSMARTD_TFIRST\fP 4
-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
-.IP \fBSMARTD_TFIRSTEPOCH\fP 4
-is an integer, which is the unix epoch (number of seconds since Jan 1,
-1970) for \fBSMARTD_TFIRST\fP.
-.RE
-.\" The following two lines are a workaround for a man2html bug. Please leave them.
-.\" They define a non-existent option; useful because man2html can't correctly reset the margins.
-.TP
-.B \&
-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
-
-Note that on Windows, the syntax of the \'\fBBlat\fP\' mailer is
-used:
-.nf
-- -q -subject "$SMARTD_SUBJECT" -to "$SMARTD_ADDRESS"
-.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/local/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 \-C ID
-[ATA only] Report if the current number of pending sectors is
-non-zero. Here \fBID\fP is the id number of the Attribute whose raw
-value is the Current Pending Sector count. The allowed range of
-\fBID\fP is 0 to 255 inclusive. To turn off this reporting, use
-ID\ =\ 0. If the \fB\-C ID\fP option is not given, then it defaults to
-\fB\-C 197\fP (since Attribute 197 is generally used to monitor
-pending sectors).
-
-A pending sector is a disk sector (containing 512 bytes of your data)
-which the device would like to mark as ``bad" and reallocate.
-Typically this is because your computer tried to read that sector, and
-the read failed because the data on it has been corrupted and has
-inconsistent Error Checking and Correction (ECC) codes. This is
-important to know, because it means that there is some unreadable data
-on the disk. The problem of figuring out what file this data belongs
-to is operating system and file system specific. You can typically
-force the sector to reallocate by writing to it (translation: make the
-device substitute a spare good sector for the bad one) but at the
-price of losing the 512 bytes of data stored there.
-
-.TP
-.B \-U ID
-[ATA only] Report if the number of offline uncorrectable sectors is
-non-zero. Here \fBID\fP is the id number of the Attribute whose raw
-value is the Offline Uncorrectable Sector count. The allowed range of
-\fBID\fP is 0 to 255 inclusive. To turn off this reporting, use
-ID\ =\ 0. If the \fB\-U ID\fP option is not given, then it defaults to
-\fB\-U 198\fP (since Attribute 198 is generally used to monitor
-offline uncorrectable sectors).
-
-
-An offline uncorrectable sector is a disk sector which was not
-readable during an off\-line scan or a self\-test. This is important
-to know, because if you have data stored in this disk sector, and you
-need to read it, the read will fail. Please see the previous \'\-C\'
-option for more details.
-
-.TP
-.B \-W DIFF[,INFO[,CRIT]]
-Report if the current temperature had changed by at least \fBDIFF\fP
-degrees since last report. Report or Warn if the temperature is greater
-or equal than one of \fBINFO\fP or \fBCRIT\fP degrees Celsius. If the
-limit \fBCRIT\fP is reached, a message with loglevel
-\fB\'LOG_CRITICAL\'\fP will be logged to syslog and a warning email
-will be send if '-m' is specified. If only the limit \fBINFO\fP is
-reached, a message with loglevel \fB\'LOG_INFO\'\fP will be logged.
-
-To disable any of the 3 reports, set the corresponding limit to 0.
-Trailing zero arguments may be omitted. By default, all temperature
-reports are disabled (\'-W 0\').
-
-To track temperature changes of at least 2 degrees, use:
-.nf
-\fB \-W 2
-.fi
-To log informal messages on temperatures of at least 40 degrees, use:
-.nf
-\fB \-W 0,40
-.fi
-For warning messages/mails on temperatures of at least 45 degrees, use:
-.nf
-\fB \-W 0,0,45
-.fi
-To combine all of the above reports, use:
-.nf
-\fB \-W 2,40,45
-.fi
-
-For ATA devices, smartd interprets Attribute 194 as Temperature Celsius
-by default. This can be changed to Attribute 9 or 220 by the drive
-database or by the \'-v\' directive, see below.
-
-.TP
-.B \-F TYPE
-[ATA only] 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:
-\fBhttp://www.guzu.net/linux/hddtemp.db\fP
-
-.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,
-.B \'\-l\ error\'
-to report increases in the number of ATA errors,
-.B \'\-C 197\'
-to report nonzero values of the current pending sector count, and
-.B \'\-U 198\'
-to report nonzero values of the offline pending sector count.
-
-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 \fBDEVICESCAN\fP in capital letters, then \fBsmartd\fP will
-ignore any remaining lines in the configuration file, and will scan
-for devices.
-
-If \fBDEVICESCAN\fP 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.
-
-\fBDEVICESCAN\fP 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/local/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/local/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