* update lm_sensors to 3.6.0

This commit is contained in:
Alexander Baldeck 2019-10-25 16:49:00 +02:00
parent d191193509
commit bb9fc17603
5 changed files with 91 additions and 3 deletions

View File

@ -3,11 +3,11 @@
# Contributor: Eric Bélanger
pkgname=lm_sensors
pkgver=3.5.0
pkgver=3.6.0
_pkgver=${pkgver//./-}
pkgrel=1
pkgdesc="Collection of user space tools for general SMBus access and hardware monitoring"
arch=('x86_64' 'powerpc64le')
arch=(x86_64 powerpc64le)
url="https://hwmon.wiki.kernel.org/lm_sensors"
license=('GPL' 'LGPL')
depends=('perl')
@ -16,7 +16,7 @@ optdepends=('rrdtool: for logging with sensord')
backup=('etc/sensors3.conf' 'etc/healthd.conf' 'etc/conf.d/sensord')
source=(https://github.com/lm-sensors/lm-sensors/archive/V${_pkgver}.tar.gz
healthd healthd.conf healthd.service sensord.conf)
sha256sums=('f671c1d63a4cd8581b3a4a775fd7864a740b15ad046fe92038bcff5c5134d7e0'
sha256sums=('0591f9fa0339f0d15e75326d0365871c2d4e2ed8aa1ff759b3a55d3734b7d197'
'0ac9afb2a9155dd74ab393756ed552cd542dde1081149beb2ab4ec7ff55b8f4a'
'5d17a366b175cf9cb4bb0115c030d4b8d91231546f713784a74935b6e533da9f'
'2638cd363e60f8d36bcac468f414a6ba29a1b5599f40fc651ca953858c8429d7'

53
lm_sensors/healthd Normal file
View File

@ -0,0 +1,53 @@
#!/bin/bash
#
# /usr/bin/healthd
#
. /etc/healthd.conf
cmd="${ALARM_CMD}"
addr="${ADMIN_EMAIL}"
slp="${ALARM_SLEEP}"
sensors="/usr/bin/sensors"
while [ $# -gt 0 ] ; do
case "${1}" in
-c ) cmd="${2}" ; shift 2 ;;
-m ) addr="${2}" ; shift 2 ;;
-s ) slp="${2}" ; shift 2 ;;
* ) shift 1 ;;
esac
done
case "${ALARM_RESET}" in
yes) /usr/bin/sensors > /dev/null
;;
no) true
;;
esac
[ -n "${cmd}" ] && [ -n "$( which -- "${cmd%% *}" )" ] || \
[ -n "${addr}" ] || exit 1
[ "${slp}" -ge 2 ] || slp=600
while true ; do
sleep 15
message="$( $sensors )"
case "$message" in
'' ) message='Could not get any sensor values !' ;;
*ALARM* ) : ;;
* ) message='' ;;
esac
if [ -n "$message" ]; then
if [ -n "${addr}" ]; then
echo "$message" | mail -s \
"Sensors ALARM detected at host: $( hostname )" \
"${addr}"
fi
[ -z "${cmd}" ] || ${cmd} &
sleep ${slp}
fi
done &

17
lm_sensors/healthd.conf Normal file
View File

@ -0,0 +1,17 @@
#
# /etc/healthd.conf
#
# reset any pending alarms on startup
ALARM_RESET="yes"
# where to sent mails on alarm
ADMIN_EMAIL="root"
# Seconds to sleep when alarm detected before checking again
# If you want to fill up your mail inbox set this to 2. ;-)
ALARM_SLEEP=600
# command to run in background on each alarm
# N.B.: If you choose to use the beep command, you'll need to install it: pacman -S beep
ALARM_CMD="beep -f 800 -l 500 -d 500 -r 600"

View File

@ -0,0 +1,9 @@
[Unit]
Description=A daemon which can be used to alert you in the event of a hardware health monitoring alarm
[Service]
Type=forking
ExecStart=/usr/bin/healthd
[Install]
WantedBy=multi-user.target

9
lm_sensors/sensord.conf Normal file
View File

@ -0,0 +1,9 @@
#
# /etc/conf.d/sensord
#
#Specify the interval between scanning for sensor alarms
INTERVAL=60s
#Specify the interval between logging all sensor readings
LOG_INTERVAL=30m