LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-02-2011, 08:29 PM   #1
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Rep: Reputation: Disabled
Smile Using smartd to periodically monitor hard disk's health


Hello,

I am trying to setup smartd on my slackware server to monitor the hard drives (7 of them) in case problems were to arise.

Slackware comes with smartmontools so no need to install smartctl or smartd. Basically, I want smartd to periodically (lets say every half hour or so) poll the drives and see if problems are found. If so, send an email to inform of the problems found. If no problems found, no email sent...

I am interested in overall health condition, temperature, temperature difference between polls, and all other info that should be verified.

My /etc/smartd.conf file looks like this:

Code:
DEVICESCAN -d scsi -a -I 194 -R 231 -W 4,45,55 -R 5 -m email@gmail.com
TO be honest, I am not an expert at smartd so the command above *COULD* be incomplete, wrong or simply useless... Anybody could suggest a good overall command?

My second question is with the smart daemon itself. I tried to start it and it complained that SMART was not turned on on my drives... I tried to start SMART as suggested by smartd with smart -s on /dev/sdX but it failed....

The output in the terminal from smartd:

Code:
bash-4.1# smartd -d
smartd 5.39.1 2010-01-28 r3054 [i486-slackware-linux-gnu] (local build)
Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net

Opened configuration file /etc/smartd.conf
Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices
Device: /dev/sda, opened
Device: /dev/sda, IE (SMART) not enabled, skip device
Try 'smartctl -s on /dev/sda' to turn on SMART features
Unable to register SCSI device /dev/sda at line 1 of file /etc/smartd.conf
Device: /dev/sdb, opened
Device: /dev/sdb, IE (SMART) not enabled, skip device
Try 'smartctl -s on /dev/sdb' to turn on SMART features
Unable to register SCSI device /dev/sdb at line 1 of file /etc/smartd.conf
Device: /dev/sdc, opened
Device: /dev/sdc, IE (SMART) not enabled, skip device
Try 'smartctl -s on /dev/sdc' to turn on SMART features
Unable to register SCSI device /dev/sdc at line 1 of file /etc/smartd.conf
Device: /dev/sdd, opened
Device: /dev/sdd, IE (SMART) not enabled, skip device
Try 'smartctl -s on /dev/sdd' to turn on SMART features
Unable to register SCSI device /dev/sdd at line 1 of file /etc/smartd.conf
Device: /dev/sde, opened
Device: /dev/sde, IE (SMART) not enabled, skip device
Try 'smartctl -s on /dev/sde' to turn on SMART features
Unable to register SCSI device /dev/sde at line 1 of file /etc/smartd.conf
Device: /dev/sdf, opened
Device: /dev/sdf, IE (SMART) not enabled, skip device
Try 'smartctl -s on /dev/sdf' to turn on SMART features
Unable to register SCSI device /dev/sdf at line 1 of file /etc/smartd.conf
Unable to monitor any SMART enabled devices. Try debug (-d) option. Exiting...
and /var/log/messages:
Code:
May  2 21:18:40 lhost2 smartd[7922]: smartd 5.39.1 2010-01-28 r3054 [i486-slackware-linux-gnu] (local build) Copyright (C) 2002-10 by Bruce Allen, http://smartmontools.sourceforge.net  
May  2 21:18:40 lhost2 smartd[7922]: Opened configuration file /etc/smartd.conf 
May  2 21:18:40 lhost2 smartd[7922]: Configuration file /etc/smartd.conf was parsed, found DEVICESCAN, scanning devices 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sda, opened 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sda, IE (SMART) not enabled, skip device Try 'smartctl -s on /dev/sda' to turn on SMART features 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sdb, opened 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sdb, IE (SMART) not enabled, skip device Try 'smartctl -s on /dev/sdb' to turn on SMART features 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sdc, opened 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sdc, IE (SMART) not enabled, skip device Try 'smartctl -s on /dev/sdc' to turn on SMART features 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sdd, opened 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sdd, IE (SMART) not enabled, skip device Try 'smartctl -s on /dev/sdd' to turn on SMART features 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sde, opened 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sde, IE (SMART) not enabled, skip device Try 'smartctl -s on /dev/sde' to turn on SMART features 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sdf, opened 
May  2 21:18:40 lhost2 smartd[7922]: Device: /dev/sdf, IE (SMART) not enabled, skip device Try 'smartctl -s on /dev/sdf' to turn on SMART features 
May  2 21:18:40 lhost2 smartd[7922]: Unable to monitor any SMART enabled devices. Try debug (-d) option. Exiting...
So any "smart" people out there?? I need to mention that I only use SATA drives... I tried with ata in the config file, but no success.

