With a little DuckDuckGo magic I was even able to monitor the GPU temperature on my Raspi.
And I adjusted settings a bit so I can login from a remote machine:
pi@ph5b:~ $ sudo nano /etc/monit/monitrc
[..]
set mailserver localhost
set alert my@mail.address not on { instance, action }
set httpd port 2812 and
use address 0.0.0.0
allow 0.0.0.0/0.0.0.0
allow admin:monit
We need a script for this:
pi@ph5b:~ $ sudo mkdir /etc/monit/scripts
pi@ph5b:~ $
pi@ph5b:~ $ sudo nano /etc/monit/scripts/cputemp.sh
#!/bin/sh
CPUTEMP=$(vcgencmd measure_temp | sed "s/temp=//; s/\..'C//")
exit $CPUTEMP
pi@ph5b:~ $ sudo chmod +x /etc/monit/scripts/cputemp.sh
pi@ph5b:~ $
pi@ph5b:~ $ /etc/monit/scripts/cputemp.sh; echo $?
49
A nice separate config file for monit
:
pi@ph5b:~ $ sudo nano /etc/monit/conf-available/cputemp
check program CPU-temp with path "/etc/monit/scripts/cputemp.sh"
if status > 45 then alert
Symlink in the enabled
folder:
pi@ph5b:~ $ sudo ln -s /etc/monit/conf-available/cputemp /etc/monit/conf-enabled/
pi@ph5b:~ $
Activate changes:
pi@ph5b:~ $ sudo monit reload
Reinitializing monit daemon
And soon after:
pi@ph5b:~ $ tail -F /var/log/monit.log
[..]
[2022-09-11T15:48:23+0200] error : 'CPU-temp' status failed (49) -- no output
pi@ph5b:~ $ sudo monit status CPU-temp
Monit 5.27.2 uptime: 30m
Program 'CPU-temp'
status Status failed
monitoring status Monitored
monitoring mode active
on reboot start
last exit value 49
last output -
data collected Sun, 11 Sep 2022 15:48:23
A mail in my inbox:
Subject : monit alert -- Status failed CPU-temp
Sender : monit@ph5b.home.dehakkelaar.nl
Recipient: my@mail.adress
Date : Today 15:48
Status failed Service CPU-temp
Date: Sun, 11 Sep 2022 15:44:33
Action: alert
Host: ph5b
Description: status failed (49) -- no output
Your faithful employee,
Monit
And webGUI status:
It keeps mailing me every 4 minutes or so tough
But I am able to disable monitoring temperatures via the webGUI.
And oc I changed the temperature threshold to a sensible 80'C.
I believe a Raspi starts throttling the CPU/GPU clock at about 90'C ... ish.
It took me little over 30 minutes ... ish
EDIT: Ow the mailing stopped ... pew.