mirror of
https://github.com/cmur2/munin-pcsensor.git
synced 2024-12-22 12:54:27 +01:00
Compensate periodic USB disconnects of TEMPer
This commit is contained in:
parent
71fd2c6c64
commit
abc7c11732
@ -5,6 +5,11 @@ Creates Munin graphs from the data delivered from an attached TEMPer USB Thermom
|
|||||||
For data collection the `pcsensor` utility is needed (by default it resides in */usr/local/bin/*), it can be obtained in source or binary form from different places like [here](https://github.com/jeroensteenhuis/pcsensor).
|
For data collection the `pcsensor` utility is needed (by default it resides in */usr/local/bin/*), it can be obtained in source or binary form from different places like [here](https://github.com/jeroensteenhuis/pcsensor).
|
||||||
Script was tested with pcsensor version 1.0.1.
|
Script was tested with pcsensor version 1.0.1.
|
||||||
|
|
||||||
|
"USB disconnect, device number X"
|
||||||
|
---------------------------------
|
||||||
|
|
||||||
|
If you are querying your TEMPerV1.4 device periodically every 5 minutes (I assume), it disconnects from USB bus every 85 minutes (or every ~17 queries) and is instantly reconnected and detected by the kernel. This script compensates this by a retry after a second after a failed invocation of `pcsensor`.
|
||||||
|
|
||||||
Install
|
Install
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
8
pcsensor
8
pcsensor
@ -18,6 +18,10 @@ if [ "${1}" = "config" ]; then
|
|||||||
echo "temp.label temperatue"
|
echo "temp.label temperatue"
|
||||||
echo "temp.type GAUGE"
|
echo "temp.type GAUGE"
|
||||||
else
|
else
|
||||||
echo -n "temp.value "
|
TEMP=`${PCSENSOR} -cm`
|
||||||
${PCSENSOR} -cm | head -n1
|
if [[ $? != 0 ]]; then
|
||||||
|
sleep 1
|
||||||
|
TEMP=`${PCSENSOR} -cm`
|
||||||
|
fi
|
||||||
|
echo "temp.value $TEMP"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user