Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 40 lines (31 sloc) 1.65 KB
# License:
# Copyright (C) 2018 Pavel Dmitriev <>
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see
# Synopsis:
# The script checks Raspberry PI CPU temperature
# and sends GUI notification to an administrator workstation
# if the temperature is higher than defined $THRESHOLD
# The temperature is present as NN.NNN °C integer without dot
# Requirements:
# 1. ssh login to an administrator workstation without password
# 2. KDE or libnotify-tools / libnotify-bin installed
# 1. Make this script as executable with chmod +x
# 2. Add script to crontab to execute every minute:
# */1 * * * * user /path/to/
TEMP=$(cat /sys/class/thermal/thermal_zone0/temp)
if [ "$TEMP" -gt "$THRESHOLD" ]; then
HTEMP=$(expr $TEMP / 1000)
if [ "$KDE" = "true" ]; then
ssh "$SSH_USER"@"$SSH_HOST" 'DISPLAY=:0 kdialog --passivepopup "Raspberry PI. High temperature! '"$HTEMP"'°C" 3600'
ssh "$SSH_USER"@"$SSH_HOST" 'notify-send -u critical -t 3600000 "Raspberry PI" "High temperature! '"$HTEMP"'°C"'