Help needed getting SSD temperature displayed

Forum rules
Before you post please read how to get help
Post Reply
User avatar
idle
Level 3
Level 3
Posts: 180
Joined: Tue Aug 18, 2015 8:25 am
Location: Aka-kabunga West

Help needed getting SSD temperature displayed

Post by idle » Wed Sep 12, 2018 6:28 am

I want to display HDD temperatures in Conky but I've hit a bit of a snag.

I followed this tutorial: https://forums.bunsenlabs.org/viewtopic.php?id=789 and I have a HDD 'sda' displaying the temperature. But that hard drive is my storage drive. My main hard drive is a SSD. I did some searching with the command lsblk and my SSD is called nvme0n1 which is the drive I want temperature displayed.

This is the area of code in Conky:

Code: Select all

${voffset 5}${font Freesans:size=16}${color3}TEMPS:${hr}
${voffset 5}${font}${color0}${goto 20}GPU1:  ${execi 5 nvidia-settings -t -q [gpu:0]/GPUCoreTemp} °C${goto 140}SDA:${goto 180}${hddtemp /dev/sda} °C${goto 240}SDB:${goto 280}${hddtemp /dev/sdb} °C
${goto 20}GPU2:  ${execi 5 nvidia-settings -t -q [gpu:1]/GPUCoreTemp} °C${goto 140}SDC:${goto 180}${hddtemp /dev/sdc} °C${goto 240}SDD:${goto 280}${hddtemp /dev/sdd} °C
What do I need to change/do to get my SDD to display temperature in Conky?

zcot
Level 2
Level 2
Posts: 62
Joined: Wed Oct 19, 2016 6:08 pm

Re: Help needed getting SSD temperature displayed

Post by zcot » Wed Sep 12, 2018 9:42 pm

If you have 2 drives, then you would want to address the area where it has SDA and SDB(and just remove the stuff for SDC and D from the next line.. same with dual GPU).

A single section of each drive has this format in the area: ${goto 140}SDA:${goto 180}${hddtemp /dev/sda} °C

if your case has your nvme drive(instead of sd drive) named as nvme0n1, then you would address it as /dev/nvme0n1. (of course you can just open a terminal and enter the command to see what happens: hddtemp /dev/nvme0n1 but maybe you need to sudo the command for testing like that?).

Who knows if you want to label it as SDA or SDB or maybe you want the label to say SSD?! :D

${goto 240}SSD:${goto 280}${hddtemp /dev/nvme0n1} °C

User avatar
idle
Level 3
Level 3
Posts: 180
Joined: Tue Aug 18, 2015 8:25 am
Location: Aka-kabunga West

Re: Help needed getting SSD temperature displayed

Post by idle » Thu Sep 13, 2018 1:35 am

Hey thanks for the help :D

I tried

Code: Select all

hddtemp /dev/nvme0n1
and got

Code: Select all

GT72-6QD ~ $ sudo hddtemp /dev/nvme0n1
ERROR: /dev/nvme0n1: can't determine bus type (or this bus type is unknown)

greywolf
Level 1
Level 1
Posts: 30
Joined: Thu Sep 19, 2013 7:20 pm

Re: Help needed getting SSD temperature displayed

Post by greywolf » Thu Sep 13, 2018 3:12 am

Try having a look through this page:

https://itpeernetwork.intel.com/finding ... -not-scsi/

Try the commands therein; may give you a clue what to look for.

greywolf.
It is about the Dragons - it was always about the Dragons!

User avatar
idle
Level 3
Level 3
Posts: 180
Joined: Tue Aug 18, 2015 8:25 am
Location: Aka-kabunga West

Re: Help needed getting SSD temperature displayed

Post by idle » Thu Sep 13, 2018 9:36 pm

I can't see anything related to temperature readouts, but thanks for the link, it has some interesting information.

zcot
Level 2
Level 2
Posts: 62
Joined: Wed Oct 19, 2016 6:08 pm

Re: Help needed getting SSD temperature displayed

Post by zcot » Thu Sep 13, 2018 10:54 pm

I did a little searching. It seems like hddtemp isn't going to be the right tool for that?

various articles are talking about using smartctl.

This user is doing something with an nvme tool: https://askubuntu.com/questions/1038701 ... 11#1038711

Keep us posted.

User avatar
idle
Level 3
Level 3
Posts: 180
Joined: Tue Aug 18, 2015 8:25 am
Location: Aka-kabunga West

Re: Help needed getting SSD temperature displayed

Post by idle » Thu Sep 13, 2018 11:19 pm

Yeah found that post yesterday and got the same readout using nvme-cli. It does display temperatures of the NVMe SSD but nothing I can find to translate that to work in Conky unfortunately. Even in his example (the .gif image he posted) there is no SSD temperature readout being displayed. The only readout Conky is displaying is NVMe Win 10 displaying the storage space.

Still a mystery ...

User avatar
smurphos
Level 7
Level 7
Posts: 1587
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Help needed getting SSD temperature displayed

Post by smurphos » Fri Sep 14, 2018 2:04 am

What output do you get from nvme smart-log /dev/nvme0n1?

If it includes the temperature you could isolate that output with grep e.g something like this - you'd probably need to fine tune the grep parameter.

nvme smart-log /dev/nvme0n1 | grep "^temperature"

User avatar
idle
Level 3
Level 3
Posts: 180
Joined: Tue Aug 18, 2015 8:25 am
Location: Aka-kabunga West

Re: Help needed getting SSD temperature displayed

Post by idle » Sat Sep 15, 2018 2:09 am

smurphos wrote:
Fri Sep 14, 2018 2:04 am
What output do you get from nvme smart-log /dev/nvme0n1?

If it includes the temperature you could isolate that output with grep e.g something like this - you'd probably need to fine tune the grep parameter.

nvme smart-log /dev/nvme0n1 | grep "^temperature"
That actually worked!

Code: Select all

GT72-6QD ~ $ sudo nvme smart-log /dev/nvme0n1 | grep "^t

Code: Select all

temperature: 35 C
How would I translate that into Conky code? Is there a line in Conky that it could be placed in to display the temperature?

User avatar
smurphos
Level 7
Level 7
Posts: 1587
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Help needed getting SSD temperature displayed

Post by smurphos » Sat Sep 15, 2018 2:34 am

idle wrote:
Sat Sep 15, 2018 2:09 am
How would I translate that into Conky code? Is there a line in Conky that it could be placed in to display the temperature?
You can try exec e.g ${exec nvme smart-log /dev/nvme0n1 | grep "^t"}

If it doesn't work - maybe because of the sudo requirement - another approach would be to use the root crontab (sudo crontab -e) to start a background script running as root to write the output of nvme smart-log /dev/nvme0n1 | grep "^t" to a text file somewhere on a regular basis and then in conky read that text file content using cat.

Example

sudo crontab -e to open the root crontab

Add the line with the correct path to the script

@reboot /path/to/SSDtemp,sh

Save.

The script would be something like this (as written writes the temp every 10 seconds to /tmp/SSDtemp)

Code: Select all

#!/bin/bash
while :
do
nvme smart-log /dev/nvme0n1 | grep "^t" > /tmp/SSDtemp
sleep 10
done 
Then in conky use ${exec cat /tmp/SSDtemp} to read the value in the text file.

User avatar
idle
Level 3
Level 3
Posts: 180
Joined: Tue Aug 18, 2015 8:25 am
Location: Aka-kabunga West

Re: Help needed getting SSD temperature displayed

Post by idle » Sun Sep 16, 2018 1:38 am

You really know your stuff. Okay I did as you suggested and it works, displaying the temperature, but the temperature doesn't fluctuate. I use the drive and it sits at a constant 35c. This has me baffled and I did some searching and the only thing I can come up with is this: (My readout)

Code: Select all

Smart Log for NVME device:nvme0n1 namespace-id:ffffffff
critical_warning                    : 0
temperature                         : 35 C
available_spare                     : 100%
available_spare_threshold           : 10%
percentage_used                     : 0%
data_units_read                     : 10,095,905
data_units_written                  : 17,494,164
host_read_commands                  : 81,638,034
host_write_commands                 : 142,198,348
controller_busy_time                : 811
power_cycles                        : 237
power_on_hours                      : 14,658
unsafe_shutdowns                    : 85
media_errors                        : 0
num_err_log_entries                 : 76
Warning Temperature Time            : 0
Critical Composite Temperature Time : 0
Temperature Sensor 1                : 0 C
Temperature Sensor 2                : 0 C
Temperature Sensor 3                : 0 C
Temperature Sensor 4                : 0 C
Temperature Sensor 5                : 0 C
Temperature Sensor 6                : 0 C
Temperature Sensor 7                : 0 C
Temperature Sensor 8                : 0 C
If you go to this link: https://askubuntu.com/questions/1038701 ... 11#1038711

You will see this guys readout is different than mine:

Code: Select all