Last edited by lpallard; 05-02-2011 at 08:31 PM.
 
Old 05-02-2011, 10:12 PM   #2
plpl303a
Member
 
Registered: May 2011
Posts: 52

Rep: Reputation: 3
Did you do "smart -s /dev/sdXX" or "smartctl -s on /dev/sdXX" ?

If you run the smartctl program directly (as root):

smartctl -a /dev/sdXX

do you get lots of interesting output?
 
Old 05-03-2011, 06:54 AM   #3
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Hey there!

I did smart -s and not smartctl -s....


Also yes I see lots of info when I type smartctl -a /dev/sdXX so it means smart is activated yeah?

EDIT: Sorry there, I indeed did smartctl and not smart..... smart is NOT a command

Last edited by lpallard; 05-03-2011 at 08:00 PM.
 
Old 05-03-2011, 08:28 PM   #4
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
OK I got it to work (kinda).... I used -d ata in my smartd.conf file as the parameter to specify the drive type...

Now smartd runs normally (seems to...) but I wonder how to actually run it in the background?

Right now I am calling smartd from rc.local and by default, smartd output its logs and messages to /var/log/messages. I'd rather have them going in a log lets say in /var/log/smartd.... How to do that?

my command to test my setup in smartd.conf is

Code:
/dev/sda -d ata -a -I 194 -I 231 -I 9 -W 5,45,55 -m email@gmail.com
So I believe this command will...

-Specify that /dev/sda is a ata drive (even if it is a SATA drive...)
-Ignores the bytes 194 & 231 (current temperature) because this will change all the time and I dont want an email every time it changes...
-Ignores the byte 9 (Power on time count)
-Report variations of 5C or more, warn if reached 45C (informational) and re-warn if reached 55C (critical)
-Mail all events above to email@gmail.com

Anything to add?

Last edited by lpallard; 05-03-2011 at 09:14 PM.
 
Old 06-20-2011, 12:40 PM   #5
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Hey guys, back to this topic here, I just experienced a strange occurence with a HDD... Not sure what happened because the drive is running fine now, but I remember when that happened, I tried to perform a smart test on the drive and it said that it couldnt read the log or something.. Which makes me wonder if the chipset on the drive is not going..

Anyways, if this smart monitoring thing was working, it would be helpful to know if a drive is going bad and require replacement.

Anybody can help? I think im close to getting it to work. For the remaining issues, please look at my last post.

Thanks to all!
 
Old 09-01-2011, 05:43 PM   #6
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
OK all is fine now... except with the following scenario:

6 HDD permanently plugged to mobo SATA ports. These drives dont change. 2 HDD's connected to hotswap bays. These drives are being turned on/off on demand for backup purposes. If one of these drives is turned ON when the system boots, linux will randomly assign /dev/sdX to these 6+ drives screwing up the nomenclature /dev/sda, /dev/sdb... My fstab & md raid are using UUID's instead of /dev/sdX for assembly & mounting.

As of now, smartd is using /dev/sda, /dev/sdb... /dev/sdf for monitoring. Like I previously said, if one of the hotswap drive is on at boot time, linux will give it /dev/sda or /dev/sdb, resulting in smartd monitoring this drive, but not monitoring the last drive who got tranbsfered... Not good. Also, if I turn off one of these hotswap drives, smartd will freak out because it cant contact the drive.

So my question is: how can I make smart monitor by port numbers (for example the mobo's SATA ports) and not the other ports where the jotswap drives are connected to?

Again, seems like Im the only on on the planet to try this... but it seems to basic. Every windows server are capable of this so I imagine smartd can ...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How Smartd related to Hard disk driver smithaeapen LinuxQuestions.org Member Success Stories 0 12-16-2010 12:09 AM
LXer: GSmartControl - Useful Hard Disk Drive Health Inspection Tool For Linux LXer Syndicated Linux News 0 07-21-2010 02:40 PM
Using smartd to check health of hard-drives? felixk Linux - Software 4 09-25-2009 07:18 PM
LXer: Tip: Monitor Hard Disk Health With Smartmontools LXer Syndicated Linux News 0 10-14-2008 05:40 PM
Monitoring Hardware Health: lm_sensors, smartd & apcupsd njdube Linux - General 2 06-07-2007 07:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration