root / plugins / network / iperf_ @ dd4afac8
Historique | Voir | Annoter | Télécharger (896 octets)
| 1 | ec912970 | Steve Mokris | #!/bin/bash |
|---|---|---|---|
| 2 | # |
||
| 3 | # iperf_ munin grabber script |
||
| 4 | # 2007.09 by steve@kosada.com |
||
| 5 | # |
||
| 6 | # before trying to use this script, make sure: |
||
| 7 | # - you have an iperf server running on the remote machine |
||
| 8 | # - you are able to successfully run iperf from the commandline. e.g., |
||
| 9 | # iperf --time 2 --parallel 4 --client $destination --format B |
||
| 10 | |||
| 11 | destination=`basename $0 | sed 's/^iperf_//g'` |
||
| 12 | |||
| 13 | if [ "$1" = "config" ]; then |
||
| 14 | echo "graph_title iperf to $destination" |
||
| 15 | echo 'graph_vlabel bytes/sec' |
||
| 16 | echo 'graph_args --lower-limit 0 --upper-limit 200000' |
||
| 17 | echo 'graph_category network' |
||
| 18 | echo 'graph_period second' |
||
| 19 | echo "graph_info This instance of iperf measures the transmit speed to $destination" |
||
| 20 | |||
| 21 | echo 'iperf.label iperf' |
||
| 22 | echo 'iperf.draw AREA' |
||
| 23 | else |
||
| 24 | kbits=`iperf --time 2 --parallel 4 --client $destination --format B \ |
||
| 25 | | grep Bytes \ |
||
| 26 | | tr --squeeze-repeats ' ' \ |
||
| 27 | | cut -d ' ' -f 8` |
||
| 28 | echo "iperf.value $kbits" |
||
| 29 | fi |
