Vous trouverez ci-dessous les quelques plugins que j'ai modifiés ou écrits de toute pièce pour ma configuration personnalisée de Munin.
Temperatures
#!/bin/sh
SENSORS=/usr/bin/sensors
HDDTEMP=/usr/sbin/hddtemp
DRIVES="hda hdc hdf hdh hdj hdl"
if [ "$1" = "config" ]; then
echo 'graph_title System temp °C'
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel temp in °C'
echo cpu0.label cpu0
echo cpu1.label cpu1
echo sys.label sys
for a in $DRIVES ; do echo $a.label $a ; done
exit 0
fi
CPU0=$($SENSORS | grep CPU | cut -d\ -f4)
CPU1=$($SENSORS | grep temp3 | cut -d\ -f6)
SYS=$($SENSORS | grep M/B | cut -d\ -f6)
echo "cpu0.value ${CPU0#+}"
echo "cpu1.value ${CPU1#+}"
echo "sys.value ${SYS#+}"
for a in $DRIVES ; do printf "$a.value " ; hddtemp -n /dev/$a; done
Ping
#!/bin/sh
HOSTS="gateway free.fr proxad.net wanadoo.fr tiscali.fr club-internet.fr"
if [ "$1" = "config" ]; then
echo "graph_title Ping response time"
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel time(ms)'
echo 'graph_scale no'
for label in $HOSTS;
do
echo "$(echo $label | sed 's/\./_/g').label $label"
done
exit 0
fi
for label in $HOSTS;
do
echo -n "$(echo $label | sed 's/\./_/g').value "
ping -nc1 $label &> /dev/null
if [ "$?" == 0 ]; then
ping -fnc3 $label | tail -n1 | cut -d/ -f4
else
echo
fi
done
Bandwidth
#!/bin/sh
if [ "$1" = "config" ]; then
echo "graph_title Available download bandwidth"
echo 'graph_args --base 1000 -l 0'
echo 'graph_vlabel KB/s'
echo 'graph_scale no'
echo "download.label download"
exit 0
fi
echo -n "download.value "
wget -O /dev/null --passive-ftp\
ftp://ftp.free.fr/pub/linux/kernel/v1.0/linux-1.0.patch.pl15.gz 2>&1\
| grep KB/s | tail -n 1 | cut -d\( -f2 |
cut -d\ -f1