John Tapsell | 4 Feb 2007 00:01
Picon

Getting SMART info as normal user

Hi,
  I want to add SMART info to ksysguard - the kde task manager type
app.  However I'm not too sure how to get the SMART information as a
normal user since reading from /dev/hd* etc requires root privillages.

  I'm considering writing a small setuid program that gets this
information then dumps it to stdout or perhaps even sends it over
dbus.  Has someone already done this?  Or is it perhaps possible to
query smartd for this information?
  Is there a smartmontools library that I can use, I will have to copy
and paste code?

Thanks all!

JohnFlux

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Erwan Velu | 2 Feb 2007 12:10

A new latop disk from Toshiba

Here come a new disk from toshiba I have bought for my laptop. It forks 
pretty fine but doesn't seems to be in the databse.

Device Model:     TOSHIBA MK1032GSX
Serial Number:    26AX8043T
Firmware Version: AS023E
User Capacity:    100,030,242,816 bytes

Regards,
Erwan

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Erwan Velu | 4 Feb 2007 21:38

Re: Getting SMART info as normal user

John Tapsell wrote:
> Hi,
>   I want to add SMART info to ksysguard - the kde task manager type
> app.  However I'm not too sure how to get the SMART information as a
> normal user since reading from /dev/hd* etc requires root privillages.
>
>   I'm considering writing a small setuid program that gets this
> information then dumps it to stdout or perhaps even sends it over
> dbus.  Has someone already done this?  Or is it perhaps possible to
> query smartd for this information?
>   
AFAIK, this is not possible to consult SMART information as a simple user.
If you like to do it, you can set a setuid bit (chmod +S) or a far 
better solution : just use a "sudo" configuration.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
John Tapsell | 4 Feb 2007 23:07
Picon

Re: Getting SMART info as normal user

Thanks.  Then I will make a restricted version of smartctl that just
gives the information, without allowing tests etc.  Something that can
be reasonable set as setuid by a distro.

But perhaps this would be best done in the smartmontools package
rather than me distributing it seperately.  Would you be interesting
in shipping a cut down version of smartctl that could be setuid by
default?

John

On 04/02/07, Erwan Velu <erwan <at> seanodes.com> wrote:
> John Tapsell wrote:
> > Hi,
> >   I want to add SMART info to ksysguard - the kde task manager type
> > app.  However I'm not too sure how to get the SMART information as a
> > normal user since reading from /dev/hd* etc requires root privillages.
> >
> >   I'm considering writing a small setuid program that gets this
> > information then dumps it to stdout or perhaps even sends it over
> > dbus.  Has someone already done this?  Or is it perhaps possible to
> > query smartd for this information?
> >
> AFAIK, this is not possible to consult SMART information as a simple user.
> If you like to do it, you can set a setuid bit (chmod +S) or a far
> better solution : just use a "sudo" configuration.
>
>

-------------------------------------------------------------------------
(Continue reading)

Markus Koller | 4 Feb 2007 03:46
Picon
Picon
Gravatar

Re: Failed SMART self-check, but only failing attribute is Throughput_Performance?

(sorry for the broken thread)

Hi,

Thanks for both your answers!

I was curious and left the drive running to see what would happen ;)
Interestingly, the error suddenly disappeared yesterday, but now the drive is
making strange noises sometimes, so I guess I'll replace it anyway next week.
Also, the Raw_Read_Error_Rate is changing a lot since then, though never to a
critical value.

If anyone's interested, here are the log messages since yesterday:

smartd[2542]: Device: /dev/hda, FAILED SMART self-check. BACK UP DATA NOW! 
smartd[2542]: Device: /dev/hda, SMART Prefailure Attribute: 2 Throughput_Performance changed from 1
to 100 
smartd[2542]: Device: /dev/hda, SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 74 to
78 
smartd[2542]: Device: /dev/hda, SMART Prefailure Attribute: 2 Throughput_Performance changed from
100 to 101 
smartd[2542]: Device: /dev/hda, SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 78 to
72 
smartd[2542]: Device: /dev/hda, SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 72 to
76 
smartd[2542]: Device: /dev/hda, SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 76 to
92 
smartd[2542]: Device: /dev/hda, SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 92 to
77 
smartd[2542]: Device: /dev/hda, SMART Prefailure Attribute: 1 Raw_Read_Error_Rate changed from 77 to
(Continue reading)

Juergen Richtsfeld | 5 Feb 2007 08:01
Favicon

strange temperature for sata disk

hi!
system info:

