Plugin pour analyser les temps de traitement de munin.

Le plugin n'est pas synthtique du tout pour le moment.

darcs-hash:20070921054720-72cb0-c33a570f602dbeb8869009d3d4178091ea51bc34.gz
This commit is contained in:
salles 2007-09-21 07:47:20 +02:00
parent 8a217d7188
commit 8986bbf60b

51
munin/munin Executable file
View file

@ -0,0 +1,51 @@
#!/bin/sh
if [ "$1" = "config" ]; then
echo 'graph_category system'
echo 'graph_title Munin'
echo 'graph_args --base 1000 --lower-limit 0'
echo 'graph_vlabel Temps de traitement (s)'
echo 'update.label update'
echo 'update.draw AREA'
echo 'limits.label limits'
echo 'limits.draw STACK'
echo 'graph.label graph'
echo 'graph.draw STACK'
echo 'html.label html'
echo 'html.draw STACK'
echo 'total.label Total'
exit 0
fi
LOGDIR="/var/log/munin/"
LOGBASE=$LOGDIR"munin-"
# Munin-update
echo -n "update.value "
time_update=$(grep -i finished $LOGBASE"update.log" | tail -n 1 | awk -F '(' '{print $2}' | awk '{print $1}' | bc -l)
echo $time_update
begin_limits=$(grep -i finished /var/log/munin/munin-update.log | tail -n 1 | awk '{print "date -d \""$1" "$2" "$3"\" +%s"}' | sh)
# Munin-limits
echo -n "limits.value "
end_limits=$(grep -i finished $LOGBASE"limits.log" | tail -n 1 | awk '{print "date -d \""$1" "$2" "$3"\" +%s"}' | sh)
time_limits=$(echo $end_limits"-"$begin_limits | bc -l)
echo $time_limits
# Munin-graph
echo -n "graph.value "
time_graph=$(grep -i finished $LOGBASE"graph.log" | tail -n 1 | awk -F '(' '{print $2}' | awk '{print $1}' | bc -l)
echo $time_graph
begin_html=$(grep -i finished /var/log/munin/munin-graph.log | tail -n 1 | awk '{print "date -d \""$1" "$2" "$3"\" +%s"}' | sh)
# Munin-html
echo -n "html.value "
end_html=$(grep -i finished $LOGBASE"html.log" | tail -n 1 | awk '{print "date -d \""$1" "$2" "$3"\" +%s"}' | sh)
time_html=$(echo $end_html"-"$begin_html | bc -l)
echo $time_html
echo -n "total.value "
echo $time_update"+"$time_limits"+"$time_graph"+"$time_html | bc -l