[arm-allstar] cpu_temp.sh ?

Luc Drolet VE2LUQ ldrolet at cgocable.ca
Fri Apr 12 19:50:15 EDT 2024


Hello everyone,

I have one of my repeaters that the temperature has reached 52 C
and I did not receive an E-Mail to notify me?

the other tools work very well
I may receive door openings or “power outages”.

but for the CPU_TEMP I receive nothing

Is it possible that there have been changes?

how to get it working again with the heat coming soon

thank you and good evening

/etc/asterisk/local/cpu_temp.sh



#!/bin/bash
#
# EXAMPLE Script pour envoyé des  email ou des  SMS si
# CPU temperature depase la temperature  maximum.
# The ssmtp package must be installed and configured

#  3/2019

# Maximum CPU Temperature in Degrees C
MAXTEMP="45"

# Destination SMS number and address – CHANGE THIS!

RECEIVER="ldrolet at cgocable.ca"


# How often to alert if temperature is exceeded - Default 30 Minutes
ALERT_INTERVAL="30m"

function send_mail_warning() {
echo -e "Subject: ATTENTION CPU Haute Temp\nTo: $RECEIVER\n\nATTENTION Temperature du CPU
$CTEMP C au site du $HOSTNAME" | sendmail -t
}

function send_mail_OK() {
echo -e "Subject: CPU Temp est OK\nTo: $RECEIVER\n\nCPU Temperature OK 
$CTEMP C au site du $HOSTNAME" | sendmail -t
}

while :
do
PTEMP=`cat /sys/class/thermal/thermal_zone0/temp`
CTEMP=`expr $PTEMP / 1000`
echo -n $CTEMP
echo -n "C / "
FTEMP=`expr 9 '*' $CTEMP / 5 + 32`
echo -n "$FTEMP"
echo "F"
if [ $CTEMP -gt $MAXTEMP ]
 then
 echo "Sending temperature warning message - CPU $CTEMP C"
 send_mail_warning
 while [ $CTEMP -gt $MAXTEMP ]
 do
 sleep $ALERT_INTERVAL


PTEMP=`cat /sys/class/thermal/thermal_zone0/temp`
CTEMP=`expr $PTEMP / 1000`


 if [ $CTEMP -le $MAXTEMP ]
 then
 echo "CPU Temperature Normal $CTEMP C"
 send_mail_OK

 break
 else
 echo "Sending temperature warning message - CPU $CTEMP C"
 send_mail_warning
 fi
 done
fi
sleep 30
done




Luc Drolet VE2 LUQ
Président de VE2CVA
C.R.A.V.A.
Club Radio Amateur Vallée de l'Amiante
VE2 CVA
ve2cva at gmail.com
ldrolet at cgocable.ca
https://clubs.raqi.ca/ve2cva/
https://www.facebook.com/groups/ve2cva
Instagram : https://www.instagram.com/ve2cva/
Echolink =   VE2RVA-R    NODE #24560
Sécurité Civil du Québec, Node #1400










More information about the ARM-allstar mailing list