How to get xfce4-sensors plugin to show HDD temperature in XFCE panel?

I had the same Problem after upgrading to 13.04.

I would prefer a non-dirty solution also.

But This bugreport didn't provide any clean solution either

At least: The mentioned dirty solution worked for me:

set suid bit to hddtemp:

$ sudo chmod u+s /usr/sbin/hddtemp

$ xfce4-sensors


An alternative would be running hddtemp as a daemon(eg. args: --listen=127.0.0.1 -dF) listening on some TCP port(default 7634) on localhost(or 127.0.0.1) and having xfce4-sensors-plugin query it on every refresh.

BUT, this only works if xfce4-sensors-plugin was compiled with --disable-netcat, otherwise(with --enable-netcat it instead attempts to execute hddtemp itself on every refresh! here's source code for my claims and I've also tested both ways (suid hddtemp and running hddtemp as daemon via a hddtemp.service).

Caveats:

  1. you have to specify all the HDD devices, that you want to monitor, when starting the hddtemp daemon.
    ie. sudo hddtemp --listen=127.0.0.1 -dF /dev/sda /dev/sdb /dev/sdc.
    Only the specified devices will be seen by xfce4-sensors-plugin.
  2. If any devices specified above(at point 1) aren't present, there will be a ? entry in xfce4-sensors-plugin which you can keep visible at all times until the device(s) are present. This may or may not be what you want. But with a suid hddtemp and enabled netcat, it will only list the HDD devices present currently, and probably(untested) won't automatically add new ones in the future, so you'll have to enter Properties and check/enable them yourself under Sensors type: Hard disks.
  3. xfce4-sensors-plugin (latest git for today 27 Sept.2018) will lookup localhost and connect(then disconnect) via TCP from the specified host/port on every refresh (eg. every 1 seconds if you have Update interval (seconds) set to 1) which means that you'll see(and I tested this) like 150 lines of TIME_WAIT in your netstat -pantuW command, so it will be hard to see anything else in there unless you pipe it through grep -v "127.0.0.1:7634.*TIME_WAIT" I suppose.

I'm keeping a gist up to date with any further information here