Penguins Unbound
Penguins Unbound > Past Meetings > 20070728 SMART > 12. smartd config

12. smartd config

Page last modified 16:09, 21 Dec 2011 by goeko
    Table of contents
    No headers


    Generally you will not need to modify the smartd.conf file.  Here I modified the file to monitor a drive that doesn't work by default with this version of the tools.


    The /etc/smartd.conf file is pretty simple, and very well documented.  Here is a working config file.

    # /etc/smartd.conf
    # Configuration file for smartd. Use "man smartd.conf" for more information.
    
    # Home page is: http://smartmontools.sourceforge.net
    
    # $Id: smartd.conf,v 1.39 2004/09/14 16:57:49 ballen4705 Exp $
    
    # smartd will re-read the configuration file if it receives a HUP
    # signal
    
    # The file gives a list of devices to monitor using smartd, with one
    # device per line. Text after a hash (#) is ignored, and you may use
    # spaces and tabs for white space. You may use '\' to continue lines.
    
    # You can usually identify which hard disks are on your system by
    # looking in /proc/ide and in /proc/scsi.
    
    # The word DEVICESCAN will cause any remaining lines in this
    # configuration file to be ignored: it tells smartd to scan for all
    # ATA and SCSI devices.  DEVICESCAN may be followed by any of the
    # Directives listed below, which will be applied to all devices that
    # are found.  Most users should comment out DEVICESCAN and explicitly
    # list the devices that they wish to monitor.
    #DEVICESCAN -m root -M exec /usr/share/smartmontools/smartd-runner
    /dev/sda -d ata -a -o on -S on -s (S/../.././02|L/../../6/03) -m root -M exec /usr/share/s
    martmontools/smartd-runner
    
    # First (primary) ATA/IDE hard disk.  Monitor all attributes, enable
    # automatic online data collection, automatic Attribute autosave, and
    # start a short self-test every day between 2-3am, and a long self test
    # Saturdays between 3-4am.
    #/dev/hda -a -o on -S on -s (S/../.././02|L/../../6/03)
    
    # Monitor SMART status, ATA Error Log, Self-test log, and track
    # changes in all attributes except for attribute 194
    #/dev/hdb -H -l error -l selftest -t -I 194 
    
    # A very silent check.  Only report SMART health status if it fails
    # But send an email in this case
    #/dev/hdc -H -m admin@example.com
    
    # First two SCSI disks.  This will monitor everything that smartd can
    # monitor.  Start extended self-tests Wednesdays between 6-7pm and
    # Sundays between 1-2 am
    #/dev/sda -d scsi -s L/../../3/18
    #/dev/sdb -d scsi -s L/../../7/01
    
    # Monitor 4 ATA disks connected to a 3ware 6/7/8000 controller which uses
    # the 3w-xxxx driver. Start long self-tests Sundays between 1-2, 2-3, 3-4, 
    # and 4-5 am.
    # Note: one can also use the /dev/twe0 character device interface.
    #/dev/sdc -d 3ware,0 -a -s L/../../7/01
    #/dev/sdc -d 3ware,1 -a -s L/../../7/02
    #/dev/sdc -d 3ware,2 -a -s L/../../7/03
    #/dev/sdc -d 3ware,3 -a -s L/../../7/04
    
    # Monitor 2 ATA disks connected to a 3ware 9000 controller which uses
    # the 3w-9xxx driver. Start long self-tests Tuesdays between 1-2 and 3-4 am
    #/dev/twa0 -d 3ware,0 -a -s L/../../2/01
    #/dev/twa0 -d 3ware,1 -a -s L/../../2/03
    
    # HERE IS A LIST OF DIRECTIVES FOR THIS CONFIGURATION FILE.
    # PLEASE SEE THE smartd.conf MAN PAGE FOR DETAILS
    #
    #   -d TYPE Set the device type: ata, scsi, marvell, removable, 3ware,N
    #   -T TYPE set the tolerance to one of: normal, permissive
    #   -o VAL  Enable/disable automatic offline tests (on/off)
    #   -S VAL  Enable/disable attribute autosave (on/off)
    #   -n MODE No check. MODE is one of: never, sleep, standby, idle
    #   -H      Monitor SMART Health Status, report if failed
    #   -l TYPE Monitor SMART log.  Type is one of: error, selftest
    #   -f      Monitor for failure of any 'Usage' Attributes
    #   -m ADD  Send warning email to ADD for -H, -l error, -l selftest, and -f
    #   -M TYPE Modify email warning behavior (see man page)
    #   -s REGE Start self-test when type/date matches regular expression (see man page)
    #   -p      Report changes in 'Prefailure' Normalized Attributes
    #   -u      Report changes in 'Usage' Normalized Attributes
    #   -t      Equivalent to -p and -u Directives
    #   -r ID   Also report Raw values of Attribute ID with -p, -u or -t
    #   -R ID   Track changes in Attribute ID Raw value with -p, -u or -t
    #   -i ID   Ignore Attribute ID for -f Directive
    #   -I ID   Ignore Attribute ID for -p, -u or -t Directive
    #   -C ID   Report if Current Pending Sector count non-zero
    #   -U ID   Report if Offline Uncorrectable count non-zero
    #   -v N,ST Modifies labeling of Attribute N (see man page)
    #   -a      Default: equivalent to -H -f -t -l error -l selftest -C 197 -U 198
    #   -F TYPE Use firmware bug workaround. Type is one of: none, samsung
    #   -P TYPE Drive-specific presets: use, ignore, show, showall
    #    #      Comment: text after a hash sign is ignored
    #    \      Line continuation character
    # Attribute ID is a decimal integer 1 <= ID <= 255
    # except for -C and -U, where ID = 0 turns them off.
    # All but -d, -m and -M Directives are only implemented for ATA devices
    #
    # If the test string DEVICESCAN is the first uncommented text
    # then smartd will scan for devices /dev/hd[a-l] and /dev/sd[a-z]
    # DEVICESCAN may be followed by any desired Directives.
    
    

    These are the lines that changed from the default config.


    #DEVICESCAN -m root -M exec /usr/share/smartmontools/smartd-runner
    /dev/sda -d ata -a -o on -S on -s (S/../.././02|L/../../6/03) -m root -M exec /usr/share/smartmontools/smartd-runner

    I uncommented the DEVICESCAN directive, because it did not work in this instance.  And added a line for the drive I want to monitor.  The format of the lines are device to monitor, options for monitoring.  The options are listed at the bottom of the config file.   The '-d ata' force smartd/smartctl to treat the drive as a ata.  The '-a' options tells smartd/smartctl to monitor all options.  The '-o on -S on' turns on smart monitoring on the drive, and turn on the collection of stats accross reboots.  The '-s (S/../.././02|L/../../6/03)' setups up times to do the testing (I believe).  The '-m root' tells smartd to email root.  And the '-M exec...' will execute a script to manage the running of the smartd/smartctl process.
     

    Powered by MindTouch Core