Graphing Micromiser with Munin
- Jan 20, 2010 by the_angry_angel
I've been playing with Micromiser for a few days, and wanted to graph what it claims to be saving on one of the servers. Luckily this is pretty easy with Munin (which is already running on the box), since Micromiser logs into syslog occasionally. Below is the plugin I hacked together that looks at syslog and uses sed to extract the percentage saving. It's not pretty, but it does work.
Perhaps this'll save you a few minutes.
#!/bin/sh
# Plugin to graph the savings made by micromiser
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Micromiser Savings (percentage)'
echo 'graph_args --upper-limit 100 -l 0'
echo 'graph_vlabel savings'
echo 'graph_category system'
echo 'savings.label savings'
echo 'savings.draw AREA'
echo 'savings.min 0'
exit 0
fi
RES=`grep Estimated /var/log/syslog | tail -1 | sed 's/.*(\([0-9\.]*\)%)$/\1/'`
echo -n "savings.value $RES"




Comments
Yerrrrr and .... ?
Does it really do anything ?
So far it's claiming to be saving an average of 13.5% of the power the server would otherwise be using. Normally I'd shout this out as bollocks, but the graph does drop to 0 or near 0 savings during heavy periods, such as backup time, etc.