From 60728f04cbffb48bc1a69d4a7eb5c39981c977ba Mon Sep 17 00:00:00 2001 From: Kenyon Ralph Date: Tue, 17 Apr 2012 10:49:48 -0700 Subject: [PATCH] untar mtr100_ plugin and move to network directory --- plugins/network/mtr100_ | 86 ++++++++++++++++++++++++++++++++++++++++ plugins/other/mtr100 | Bin 1117 -> 0 bytes 2 files changed, 86 insertions(+) create mode 100755 plugins/network/mtr100_ delete mode 100755 plugins/other/mtr100 diff --git a/plugins/network/mtr100_ b/plugins/network/mtr100_ new file mode 100755 index 00000000..96cbb494 --- /dev/null +++ b/plugins/network/mtr100_ @@ -0,0 +1,86 @@ +#!/bin/sh +# +# Plugin plotting the Percentage of time needed to reach each host on the way to a certain host +# Uses MTR http://www.bitwizard.nl/mtr/ to do the job +# +# Version: 1.0 +# Author: tobias.geiger@vido.info +# Please email me bugs/suggestions +# +# +# +# HINT: Needs a bigger TIMEOUT-Value than the default (10) in /etc/munin/plugin-conf.d/munin-node , +# e.g.: +# [mtr100_*] +# timeout 60 +# +# +# +# Parameters: +# +# config (required) +# autoconf (optional - only used by munin-config) +# +# Magic markers (optional - used by munin-config and some installation +# scripts): +#%# family=contrib +#%# capabilities=autoconf + +totrace=`basename $0 | sed 's/^mtr100_//g'` + +if [ "$1" = "autoconf" ]; then + if ( mtr -nrc 1 localhost 2>/dev/null >/dev/null ); then + echo yes + exit 0 + else + if [ $? -eq 127 ] + then + echo "no (mtr program not found - install the mtr(-tiny) package)" + exit 1 + else + echo no + exit 1 + fi + fi +exit 0 +fi + +dotrace() { + +LC_ALL=C mtr -nrs 1024 -c 10 $totrace | grep -v "^HOST:" | LC_ALL=C awk -v C=$1 ' { + +label=$2 +x=gsub("\\.","_",label) + +count=NR +lab[count]=count +name[count]=$2 +val[count]=$6 +total+=$6 +} + +END { + for (x=1; x<=count; x++) { + value=(val[x]/total)*100 + if ( C != "config" ) { printf "%s.value %2.2f\n",lab[x],value } + if ( C == "config" ) { print lab[x] ".label " name[x] } + if ( C == "config" ) { if ( x == 1 ) { print lab[x]".draw AREA" } else { print lab[x]".draw STACK" } } + } +}' +} + +if [ "$1" = "config" ]; then + + echo 'graph_title Traceroute (%) to '$totrace + echo 'graph_args --base 1000 -l 0 -u 100 -r' + echo 'graph_vlabel ms (percentage)' + echo 'graph_category network' + echo 'graph_scale no' + echo 'graph_period second' + echo 'graph_info This graph shows the Percentage needed for each hop on the way to '$totrace + dotrace config; + exit 0 +else + dotrace; +fi + diff --git a/plugins/other/mtr100 b/plugins/other/mtr100 deleted file mode 100755 index 3e8947a8bc49c8df41780815a914c1cbc692e15b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1117 zcmV-j1fu&NiwFQnc~eCI1MO8?Z`(E$&a3q+P8A2X+UVxy0yxvUAPdl9NgAYXUy?MX zC0gbpiz-R^vd#Z}hm@T*snI%Xq-b5jTNQA}P=bVFjSa!#bCttn-{og+vlGt)YJX z=3>x?3yesjze9#10tRo+Pv5>D_#a47Q}l#1VP$kg>Ow&`jy%AqLaNemQkR&(%4E(@ zc{vKQX3Z~oMqw9i&>#=`_=W39({9gi^-SlI*9s1z2X8KkAQP%E+`gH&G$G3YpeyL- znhBbDdYROU>n-T=N(V#=@G<$t0&0mTGh9I9LZj{(u5*&J6edL6BmE=AO*%lz3?#?g zu@YOPD2NtE8kq`KDe0kuJKHcK6ILt|)KP*B%~DD#GGql)jLKx~sN*QE1W9S~X^1CN zVwBL1;4jdoJ2L#Z%1jvMollO#MsN*oJ9Z%fcg^9#?U6o*(rMv-7f=QKQlt<=!BbM0 z3hezHW^@{sby2`qLvO9wqUo5!f=WG{GX;^;qJ^Y5HAdU7z^9)f?j6D{uC0_BEw|** z)mAIPb37<0xq=a|F;o6JO{P##rt4z|Ej*}5dXK&1xrRj>jJ4&)VnbWO*I?mb2-SOF3az{fO1&|YO36PpWKfj?rmK~k4N1d=XyzYYs zX;ViXtjTJ8rP0ycE<5OqL_hfvxvU=VK8PA z%pByH&*ak=Z1r;K0$e>>)sr{t+bpfR51Qm3eKFoNXw%9op(E3;|MsJ9VPRomVPRom jVPRomVPRomVPRomVPRomVPRom@xR00%z`Bu04M+e5p^8L