mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 18:38:30 +00:00
Make whitespace consistent, converting tabs to 4 spaces and fixing indents
This commit is contained in:
parent
b3a486fa62
commit
d9cce2160f
1 changed files with 34 additions and 34 deletions
|
@ -21,8 +21,8 @@
|
||||||
#
|
#
|
||||||
# Parameters:
|
# Parameters:
|
||||||
#
|
#
|
||||||
# config (required)
|
# config (required)
|
||||||
# autoconf (optional - only used by munin-config)
|
# autoconf (optional - only used by munin-config)
|
||||||
#
|
#
|
||||||
# Magic markers (optional - used by munin-config and some installation
|
# Magic markers (optional - used by munin-config and some installation
|
||||||
# scripts):
|
# scripts):
|
||||||
|
@ -32,19 +32,19 @@
|
||||||
totrace=`basename $0 | sed 's/^mtr100_//g'`
|
totrace=`basename $0 | sed 's/^mtr100_//g'`
|
||||||
|
|
||||||
if [ "$1" = "autoconf" ]; then
|
if [ "$1" = "autoconf" ]; then
|
||||||
if ( mtr -nrc 1 localhost 2>/dev/null >/dev/null ); then
|
if ( mtr -nrc 1 localhost 2>/dev/null >/dev/null ); then
|
||||||
echo yes
|
echo yes
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
if [ $? -eq 127 ]
|
if [ $? -eq 127 ]
|
||||||
then
|
then
|
||||||
echo "no (mtr program not found - install the mtr(-tiny) package)"
|
echo "no (mtr program not found - install the mtr(-tiny) package)"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
echo no
|
echo no
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -63,28 +63,28 @@ total+=$6
|
||||||
}
|
}
|
||||||
|
|
||||||
END {
|
END {
|
||||||
if ( C != "config" ) { print "hop_0.value U" }
|
if ( C != "config" ) { print "hop_0.value U" }
|
||||||
if ( C == "config" ) { print "hop_0.label " SRC_HOSTNAME }
|
if ( C == "config" ) { print "hop_0.label " SRC_HOSTNAME }
|
||||||
if ( C == "config" ) { print "hop_0.draw AREA" }
|
if ( C == "config" ) { print "hop_0.draw AREA" }
|
||||||
for (x=1; x<=count; x++) {
|
for (x=1; x<=count; x++) {
|
||||||
value=(val[x]/total)*100
|
value=(val[x]/total)*100
|
||||||
if ( C != "config" ) { printf "%s.value %2.2f\n","hop_" lab[x],value }
|
if ( C != "config" ) { printf "%s.value %2.2f\n","hop_" lab[x],value }
|
||||||
if ( C == "config" ) { print "hop_" lab[x] ".label " name[x] }
|
if ( C == "config" ) { print "hop_" lab[x] ".label " name[x] }
|
||||||
if ( C == "config" ) { print "hop_" lab[x]".draw STACK" }
|
if ( C == "config" ) { print "hop_" lab[x]".draw STACK" }
|
||||||
}
|
}
|
||||||
}'
|
}'
|
||||||
}
|
}
|
||||||
|
|
||||||
if [ "$1" = "config" ]; then
|
if [ "$1" = "config" ]; then
|
||||||
echo 'graph_title Traceroute (%) to '$totrace
|
echo 'graph_title Traceroute (%) to '$totrace
|
||||||
echo 'graph_args --base 1000 -l 0 -u 100 -r'
|
echo 'graph_args --base 1000 -l 0 -u 100 -r'
|
||||||
echo 'graph_vlabel ms (percentage)'
|
echo 'graph_vlabel ms (percentage)'
|
||||||
echo 'graph_category network'
|
echo 'graph_category network'
|
||||||
echo 'graph_scale no'
|
echo 'graph_scale no'
|
||||||
echo 'graph_period second'
|
echo 'graph_period second'
|
||||||
echo 'graph_info This graph shows the Percentage needed for each hop on the way to '$totrace
|
echo 'graph_info This graph shows the Percentage needed for each hop on the way to '$totrace
|
||||||
dotrace config;
|
dotrace config;
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
dotrace;
|
dotrace;
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue