From 0bad4f05aeabc7ea63f91fbcebdc0a0bd5350669 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sun, 16 Jun 2013 22:31:44 +0200 Subject: [PATCH] =?UTF-8?q?[munin/plugins]=20Ajout=20d'un=20plugins=20pour?= =?UTF-8?q?=20la=20temp=C3=A9rature=20de=20tous=20les=20cores?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- munin/coretemp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 munin/coretemp diff --git a/munin/coretemp b/munin/coretemp new file mode 100755 index 00000000..4768883a --- /dev/null +++ b/munin/coretemp @@ -0,0 +1,39 @@ +#!/bin/bash + +declare -a core; +declare -a tmp; +i=0 +for line in `sensors -A | grep -o "Core \([0-9]*\): *+\([0-9.]*\)" | sed 's/ /_/g'`; do + core[$i]=${line%%:*} + temp[$i]=${line##*+} + i=$(($i+1)) +done +iterator=`seq 0 $((${#temp[*]}-1))`; + +. $MUNIN_LIBDIR/plugins/plugin.sh + +if [ "$1" = "autoconf" ]; then + echo yes + exit 0 +fi + +# If run with the "config"-parameter, give out information on how the +# graphs should look. + +if [ "$1" = "config" ]; then + + # The host name this plugin is for. (Can be overridden to have + # one machine answer for several) + + # The title of the graph + echo 'graph_title Core Temperature' + echo 'graph_category temperature' + for i in $iterator; do + echo "${core[$i]:1}.label ${core[$i]/_/ }" + done + exit 0 +fi + +for i in $iterator; do + echo "${core[$i]:1}.value ${temp[$i]}" +done