Bug 58154 - SMART data for hard disk available as ksysguard sensors.
Summary: SMART data for hard disk available as ksysguard sensors.
Status: RESOLVED UNMAINTAINED
Alias: None
Product: ksysguard
Classification: Unmaintained
Component: general (other bugs)
Version First Reported In: unspecified
Platform: unspecified Linux
: LO wishlist
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-05 21:43 UTC by Ing. Jozef Sakalos
Modified: 2024-09-23 21:01 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
hddtemp integration patch (8.36 KB, patch)
2013-03-03 02:01 UTC, Bobby Kent
Details
hddtemp integration patch (8.36 KB, patch)
2013-03-06 01:53 UTC, Bobby Kent
Details
Using hddtemp from ksysguard (589 bytes, application/x-perl)
2014-09-22 22:05 UTC, dag
Details
attachment-24530-0.html (1.84 KB, text/html)
2014-09-23 09:05 UTC, Andy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ing. Jozef Sakalos 2003-05-05 21:43:55 UTC
Version:           1.2.0 (using KDE KDE 3.1.1a)
OS:          Linux

Most modern harddisks have a temperature sensor built-in. I'd like to have these temperatures to be measured/reported in ksysguard.
Comment 1 Greg Martyn 2006-05-25 19:53:39 UTC
Hmm.. instead of just using the sensors library, we might also want to query SMART
Comment 2 Michel Hermier 2006-12-09 20:08:49 UTC
Renamed the wish, since it's all about SMART data sensors.
Comment 3 Greg Martyn 2007-03-22 14:50:20 UTC
Google's drive survey suggests that SMART data is not that useful
Comment 4 John Tapsell 2007-03-24 13:09:00 UTC
This is non trivial.  We can't easily get SMART data as root.

Comment 5 Andy 2007-03-31 12:45:07 UTC
This is *very* trivial

smartctl /dev/sda -a -d ata | grep "^194"
194 Temperature_Celsius     0x0032   253   253   000    Old_age   Always       -       51

Tells you this drive is running a bit hot at 51 degrees celsius
Comment 6 Greg Martyn 2007-03-31 18:34:58 UTC
That assumes that the drive is sata, and doesn't work on my scsi system. Also, your output is very different from mine:

[root@gmartynstudent-2 ~]# smartctl /dev/sda -a | grep "Temperature"
Temperature Warning Enabled
Current Drive Temperature:     57 C
Drive Trip Temperature:        65 C

Comment 7 Andy 2007-03-31 18:40:57 UTC
I know this duplicates another bug, but it is related to this one as well:

How about a ksysguard module where you can add new sensors. More then happy to do this in an xml file, as for the applet.

Example

<sensor name="My custom sensor" group="harddisk" type="float" min="0" max="100" alarm="55" cmd="/usr/bin/my_custom_sensor_command" />
Comment 8 John Tapsell 2007-04-26 20:32:07 UTC
Andy,

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

Smartctl open device: /dev/sda failed: Permission denied


We can't open it as non-root.  We'd need a setuid program etc
Comment 9 Andy 2007-04-26 22:31:28 UTC
How about the external command then, so that users can add custom sensors, like in the example I gave above.
Comment 10 Greg Martyn 2007-04-26 23:28:02 UTC
that would be a dupe of bug #127801
Comment 11 Greg Martyn 2007-04-26 23:36:58 UTC
We don't need a suid binary necessarily -- there is already info that is available when run as root that isn't available as a user (logfiles come to mind).

The thing that's really stopping the implementation of this is the Google study that found the SMART data to be worthless. If anyone has more information, or a different interpretation of the Google results, then please speak up. I'll leave this at low priority and might get around to it some day.
Comment 12 bruce.lilly 2008-09-03 05:54:08 UTC
this should be trivial; example:
hddtemp /dev/sda
/dev/sda: WDC WD1600BB-22RDA0: 32°C

hddtemp can also run as a daemon, with data available via TCP at a specified port:
# ps -elf | grep -i hddtemp
1 S root      7117     1  0  80   0 -   686 select 23:18 ?        00:00:00 hddtemp -d -f /etc/hddtemp.db -p 7634 /dev/sda
# netcat localhost 7634
|/dev/sda|WDC WD1600BB-22RDA0|32|C|wally.blilly.net:/root

hddtemp is hosted at
https://savannah.nongnu.org/projects/hddtemp/

hddtemp is included in openSuSE, and as there are RPM and Debian packages available, it should be present in most Linux distributions

As for the Google study, claiming that it "found the SMART data to be worthless" is an exaggeration and an oversimplification.  In particular, temperature indication is far from "worthless".

Regardless of the value of temperature data for the hard drive per se, in many systems (i.e. those lacking mother board temperature sensors) the drive's SMART sensor may be the only available indication of computer internal temperature; the eMachines W3503 system that I'm typing this on is one example.
Comment 13 John Tapsell 2008-09-03 10:59:56 UTC
Bruce,  it looks good - but again - we can't get the data as a non-root user.  You can run it attached to a TCP port, but it's going to be a fair amount of work to get this to work nicely for the user.  We would have to ask for a root password to launch hddparm etc.
Comment 14 bruce.lilly 2008-09-06 09:04:24 UTC
John,

Several corrections/comments:

1. as hddtemp is suid root, any user can use it to get data
[on openSuSE 11.0]:
# ls -l $(whence hddtemp)
-rwsr-sr-x 1 root root 86543 Sep  8  2007 /usr/sbin/hddtemp

2. hddtemp (like other daemons) is started (as root) by rc/init; any user can read the daemon's TCP port

3. on openSuSE, setting up hddtemp is trivial (modulo the distribution changing between hda and sda for hard drive designations...) via /etc/sysconfig
Comment 15 bruce.lilly 2008-09-14 18:11:58 UTC
FWIW, Kima(http://kde-apps.org/content/show.php/Kima+-+kicker+monitoring+applet?content=33257)
queries the hddtemp daemon if running (maybe there's some stealable code there...)
Comment 16 bruce.lilly 2010-09-09 22:08:57 UTC
switched to GNOME
Comment 17 loremdaijoh 2011-03-30 12:04:02 UTC
Well, that is sad. I was just planning the opposite and found Ksysgurad to match my needs quite nicely. Except that the hddtemp readings would be really welcomed addition.

And as already stated by bruce, it should be quite possible to add the hddtemp readings without any need to ask for root password. Just make the assumption that the user has installed the hddtemp and the daemon is already running. All the necessary information about the available hard disks are in the return value from the daemon, e.g.

|/dev/sda|SAMSUNG SP1614C|33|C||/dev/sdb|SAMSUNG SP1614C|35|C|

One thing that might require user to configure the Ksysguard is the hddtempd port, but only if the user has decided to alter it in the first place. You could of course just not support that and require the port 7634.
Comment 18 Bobby Kent 2013-03-03 02:01:48 UTC
Created attachment 77704 [details]
hddtemp integration patch

Found Maurizio Monge's patch for integrating hddtemp into ksysguard here: http://lists.kde.org/?l=kde-devel&m=110701672111263.  Updated Maurizio's patch for KDE 4.9.5 and removed the nvidia pieces, and tried it out.  I suspect it needs a little bit of clean up, for instance by adding a hddtemp use flag on it, and some conditionals based on that around some of the code, though I hope it's a useful starting point ...
Comment 19 Bobby Kent 2013-03-06 01:53:49 UTC
Created attachment 77789 [details]
hddtemp integration patch

Updated patch with correct number of lines in smart.c
Comment 20 dag 2014-09-22 22:05:38 UTC
Created attachment 88796 [details]
Using hddtemp from ksysguard

I also needed to display disk drive temperatures in ksysguard and achieved it in the following way:

1. Install hddtemp
2. Make it SUID root if not already so
3. Download the perlscript I attached and make it executable
4. Go to "File"-> "Monitor remote machines"
5. Add something in the Host field, doesn't matter what
6. Select "Custom command"
7. Add the path to the script in "Command" and press Ok
8. Use the data and enjoy
Comment 21 Andy 2014-09-23 09:05:03 UTC
Created attachment 88802 [details]
attachment-24530-0.html

That is amazing!


Thank you so much :)

On 22 September 2014 23:05, <dag@newtech.fi> wrote:

> https://bugs.kde.org/show_bug.cgi?id=58154
>
> dag@newtech.fi changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |dag@newtech.fi
>
> --- Comment #20 from dag@newtech.fi ---
> Created attachment 88796 [details]
>   --> https://bugs.kde.org/attachment.cgi?id=88796&action=edit
> Using hddtemp from ksysguard
>
> I also needed to display disk drive temperatures in ksysguard and achieved
> it
> in the following way:
>
> 1. Install hddtemp
> 2. Make it SUID root if not already so
> 3. Download the perlscript I attached and make it executable
> 4. Go to "File"-> "Monitor remote machines"
> 5. Add something in the Host field, doesn't matter what
> 6. Select "Custom command"
> 7. Add the path to the script in "Command" and press Ok
> 8. Use the data and enjoy
>
> --
> You are receiving this mail because:
> You voted for the bug.
>
Comment 22 Christoph Cullmann 2024-09-23 21:01:06 UTC
ksysguard is no longer maintained, in Plasma 6 there is the Plasma system monitor for this task.

If your wish is still valid for the Plasma 6 replacement, please re-open and we can move this bug to the new product, thanks!