From 8986bbf60b286d088ab8f7937ceb0b61a6c41480 Mon Sep 17 00:00:00 2001 From: salles Date: Fri, 21 Sep 2007 07:47:20 +0200 Subject: [PATCH] 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 --- munin/munin | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 munin/munin diff --git a/munin/munin b/munin/munin new file mode 100755 index 00000000..0c0bb37b --- /dev/null +++ b/munin/munin @@ -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 \ No newline at end of file