Temperature

Thanks for this awesome script. I've got it working but I've never used slack before. Is there some way to redirect the alerts via some sort of notification to an email address when the messages are posted in slack?

Edit: figured it out, thanks again for this script
Did you get this working with alerts via email?
Would you mind doing a small guide on how to set it up?
 
And, here's a bash version that installs temperature sensors information into the host gui. It automatically adds the information into files :)

https://github.com/Meliox/PVE-mods - pve-mod-gui-temp.sh

pve-mod-temp.png
 
And, here's a bash version that installs temperature sensors information into the host gui. It automatically adds the information into files :)

https://github.com/Meliox/PVE-mods - pve-mod-gui-temp.sh

pve-mod-temp.png
Nice for very small machines, won't work with a recent machines. Even the laptop currently sitting on my lap has 12 cores.

Has this been requested to be integrated? I haven't seen any feature requests yet.

It would be great if we would have a plugin infrastructure for official things or even unofficial ones. Playing around manually with js files on your server is not the way to go.
 
Hehe no. Can by adapted though. I do agree it's not user friendly anyhow though.

I have it seen requested, but given it is mostlikely a nice to have feature for only a limited amount of people, they have probably not looked into it.
 
Yes, some plugin integration would be nice. So often people want features but it won't be added because not many would use it and then it gets more confusing/overloaded for all the people not needing it. I for example need to run some scripts to orchestrate my PVE nodes and it would be really nice if we for example could add some custom buttons to the webUI so stuff can be triggered from the webUI instead of running scripts from the CLI all the time. But I guess plugin integrations would also make tech support and testing a pain with everyone running some custom stuff.
 
Last edited:
  • Like
Reactions: Docop2
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!
Thanks, this helped me a lot!
In combination with healthchecks.io, it's perfect for my home server.
 
Nice for very small machines, won't work with a recent machines. Even the laptop currently sitting on my lap has 12 cores.

Has this been requested to be integrated? I haven't seen any feature requests yet.

It would be great if we would have a plugin infrastructure for official things or even unofficial ones. Playing around manually with js files on your server is not the way to go.
I've had success in modifying the script like this to get only the Package temperature and manually selecting my NVMe drive name (further adjusment needed if you have more than 1 CPU and more than 1 NVMe drive)

git.png
 

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!