#!/bin/bash # # nuttcp_ munin grabber script # based on iperf_ plugin by steve@kosada.com # # before trying to use this script, make sure: # - you have an nuttcp server running on the remote machine # - you are able to successfully run nuttcp from the commandline. e.g., # nuttcp -t $destination # - you have installed the "bc" program destination=`basename $0 | sed 's/^nuttcp_//g'` if [ "$1" = "config" ]; then echo "graph_title nuttcp to $destination" echo 'graph_vlabel bits/sec' echo "graph_args --lower-limit 0 --upper-limit ${upper_limit:-'10000000'}" echo 'graph_category network' echo 'graph_period second' echo "graph_info This instance of nuttcp measures the transmit speed to $destination" echo 'nuttcp.label nuttcp' echo 'nuttcp.draw AREA' else Mbps=`nuttcp -T${nuttcp_time:-'5'} -t -b $destination \ | tr --squeeze-repeats ' ' \ | cut -d ' ' -f 8` bits="$(echo "scale = 0; ($Mbps * 1000000) / 1" | bc)" echo "nuttcp.value $bits" fi