[munin/plugins] Ajout d'un plugins pour la température de tous les cores
This commit is contained in:
parent
e10540c62e
commit
0bad4f05ae
1 changed files with 39 additions and 0 deletions
39
munin/coretemp
Executable file
39
munin/coretemp
Executable file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue