mirror of
https://github.com/shakemid/pcsensor-temper.git
synced 2025-01-22 01:28:16 +01:00
Fix munin-plugin to configure cdef
This commit is contained in:
parent
380f242cc1
commit
0cb7b00c2b
1 changed files with 9 additions and 5 deletions
|
@ -3,13 +3,17 @@
|
||||||
|
|
||||||
# Munin plugin for TEMPer
|
# Munin plugin for TEMPer
|
||||||
|
|
||||||
. $MUNIN_LIBDIR/plugins/plugin.sh
|
. "${MUNIN_LIBDIR}/plugins/plugin.sh"
|
||||||
|
|
||||||
|
set -o nounset
|
||||||
|
|
||||||
pcsensor=${pcsensor:-/usr/local/bin/pcsensor}
|
pcsensor=${pcsensor:-/usr/local/bin/pcsensor}
|
||||||
pcsensor_opts="-m -c"
|
pcsensor_cmd="${pcsensor} -m -c"
|
||||||
|
|
||||||
# need calibration
|
# need calibration
|
||||||
cdef='temperature,1.0287,*,0.85,-'
|
# example:
|
||||||
|
# env.cdef temperature,1.0287,*,0.85,-
|
||||||
|
cdef=${cdef:-temperature}
|
||||||
|
|
||||||
autoconf() {
|
autoconf() {
|
||||||
echo 'no'
|
echo 'no'
|
||||||
|
@ -24,13 +28,13 @@ graph_scale no
|
||||||
graph_vlabel Temp C
|
graph_vlabel Temp C
|
||||||
graph_args --base 1000
|
graph_args --base 1000
|
||||||
temperature.label temperature
|
temperature.label temperature
|
||||||
temperature.cdef $cdef
|
temperature.cdef ${cdef}
|
||||||
EOF
|
EOF
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch() {
|
fetch() {
|
||||||
value=$( $pcsensor $pcsensor_opts | sed -n '1p' )
|
value=$( $pcsensor_cmd | sed -n '1p' )
|
||||||
echo "temperature.value ${value}"
|
echo "temperature.value ${value}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue