Commit 0bad4f05 authored by Valentin Samir's avatar Valentin Samir

[munin/plugins] Ajout d'un plugins pour la température de tous les cores

parent e10540c6
#!/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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment