Révision 1ae4ac09
Update multibandwidth
I will update more changes in the next days
| plugins/network/multibandwidth | ||
|---|---|---|
| 1 |
#!/bin/sh
|
|
| 2 |
|
|
| 3 |
. "$MUNIN_LIBDIR/plugins/plugin.sh"
|
|
| 4 |
|
|
| 5 |
: <<=cut
|
|
| 6 |
|
|
| 7 |
=head1 NAME
|
|
| 8 |
|
|
| 9 |
multibandwidth - Plugin to monitor the bandwidth between localhost and serveral hosts.
|
|
| 10 |
|
|
| 11 |
=head1 APPLICABLE SYSTEMS
|
|
| 12 |
|
|
| 13 |
All systems with “bash”, and “munin”
|
|
| 14 |
|
|
| 15 |
=head1 REQUIREMENTS
|
|
| 16 |
|
|
| 17 |
bing installed.
|
|
| 18 |
|
|
| 19 |
You can install bing by using (Ubuntu/Debian): apt-get install bing
|
|
| 20 |
|
|
| 21 |
=head1 CONFIGURATION
|
|
| 22 |
|
|
| 23 |
The following is the default configuration
|
|
| 24 |
|
|
| 25 |
[multibandwidth]
|
|
| 26 |
user root
|
|
| 27 |
env.hosts example.org example2.org example3.org
|
|
| 28 |
env.samples 15
|
|
| 29 |
env.small_packet_size 44
|
|
| 30 |
env.big_packet_size 108
|
|
| 31 |
env.max_mbps 15728640
|
|
| 32 |
|
|
| 33 |
- env.hosts explanation: hostname or IP of the hosts to calculate the bandwidth.
|
|
| 34 |
|
|
| 35 |
- env.samples explanation: Reset stats after sending samples ECHO_REQUEST packets.
|
|
| 1 |
#!/bin/sh |
|
| 2 |
|
|
| 3 |
. "$MUNIN_LIBDIR/plugins/plugin.sh" |
|
| 4 |
|
|
| 5 |
: <<=cut |
|
| 6 |
|
|
| 7 |
=head1 NAME |
|
| 8 |
|
|
| 9 |
multibandwidth - Plugin to monitor the bandwidth between localhost and serveral hosts. |
|
| 10 |
|
|
| 11 |
=head1 APPLICABLE SYSTEMS |
|
| 12 |
|
|
| 13 |
All systems with “bash”, and “munin” |
|
| 14 |
|
|
| 15 |
=head1 REQUIREMENTS |
|
| 16 |
|
|
| 17 |
bing installed. |
|
| 18 |
|
|
| 19 |
You can install bing by using (Ubuntu/Debian): apt-get install bing |
|
| 20 |
|
|
| 21 |
=head1 CONFIGURATION |
|
| 22 |
|
|
| 23 |
The following is the default configuration |
|
| 24 |
|
|
| 25 |
[multibandwidth] |
|
| 26 |
user root |
|
| 27 |
env.hosts example.org example2.org example3.org |
|
| 28 |
env.samples 15 |
|
| 29 |
env.small_packet_size 44 |
|
| 30 |
env.big_packet_size 108 |
|
| 31 |
env.max_mbps 15728640 |
|
| 32 |
|
|
| 33 |
- env.hosts explanation: hostname or IP of the hosts to calculate the bandwidth. |
|
| 34 |
|
|
| 35 |
- env.samples explanation: Reset stats after sending samples ECHO_REQUEST packets. |
|
| 36 | 36 |
|
| 37 | 37 |
- env.small_packet_size explanation: Specifies the number of data bytes to be sent in the small |
| 38 | 38 |
packets. The default and minimum value is 44. |
| ... | ... | |
| 107 | 107 |
VALUE=`echo "$SPEED" | sed 's/.$//'` |
| 108 | 108 |
RATE=`echo "$VALUE * 1048576" | bc -l` |
| 109 | 109 |
|
| 110 |
if [ $(echo "$RATE" >= "$max_mbps" | bc >/dev/null && echo "no" || echo "yes") = "yes" ]; then
|
|
| 110 |
if [ `echo "$RATE > $max_mbps" | bc` -eq "1" ]; then
|
|
| 111 | 111 |
echo "$max_mbps" |
| 112 | 112 |
else |
| 113 | 113 |
echo "$RATE" |
Formats disponibles : Unified diff