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

Plugin multibandwidth: rename environment setting for limiting the valid range

This commit is contained in:
Lars Kruse 2018-07-11 20:29:31 +02:00
parent ade6f5f228
commit 580a39ed41

View File

@ -28,7 +28,7 @@ env.hosts example.org example2.org example3.org
env.samples 15 env.samples 15
env.small_packet_size 44 env.small_packet_size 44
env.big_packet_size 108 env.big_packet_size 108
env.max_mbps 15728640 env.max_valid_bps 15728640
- env.hosts explanation: hostname or IP of the hosts to calculate the bandwidth. - env.hosts explanation: hostname or IP of the hosts to calculate the bandwidth.
@ -41,7 +41,7 @@ env.max_mbps 15728640
packets. The default is 108. The size should be chosen so that big packet roundtrip times packets. The default is 108. The size should be chosen so that big packet roundtrip times
are long enough to be accurately measured. are long enough to be accurately measured.
- env.max_mbps explanation: bing have some random spikes. This variable is used to indicate - env.max_valid_bps explanation: bing have some random spikes. This variable is used to indicate
the maximum value of mbps that can be recorded (in bps). the maximum value of mbps that can be recorded (in bps).
=head1 MAGIC MARKERS =head1 MAGIC MARKERS
@ -112,8 +112,9 @@ for host in $hosts; do
RATE="U" RATE="U"
echo "Error: no data (timeout)" >&2 echo "Error: no data (timeout)" >&2
fi fi
if [ "$RATE" -gt "$max_mbps" ]; then if [ -n "$max_valid_bps" ] && [ "$RATE" -gt "$max_valid_bps" ]; then
RATE="$max_mbps" # the value is outside of the allowed range; discard it
RATE="U"
fi fi
echo "${fieldname}.value $RATE" echo "${fieldname}.value $RATE"
done done