Smart Log for NVME device:nvme0 namespace-id:ffffffff
critical_warning                    : 0
temperature                         : 35 C
available_spare                     : 100%
available_spare_threshold           : 10%
percentage_used                     : 0%
data_units_read                     : 9,328,609
data_units_written                  : 5,383,685
host_read_commands                  : 169,669,400
host_write_commands                 : 51,959,850
controller_busy_time                : 387
power_cycles                        : 568
power_on_hours                      : 401
unsafe_shutdowns                    : 77
media_errors                        : 0
num_err_log_entries                 : 216
Warning Temperature Time            : 0
Critical Composite Temperature Time : 0
Temperature Sensor 1                : 35 C
Temperature Sensor 2                : 41 C
Temperature Sensor 3                : 0 C
Temperature Sensor 4                : 0 C
Temperature Sensor 5                : 0 C
Temperature Sensor 6                : 0 C
Temperature Sensor 7                : 0 C
Temperature Sensor 8                : 0 C
His temperature Sensors 1 & 2 are reading 35c and 41c and mine are reading nothing. That's all I can come up with. Maybe the 35c is some default readout/display and the actual reading needs to come from sensors 1 through 8? Hence why there is no usage fluctuation in temperature?

User avatar
smurphos
Level 7
Level 7
Posts: 1587
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Help needed getting SSD temperature displayed

Post by smurphos » Sun Sep 16, 2018 1:55 am

Do you get any output including temperature info from smartctl e.g.

sudo smartctl -a /dev/nvme0n1

User avatar
idle
Level 3
Level 3
Posts: 180
Joined: Tue Aug 18, 2015 8:25 am
Location: Aka-kabunga West

Re: Help needed getting SSD temperature displayed

Post by idle » Sun Sep 16, 2018 10:15 am

Code: Select all

GT72-6QD ~ $ sudo smartctl -a /dev/nvme0n1
sudo: smartctl: command not found

Laurent85
Level 15
Level 15
Posts: 5695
Joined: Tue May 26, 2015 10:11 am

Re: Help needed getting SSD temperature displayed

Post by Laurent85 » Sun Sep 16, 2018 10:36 am

idle wrote:
Sun Sep 16, 2018 10:15 am

Code: Select all

sudo: smartctl: command not found
Install smartmontools and rerun the smartctl command:

Code: Select all

apt install smartmontools
sudo smartctl -a /dev/nvme0n1
Image

User avatar
idle
Level 3
Level 3
Posts: 180
Joined: Tue Aug 18, 2015 8:25 am
Location: Aka-kabunga West

Re: Help needed getting SSD temperature displayed

Post by idle » Sun Sep 16, 2018 11:38 am

Code: Select all

/dev/nvme0n1: Unable to detect device type
Please specify device type with the -d option.

Laurent85
Level 15
Level 15
Posts: 5695
Joined: Tue May 26, 2015 10:11 am

Re: Help needed getting SSD temperature displayed

Post by Laurent85 » Sun Sep 16, 2018 11:47 am

idle wrote:
Sun Sep 16, 2018 11:38 am

Code: Select all

Please specify device type with the -d option.
Try with the device type command option:

Code: Select all

sudo smartctl -d nvme -a /dev/nvme0n1
Image

User avatar
idle
Level 3
Level 3
Posts: 180
Joined: Tue Aug 18, 2015 8:25 am
Location: Aka-kabunga West

Re: Help needed getting SSD temperature displayed

Post by idle » Sun Sep 16, 2018 10:06 pm

Code: Select all

/dev/nvme0n1: Unknown device type 'nvme'

User avatar
smurphos
Level 7
Level 7
Posts: 1587
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Help needed getting SSD temperature displayed

Post by smurphos » Mon Sep 17, 2018 12:23 am

Give this a try - sudo smartctl --scan-open just to see if it can see the disc at all.

smartctl NVMe support is labelled as experimental but it should find something.

User avatar
idle
Level 3
Level 3
Posts: 180
Joined: Tue Aug 18, 2015 8:25 am
Location: Aka-kabunga West

Re: Help needed getting SSD temperature displayed

Post by idle » Mon Sep 17, 2018 1:35 am

Code: Select all

/dev/sda -d sat # /dev/sda [SAT], ATA device

User avatar
smurphos
Level 7
Level 7
Posts: 1587
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

Re: Help needed getting SSD temperature displayed

Post by smurphos » Mon Sep 17, 2018 1:52 am

OK scrap smartctl - it clearly isn't seeing your NVMe drive.

At this point I would be visiting the manufacturer's support site - checking to see if there is a firmware update available for the device, or if the manufacturer provides any device specific linux tools that you could use to get proper temperature outputs, or if other linux users are reporting issues getting drive stats via the command line. I'm assuming they have a support forum.

Post Reply

Return to “Compiz, Conky, Docks, & Widgets”