smartctl version 5.36 [x86_64-unknown-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar RE Serial ATA series
Device Model:     WDC WD1600SD-01KCB0
Serial Number:    WD-WCAL92915304
Firmware Version: 08.02D08
User Capacity:    160,041,885,696 bytes
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   6
ATA Standard is:  Exact ATA specification draft version not indicated
Local Time is:    Mon Feb  5 07:47:35 2007 CET
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
...
194 Temperature_Celsius     0x0022   107   091   000    Old_age   Always       -       43
...

can this 107 degree celsius be correct? i hope the raw value means the temperature in celsius.

hddtemp return exactly this value as degree celsius.

(Continue reading)

Volker Kuhlmann | 7 Feb 2007 07:16
Picon
Favicon

Re: strange temperature for sata disk

> ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
> ...
> 194 Temperature_Celsius     0x0022   107   091   000    Old_age   Always       -       43
> ...
> 
> can this 107 degree celsius be correct? i hope the raw value means the temperature in celsius.

The temperature in °C is in the raw column (the last one), like as are
all the other user-readable numbers. I don't know what the number in the
"value" column means.

Volker

> hddtemp return exactly this value as degree celsius.
> 
> # hddtemp /dev/sdb
> /dev/sdb: WDC WD1600SD-01KCB0: 43 C

Looks good to me.

Volker

--

-- 
Volker Kuhlmann			is list0570 with the domain in header
http://volker.dnsalias.net/	Please do not CC list postings to me.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
(Continue reading)

jbj | 7 Feb 2007 14:13
Picon

Re: strange temperature for sata disk

On Wed, Feb 07, 2007 at 07:16:48PM +1300, Volker Kuhlmann wrote:
> > ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
> > ...
> > 194 Temperature_Celsius     0x0022   107   091   000    Old_age   Always       -       43
> > ...
> > 
> > can this 107 degree celsius be correct? i hope the raw value means the temperature in celsius.
> 
> The temperature in ?C is in the raw column (the last one), like as are
> all the other user-readable numbers. I don't know what the number in the
> "value" column means.

My understanding is that the values are a 1-byte (0-255) normalised
representation of the actual parameter. These numbers start high, and
decrease depending on given raw parameters. When the number is equal
or less than the threshold value, a fail event is noted on that
attribute.

The severity of the event depends on the type of attribute - a
Pre-fail failure will be a fairly serious indication that the drive is
suffering abnormal failures and likely to break. An Old_age one will
probably be less serious (eg. Large number of Start_Stop events) but
probably indicate that you should think about replacing the disk.

Value/Threshold and Type will be defined by SMART - any values that
you happen to get in the RAW_VALUE column are courtesy of the
manufacturer, and formatting can vary wildly between different makes
(eg. Some disks will give Min/Max temperatures in the temperature
attribute too). Hopefully, though, the numbers for RAW_VALUE will be
correct.
(Continue reading)

Steve Follmer | 8 Feb 2007 08:32
Picon
Favicon

AHCI and SMART and SATA and BIOS and Intel P965 Drivers

Are AHCI and SMART compatible? I have a couple recent Gigabyte motherboards, and like many recent motherboards they have two different SATA controllers, the southbridge part of the intel P965 chipset, and aso a JMicron. The BIOS lets you change from IDE to RAID to AHCI mode for each SATA controller. But whenever I switch to AHCI mode, the BIOS stops reporting that SMART is either on or off. The Intel Matrix Storage Software (I don't use the RAID part) only says the disk is "OK". Smartctl in cygwin stops working. Is the sky falling? Is the world going to move to SATA over AHCI eventually, and then SMART will start to die off? Or we have to switch back to IDE mode in the BIOS then do our SMART? Or would Intel, as part of their AHCI drivers, going to provide some way to access the SMART functions in the drives through AHCI SATA? Or is there some alternative software for Windows. I can't even get the temperatures right now!
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Smartmontools-support mailing list
Smartmontools-support <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/smartmontools-support
Steve Follmer | 8 Feb 2007 08:59
Picon
Favicon

Re: AHCI and SMART and SATA and BIOS and Intel P965 Drivers

Are AHCI and SMART compatible? I have a couple recent Gigabyte 
motherboards, and like many recent motherboards they have two different 
SATA controllers, the southbridge part of the intel P965 chipset, and 
aso a JMicron. The BIOS lets you change from IDE to RAID to AHCI mode 
for each SATA controller. But whenever I switch to AHCI mode, the BIOS 
stops reporting that SMART is either on or off. The Intel Matrix Storage 
Software (I don't use the RAID part) only says the disk is "OK". 
Smartctl in cygwin stops working. Is the sky falling? Is the world going 
to move to SATA over AHCI eventually, and then SMART will start to die 
off? Or we have to reboot to IDE mode in the BIOS then do our SMART? Or 
is Intel, as part of their AHCI drivers, going to provide some way to 
access the SMART functions in the drives through AHCI SATA? Or is there 
some alternative software for Windows. I can't even get the temperatures 
right now!

$ /usr/sbin/smartctl -a -r ioctl,2 /dev/hda
smartctl version 5.36 [i686-cygwin-xp-sp2]
Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

\\.\PhysicalDrive0: SMART_GET_VERSION failed, Error=1117
If this is a SCSI disk, try "scsi<adapter><id>".
To continue, add one or more '-T permissive' options.
Smartctl open device: /dev/hda failed: Function not implemented

For some reason I can't get cygwin to install 5.37. However,
Gigabyte seems to think this situation is normal, that once you
use AHCI the BIOS should not say or do anything about SMART.
So this might not even be a smartctl or an XP driver issue it might
be a BIOS issue or even an AHCI issue that won't go away.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

Gmane