You are not logged in.

#1 2011-08-08 08:35:56

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Can't get HDD temperature in conky

Hello!
I have hddtemp installed, SUID set, hddtemp service is up and running, hddtemp program gives me temperature of all HDDs but not in conky.

/dev/sdb: ${alignr}${hddtemp /dev/sdb}

This is part of the line from conky which shows N/A in output. Why? It works if I do

$ hddtemp /dev/sdb

Offline

#2 2011-08-08 08:40:41

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Can't get HDD temperature in conky

moving to Newbie Corner.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#3 2011-08-08 08:49:31

diegoauyon
Member
From: Guatemala
Registered: 2011-08-08
Posts: 14

Re: Can't get HDD temperature in conky

Actually I was suffering for the same problem. Conky (or hddtemp) doesn't have the privileges to  read the hard disks. If you use the hddtemp command you have to use sudo. Is the same with conky, it can't read the temperature so it just give you a blank space. Try running conky with sudo.

Offline

#4 2011-08-08 09:09:55

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: Can't get HDD temperature in conky

> Try running conky with sudo.

Didn't help, still "N/A". I guess that's not the problem since conky shows info about /dev/sda, both are HDDs.

Offline

#5 2011-08-08 09:13:27

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: Can't get HDD temperature in conky

and did you put /usr/sbin/hddtemp in your sudoers file and gave it NOPASSWD access??


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#6 2011-08-08 09:15:55

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: Can't get HDD temperature in conky

No, I set SUID.

# chmod +s `which hddtemp`

It's now

-rwsr-sr-x 1 root root 26740 Nov 12  2010 /usr/sbin/hddtemp

Offline

#7 2011-08-08 09:38:58

diegoauyon
Member
From: Guatemala
Registered: 2011-08-08
Posts: 14

Re: Can't get HDD temperature in conky

Offline

#8 2011-08-08 10:43:27

Mr. Alex
Member
Registered: 2010-08-26
Posts: 623

Re: Can't get HDD temperature in conky

I changed it this way:

/dev/sdb: ${alignr}${exec hddtemp /dev/sdb | cut -c 34-36} Celcius

Now it works except that it doesn't show the "Celcius" part. Just a number of degrees.

Tried

/dev/sdb: ${alignr}${exec hddtemp /dev/sdb | cut -c 34-36 ; echo 'Celcius'}

but this adds "Celcius" to new line and I need it right after the number. Any suggestion?

Last edited by Mr. Alex (2011-08-08 10:44:13)

Offline

#9 2011-08-11 23:49:48

jtkmt
Member
From: Japan
Registered: 2009-11-23
Posts: 14

Re: Can't get HDD temperature in conky

hddtemp watches only /dev/sda as default.
Edit /etc/conf.d/hddtemp as follows to add /dev/sdb:

DRIVES="/dev/sd[ab]"

Put this in .conkyrc:

${hddtemp /dev/sdb}°C

Above done, restart the daemon.

# rc.d restart hddtemp

Now you should get the temperature.
You don't need suid set.

Offline

Board footer

Powered by FluxBB