2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Initial version

This commit is contained in:
Armin Haaf 2007-11-04 21:16:34 +01:00 committed by Steve Schnepp
parent e5fccd49e8
commit d3c35fc0b2

45
plugins/other/cpuspeed2 Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
#
# Munin-plugin to monitor the cpu speeds of all available cpus
#
# Armin Haaf, 4-11-2007
# Licensed under: GNU GPL
MAX_CORES=1024
if [ "$1" = "config" ]; then
echo "graph_title CPU speed"
echo 'graph_category system'
echo "graph_info This graph shows the cpu-speed for each core, as reported by the kernel"
i=0
while [ $i -lt $MAX_CORES ]
do
MODEL=`cat /proc/cpuinfo | grep -A 6 "processor.*:.*$i" | grep "model name"`
if [ $? -ne 0 ]
then
break
fi
MODEL=`echo $MODEL | cut -c 12-`
echo "core$i.label Core $i speed in MHz"
echo "core$i.info Core $i speed in MHz $MODEL"
echo "core$i.type GAUGE"
i=$[$i+1]
done
exit 0
fi
i=0
while true
do
cat /proc/cpuinfo | grep -A 6 "processor.*:.*$i" > /dev/null
if [ $? -ne 0 ]
then
break
fi
echo -n "core$i.value "
cat /proc/cpuinfo | grep -A 6 "processor.*:.*$i" | grep "cpu MHz" | cut -c 12- | cut -f 1 -d .
i=$[$i+1]
done