Temperature

I had an idea for an alternate method of getting the temp in the GUI (at least updated for the latest minute) and it seems to be working fine so far, but i'm new to PVE so what I'm doing may not be a great idea in the long run, I guess time will tell. Anyway.. I thought of using the node's Note section for a quick look at my temp.

in my example, my node is called "PVE" so the location of the notes is in the "config" file in /etc/pve/nodes/{nodename}/ or in my case "/etc/pve/nodes/pve/config"

I installed and ran the detect for lm-sensors: "apt-get install lm-sensors" then "sensors-detect"
then running "sensors" at shell gives me the temps.

I added a note to my node and saw that it was prefixed by a # in the config file so I added a cron job to run every minute as so:
* * * * * echo "#$(sensors | grep "Package")" > /etc/pve/nodes/pve/config

now every minute my node notes get updated with my current temp. I can quickly click on notes to see current temp (well as at last minute).

this wont work for everyone as I don't know what else might be in that file and I'm essentially replacing the whole config file with my one line note but as mine didn't have anything else in it anyway it didn't matter to me. this is where I'm sure that some staff person will come in and advise against it in case you make a change that adds something else to the config file it will just be written out of the file within a minute and could cause issues etc etc.

try it in a non-prod environment. make sure there is nothing in your config file before doing it. if you don't have a config file then go to the notes and edit them add a single line "test" or something like it then check again. for my home setup this works.

-update-
Did a little more thinking and came up with a better command which should alleviate some of the problems discussed above.
now using this command in my cron job:
* * * * * sed -i "s/.*Package.*/#$(sensors | grep "Package")/g" /etc/pve/nodes/pve/config
this now only replaces the line that contains Package but this could be made more specific should I need (or someone else who decides to use this method) leaving any other comments or any other settings that might be in the file alone.
 
Last edited:
Here's a page showing how to hack CPU temperature (from lm-sensors) into the text at the top of the node summary page. Work isn't my own, but I've confirmed it works on PVE 7.1. Would be nice to have a graph, or some kind of flashing alarm when it exceeds threshold, but at least this puts it somewhere that I *might* notice.

https://www.programmerall.com/article/5981210525/
1662238861818.png
I was successful with 7.2-7. Thanks!
 
Last edited:
Interestingly enough, I just did a fresh install of `7.2-11` last week and I've already gotten email notifications about the NVMe temps.

I came to this thread wanting a convenient way to test cooling solutions while watching temps, not realizing that Proxmox's temp handling wasn't available... I just thought I wasn't seeing it in the UI.

Respect to whoever is working on it
 
Here's a page showing how to hack CPU temperature (from lm-sensors) into the text at the top of the node summary page. Work isn't my own, but I've confirmed it works on PVE 7.1. Would be nice to have a graph, or some kind of flashing alarm when it exceeds threshold, but at least this puts it somewhere that I *might* notice.

https://www.programmerall.com/article/5981210525/
Thanks! My homelab is a tiny closet and I might need to add a fan to cool my micro host. Now I can see temps and monitor. Would be awesome to have a dashboard widget graph!
 
  • Like
Reactions: lxiosjao and LeCaNo
I am a new proxmox user and really would love to see the sensors stats in the proxmox "Summary" page or anywhere. Remember you can overheat the CPU with even half CPU load with for example transcoding that not hardware offloaded. I just had this actually.
Yes, i know i can do stats on my own, hooking up sensors to Grafana or something but on the hypervisor it would be very useful.
 
Thanks! My homelab is a tiny closet and I might need to add a fan to cool my micro host. Now I can see temps and monitor. Would be awesome to have a dashboard widget graph!
I've implemented some scripts that collect host and disks temperatures and other info (via smartctl, nvme_cli and sensors tools) and upload them to influxdb2, in the same bucket where proxmox VE uploads metrics to the same influxdb2 server. As soon as I have a bit of time I'll upload the scripts and share an howto for people who like to have historical info about what's going on on their proxmox box ;-) I’ll attach my dashboard on Grafana.
 

Attachments

  • CA1E3C73-238D-4776-8E55-F5F6977C1968.jpeg
    CA1E3C73-238D-4776-8E55-F5F6977C1968.jpeg
    308.4 KB · Views: 199
Last edited:
I've implemented some scripts that collect host and disks temperatures and other info (via smartctl, nvme_cli and sensors tools) and upload them to influxdb2, in the same bucket where proxmox VE uploads metrics to the same influxdb2 server. As soon as I have a bit of time I'll upload the scripts and share an howto for people who like to have historical info about what's going on on their proxmox box ;-) I’ll attach my dashboard on Grafana.
As I've promised, here you are with my scripts that you can take as a starting point for monitoring temperatures and other stuff:
https://forum.proxmox.com/threads/integrating-influxdb2-data-with-temperature-and-disks-info.118615/

@evotek @templar @UdoB
 
  • Like
Reactions: evotek
Is there any way to show the temperature from the thermal sensor(s).
I agree status of hardware is important information
Temperature of hardware rates not far behind Ram usage and Disk usage in terms of node stability.
Showing devices with failed SMART status is similar.

Ideally this information would be shown together in the GUI summary page for each server (Ram usage, Disk usage, Temperate, SMART failures)

Graphs and email alerts would be nice at some time later but are really another level of enhancement. I would much prefer some basic functionality in this area rather than waiting for these extra options.

Hopefully this enhancement is implemented some time soon https://bugzilla.proxmox.com/show_bug.cgi?id=208
As this thread has had 48K views, I'm probably not alone.
 
Last edited:
  • Like
Reactions: templar
You can create a cronjob that runs a bash script which checks if something is over a certain temperature and calls back to a slack webhook:

Bash:
#! /bin/bash

# ©locknessKo 2022

# Slack incoming webhook URL
slack_url=https://hooks.slack.com/services/xxx/xxx/xxx

# Threshold for when to send alert
threshold=80

sensors | grep -e "temp1" | while read line; do
        temp=$(echo $line | awk -F "+" '{ print $2 }' | awk -F "." '{ print $1 }');
        if (( temp > $threshold )); then
                curl -X POST -H 'Content-type: application/json' --data "{'text':'ALERT for $(hostname). Temperature is $temp degrees'}" $slack_url;
        fi;
        done

The above code produces an output like this:
View attachment 33545

A guide on how to setup slack incoming webhook: https://api.slack.com/messaging/webhooks

How to use cronjobs: https://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/

Hope this helps!

Here are my 2 cents, since I'm WAY lazier than ©locknessKo, and you might already have a functioning mail sender in your proxmox, and my bash capabilities are almost non existent, here was my solution (which involved a ton of copy/paste/change from many, many places):

#!/bin/sh

PRINTF=/usr/bin/printf
MSMTP=/usr/bin/msmtp
MSMTPCONF=/etc/msmtprc
var="$(sensors -u | grep "input" | cut -b 16,17 | sed '1q;d')"
TEMP=$(echo "$var")

if [ "$TEMP" -ge "65" ]
then
# Send mail
FROM="something@yourproxmoxbox"
TO="your.personal@email.com"
SUBJECT="Temperature Alert"
BODY="Temperature in the server reached $TEMP degrees, some message with instructions for the receiver if it's not you"
$PRINTF "From:$FROM\nTo:$TO\nSubject:$SUBJECT\n\n$BODY" | $MSMTP --file=$MSMTPCONF -t
# Send another mail
FROM="something@yourproxmoxbox"
TO="your.colleage@your.job"
SUBJECT="Temperature Alert"
BODY="Temperature in the server reached $TEMP degrees, move your ass and go do something!"
$PRINTF "From:$FROM\nTo:$TO\nSubject:$SUBJECT\n\n$BODY" | $MSMTP --file=$MSMTPCONF -t
else
sleep 5
fi

I have a cron that runs the above script every 5 or 10 minutes depending on the server.
 

The JSON approach is a great idea, and gives us an opportunity to bring this on par with the existing PVE status items.

I iterated a bit on this and packaged my results at https://github.com/alexleigh/pve-mods

This includes both CPU and HDD temp probes, with current and max temperatures for the statuses which allows the bar visual to work. Also included are mods to the mobile site to show the node temperatures, and an auto-refresh on/off toggle on the mobile version (since the mobile version doesn't currently auto-refresh).
 
The JSON approach is a great idea, and gives us an opportunity to bring this on par with the existing PVE status items.

I iterated a bit on this and packaged my results at https://github.com/alexleigh/pve-mods

This includes both CPU and HDD temp probes, with current and max temperatures for the statuses which allows the bar visual to work. Also included are mods to the mobile site to show the node temperatures, and an auto-refresh on/off toggle on the mobile version (since the mobile version doesn't currently auto-refresh).
That looks great, I have something like that (simpler, less fancy) for my Nvidia GPU.

Added this to Nodes.pm
Perl:
$res->{GPUTemperature} = `nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader`;

And this to pvemanagerlib.js:
JavaScript:
{
            itemId: 'GPUTemperature',
            colspan: 2,
            printBar: false,
            title: gettext('GPU Temperature'),
            textField: 'GPUTemperature',
            renderer: function(value) {
                return `${value} ℃`;
            }
},
 
  • Like
Reactions: algebraictype

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!