Monitor the Raspberry Pi cpu temperature and send an e-mail or shutdown in case it's too high.
-
Clone this repo to your Raspberry Pi using
https://github.com/MartinWagenbach/CoreTemp.git
. -
Go to your directory where you cloned the repo and install the requirements.
$ pip3 install -r requirements.txt
-
Edit the CoreTemp.ini.
-
Move the CoreTemp.ini to your config path.
$ cp CoreTemp.ini /etc/
- Let’s create a file called:
/etc/systemd/system/coretemp.service
[Unit]
Description=Monitor CPU temperatur with CoreTemp.py
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
Environment=HOME=/root/
Environment=PYTHONUNBUFFERED=1
ExecStart=/usr/local/share/CoreTemp/CoreTemp.py
[Install]
WantedBy=multi-user.target
- That’s it. We can now start the service:
$ systemctl start coretemp
- And automatically get it to start on boot:
$ systemctl enable coretemp
MartinWagenbach | Tikrass |
---|---|
github.com/MartinWagenbach |
github.com/tikrass |