diff --git a/plugins/rpi/cpu_freq_1sec b/plugins/rpi/cpu_freq_1sec new file mode 100755 index 00000000..44e01214 --- /dev/null +++ b/plugins/rpi/cpu_freq_1sec @@ -0,0 +1,57 @@ +#! /bin/sh +# +# This is a small supersampling plugin that does +# cpu sampling every 1 second. +# +# (c) 2013 - LGPL - Steve Schnepp + +pluginfull="$0" # full name of plugin +plugin="${0##*/}" # name of plugin +pidfile="$MUNIN_PLUGSTATE/munin.$plugin.pid" +cache="$MUNIN_PLUGSTATE/munin.$plugin.value" + + +if [ ! -r "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" ] +then + echo "# Cannot read CPU Freq" + exit 1 +fi + +if [ "$1" = "acquire" ] +then + ( + while sleep 1 + do + echo $( + date +%s + cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq + ) + done | awk "{ + print \"scaling_cur_freq.value \" \$1 \":\" (\$2 * 1000); + system(\"\"); + }" >> $cache + ) & + echo $! > $pidfile + exit 0 +fi + + +if [ "$1" = "config" ] +then + cat < ${cache} + +exit 0 diff --git a/plugins/rpi/rpi_temp b/plugins/rpi/rpi_temp new file mode 100755 index 00000000..8eff2283 --- /dev/null +++ b/plugins/rpi/rpi_temp @@ -0,0 +1,33 @@ +#! /bin/sh +# (c) 2013 - LGPL - Steve Schnepp + +pluginfull="$0" # full name of plugin +plugin="${0##*/}" # name of plugin +pidfile="$MUNIN_PLUGSTATE/munin.$plugin.pid" +cache="$MUNIN_PLUGSTATE/munin.$plugin.value" + + +if [ ! -r "/sys/class/thermal/thermal_zone0/temp" ] +then + echo "# Cannot read CPU Temp" + exit 1 +fi + + +if [ "$1" = "config" ] +then + cat <