2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Plugin multibandwidth: unify whitespace

This commit is contained in:
Lars Kruse 2018-07-11 20:36:49 +02:00
parent 5fb2e02eab
commit ecc6e30d55

View File

@ -77,37 +77,37 @@ max_valid_bps=${max_valid_bps:-15728640}
case $1 in
config)
echo graph_title MultiBandwidth
echo 'graph_vlabel bps'
echo 'graph_args --base 1024 -l 0'
echo 'graph_scale yes'
echo 'graph_category network'
echo 'graph_info This graph shows the bandwidth between localhost and serveral hosts'
for host in $hosts; do
fieldname="host_$(clean_fieldname "$host")"
echo "$fieldname.label $host"
echo "$fieldname.draw LINE2"
echo "$fieldname.info Bandwidth statistics for $host"
done
exit 0;;
echo graph_title MultiBandwidth
echo 'graph_vlabel bps'
echo 'graph_args --base 1024 -l 0'
echo 'graph_scale yes'
echo 'graph_category network'
echo 'graph_info This graph shows the bandwidth between localhost and serveral hosts'
for host in $hosts; do
fieldname="host_$(clean_fieldname "$host")"
echo "$fieldname.label $host"
echo "$fieldname.draw LINE2"
echo "$fieldname.info Bandwidth statistics for $host"
done
exit 0
;;
autoconf)
if command -v bing >/dev/null 2>&1; then
echo 'yes'
exit 0;
else
echo 'no (bing not installed)'
exit 0;
fi
if command -v bing 2>/dev/null; then
echo 'yes'
else
echo 'no (bing not installed)'
fi
exit 0
;;
esac
#Calculating the bandwidth
# Calculating the bandwidth
for host in $hosts; do
fieldname="host_$(clean_fieldname "$host")"
SPEED=$(timeout 6 bing localhost "$host" -n -c 1 -e "$samples" -s "$small_packet_size" -S "$big_packet_size" 2>/dev/null \
|grep "estimated link" -A 2 \
| grep "estimated link" -A 2 \
| grep bps \
| awk '{print $2}' \
| cut -d "b" -f1)