mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-14 19:03:13 +00:00
healthd.sh: Decrease the resource consumption by replacing the
external commands with the built-in bash commands. Contributed by vbooh.
This commit is contained in:
1 parent
266a45579c
commit
53d852c9b5
2 files changed
+8
-5
No files matched your search
@@ -10,6 +10,7 @@ SVN HEAD
|
||||
sensors: Add support for temperature min and critical min hysteresis
|
||||
fancontrol: Deal with moving hwmon attributes
|
||||
Fix shell error when FCFANS is not set
|
||||
healthd: Avoid using external commands
|
||||
sensors-detect: Add detection of ADC128D818
|
||||
Add detection of AMD family 16h Kabini and Mullins
|
||||
Add detection of ITE IT8620E and IT8623E
|
||||
|
||||
@@ -25,7 +25,8 @@ PATH="/bin:/usr/bin:/usr/local/bin:${PATH}"
|
||||
|
||||
ADMIN_EMAIL="root@localhost"
|
||||
|
||||
if [ -n "`sensors | grep ALARM`" ]
|
||||
sensors_state=$(sensors)
|
||||
if [[ "$sensors_state" =~ 'ALARM' ]]
|
||||
then
|
||||
echo "Pending Alarms on start up! Exiting!"
|
||||
exit
|
||||
@@ -33,10 +34,11 @@ fi
|
||||
|
||||
while true
|
||||
do
|
||||
sleep 15
|
||||
if [ -n "`sensors | grep ALARM`" ]
|
||||
read -t 15 -N 0
|
||||
sensors_state=$(sensors)
|
||||
if [[ "$sensors_state" =~ 'ALARM' ]]
|
||||
then
|
||||
sensors | mail -s "**** Hardware Health Warning ****" $ADMIN_EMAIL
|
||||
sleep 600
|
||||
echo "$sensors_state" | mail -s '**** Hardware Health Warning ****' $ADMIN_EMAIL
|
||||
read -t 600 -N 0
|
||||
fi
|
||||
done
|
||||
Reference in new issue
Block a user