mirror of
https://github.com/shakemid/pcsensor-temper.git
synced 2025-01-22 01:28:16 +01:00
Add munin plugin
This commit is contained in:
parent
8ccd2b1f47
commit
458713fcbe
1 changed files with 51 additions and 0 deletions
51
munin-plugin/temper
Executable file
51
munin-plugin/temper
Executable file
|
@ -0,0 +1,51 @@
|
||||||
|
#!/bin/bash
|
||||||
|
# -*- sh -*-
|
||||||
|
|
||||||
|
# Munin plugin for TEMPer
|
||||||
|
|
||||||
|
. $MUNIN_LIBDIR/plugins/plugin.sh
|
||||||
|
|
||||||
|
pcsensor=${pcsensor:-/usr/local/bin/pcsensor}
|
||||||
|
pcsensor_opts="-m -c"
|
||||||
|
|
||||||
|
# need calibration
|
||||||
|
cdef='temperature,1.0287,*,0.85,-'
|
||||||
|
|
||||||
|
autoconf() {
|
||||||
|
echo 'no'
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
config() {
|
||||||
|
cat <<EOF
|
||||||
|
graph_title Temperature
|
||||||
|
graph_category sensors
|
||||||
|
graph_scale no
|
||||||
|
graph_vlabel Temp C
|
||||||
|
graph_args --base 1000
|
||||||
|
temperature.label temperature
|
||||||
|
temperature.cdef $cdef
|
||||||
|
EOF
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
fetch() {
|
||||||
|
value=$( $pcsensor $pcsensor_opts | sed -n '1p' )
|
||||||
|
echo "temperature.value ${value}"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Main
|
||||||
|
case ${1:-} in
|
||||||
|
autoconf)
|
||||||
|
autoconf
|
||||||
|
;;
|
||||||
|
config)
|
||||||
|
config
|
||||||
|
[ "${MUNIN_CAP_DIRTYCONFIG:-}" = "1" ] && fetch
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
fetch
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Add table
Reference in a new issue