📄 smartd.8.in
字号:
.TP.B \-C ID[ATA only] Report if the current number of pending sectors isnon-zero. Here \fBID\fP is the id number of the Attribute whose rawvalue is the Current Pending Sector count. The allowed range of\fBID\fP is 0 to 255 inclusive. To turn off this reporting, useID\ =\ 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 monitorpending 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, andthe read failed because the data on it has been corrupted and hasinconsistent Error Checking and Correction (ECC) codes. This isimportant to know, because it means that there is some unreadable dataon the disk. The problem of figuring out what file this data belongsto is operating system and file system specific. You can typicallyforce the sector to reallocate by writing to it (translation: make thedevice substitute a spare good sector for the bad one) but at theprice of losing the 512 bytes of data stored there..TP.B \-U ID[ATA only] Report if the number of offline uncorrectable sectors isnon-zero. Here \fBID\fP is the id number of the Attribute whose rawvalue is the Offline Uncorrectable Sector count. The allowed range of\fBID\fP is 0 to 255 inclusive. To turn off this reporting, useID\ =\ 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 monitoroffline uncorrectable sectors).An offline uncorrectable sector is a disk sector which was notreadable during an off\-line scan or a self\-test. This is importantto know, because if you have data stored in this disk sector, and youneed 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\fPdegrees since last report. Report or Warn if the temperature is greateror equal than one of \fBINFO\fP or \fBCRIT\fP degrees Celsius. If thelimit \fBCRIT\fP is reached, a message with loglevel\fB\'LOG_CRITICAL\'\fP will be logged to syslog and a warning emailwill be send if '-m' is specified. If only the limit \fBINFO\fP isreached, 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 temperaturereports are disabled (\'-W 0\').To track temperature changes of at least 2 degrees, use:.nf\fB \-W 2.fiTo log informal messages on temperatures of at least 40 degrees, use:.nf\fB \-W 0,40.fiFor warning messages/mails on temperatures of at least 45 degrees, use:.nf\fB \-W 0,0,45.fiTo combine all of the above reports, use:.nf\fB \-W 2,40,45.fiFor ATA devices, smartd interprets Attribute 194 as Temperature Celsiusby default. This can be changed to Attribute 9 or 220 by the drivedatabase or by the \'-v\' directive, see below..TP.B \-F TYPE[ATA only] Modifies the behavior of \fBsmartd\fP to compensate forsome known and understood device firmware bug. The arguments to thisDirective are exclusive, so that only the final Directive given isused. The valid values are:.I none\- Assume that the device firmware obeys the ATA specifications. This isthe default, unless the device has presets for \'\-F\' in the devicedatabase..I samsung\- In some Samsung disks (example: model SV4012H Firmware Version:RM100-08) some of the two- and four-byte quantities in the SMART datastructures are byte-swapped (relative to the ATA specification).Enabling this option tells \fBsmartd\fP to evaluate these quantitiesin byte-reversed order. Some signs that your disk needs this optionare (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") thenumber of ATA errors reported is byte swapped. Enabling this optiontells \fBsmartd\fP to evaluate this quantity in byte-reversed order..I samsung3\- Some Samsung disks (at least SP2514N with Firmware VF100\-37) reporta self\-test still in progress with 0% remaining when the test was alreadycompleted. If this directive is specified, \fBsmartd\fP will not skip thenext scheduled self\-test (see Directive \'\-s\' above) in this case.Note that an explicit \'\-F\' Directive will over-ride any presetvalues for \'\-F\' (see the \'\-P\' option below).[Please see the \fBsmartctl \-F\fP command-line option.].TP.B \-v N,OPTIONModifies the labeling for Attribute N, for disks which usenon-standard Attribute definitions. This is useful in connection withthe Attribute tracking/reporting Directives.This Directive may appear multiple times. Valid arguments to thisDirective are:.I 9,minutes\- Raw Attribute number 9 is power-on time in minutes. Its raw valuewill be displayed in the form \'Xh+Ym\'. Here X is hours, and Y isminutes in the range 0-59 inclusive. Y is always printed with twodigits, for example \'06\' or \'31\' or \'00\'..I 9,seconds\- Raw Attribute number 9 is power-on time in seconds. Its raw valuewill be displayed in the form \'Xh+Ym+Zs\'. Here X is hours, Y isminutes in the range 0-59 inclusive, and Z is seconds in the range0-59 inclusive. Y and Z are always printed with two digits, forexample \'06\' or \'31\' or \'00\'..I 9,halfminutes\- Raw Attribute number 9 is power-on time, measured in units of 30seconds. This format is used by some Samsung disks. Its raw valuewill be displayed in the form \'Xh+Ym\'. Here X is hours, and Y isminutes in the range 0-59 inclusive. Y is always printed with twodigits, 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 thenumber of load cycles. The second is the number of unload cycles.The difference between these two values is the number of times thatthe drive was unexpectedly powered off (also called an emergencyunload). As a rule of thumb, the mechanical stress created by oneemergency unload is equivalent to that created by one hundred normalunloads..I 194,10xCelsius\- Raw Attribute number 194 is ten times the disk temperature inCelsius. This is used by some Samsung disks (example: model SV1204Hwith RK100-13 firmware)..I 194,unknown\- Raw Attribute number 194 is NOT the disk temperature, and itsinterpretation 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 Attributecorresponds 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-10integers. This may be useful for decoding the meaning of the Rawvalue. The form \'N,raw8\' prints Raw values for ALL Attributes in thisform. The form (for example) \'123,raw8\' only prints the Raw value forAttribute 123 in this form..I N,raw16\- Print the Raw value of Attribute N as three 16-bit unsigned base-10integers. This may be useful for decoding the meaning of the Rawvalue. The form \'N,raw16\' prints Raw values for ALL Attributes in thisform. The form (for example) \'123,raw16\' only prints the Raw value forAttribute 123 in this form..I N,raw48\- Print the Raw value of Attribute N as a 48-bit unsigned base-10integer. This may be useful for decoding the meaning of the Rawvalue. The form \'N,raw48\' prints Raw values for ALL Attributes inthis form. The form (for example) \'123,raw48\' only prints the Rawvalue for Attribute 123 in this form..TP.B \-P TYPESpecifies whether\fBsmartd\fPshould use any preset options that are available for this drive. Thevalid 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 \-Pcommand-line option.].TP.B \-aEquivalent 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 otherDirectives is given, then \-a is assumed..TP.B #Comment: ignore the remainder of the line..TP.B \eContinuation character: if this is the last non-white or non-commentcharacter on a line, then the following line is a continuation of the currentone..PPIf you are not sure which Directives to use, I suggest experimentingfor a few minutes with.B smartctlto see what SMART functionality your disk(s) support(s). If you donot like voluminous syslog messages, a good choice of\fBsmartd\fPconfiguration file Directives might be:.nf.B \-H \-l\ selftest \-l\ error \-f..fiIf you want more frequent information, use:.B -a..TP.B ADDITIONAL DETAILS ABOUT DEVICESCANIf the first non-comment entry in the configuration file is the textstring \fBDEVICESCAN\fP in capital letters, then \fBsmartd\fP willignore any remaining lines in the configuration file, and will scanfor devices.If \fBDEVICESCAN\fP is not followed by any Directives, then smartdwill scan for both ATA and SCSI devices, and will monitor all possibleSMART 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. Forexample.nf.B DEVICESCAN -m root@example.com.fiwill scan for all devices, and then monitor them. It will send oneemail warning per device for any problems that are found..nf.B DEVICESCAN -d ata -m root@example.com.fiwill do the same, but restricts the scan to ATA devices only. .nf.B DEVICESCAN -H -d ata -m root@example.com.fiwill do the same, but only monitors the SMART health status of thedevices, (rather than the default \-a, which monitors all SMARTproperties)..TP.B EXAMPLES OF SHELL SCRIPTS FOR \'\-M exec\'These are two examples of shell scripts that can be used with the \'\-Mexec PATH\' Directive described previously. The paths to these scriptsand 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 appendsthe output of.B smartctl -ato 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.fiExample 2: This script is for use with \'\-m <nomailer
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -