Created
October 20, 2016 12:43
-
-
Save benjojo/e803d8e44d130b886395d7b1f666e1a0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOSTNAME="${COLLECTD_HOSTNAME:-ardar}" | |
INTERVAL="${COLLECTD_INTERVAL:-10}" | |
cd ~ | |
stdbuf -oL ioping -i 1 -P 10 -W -q . | while read -r line | |
do | |
min=$(echo $line | awk '{print $5}') | |
avg=$(echo $line | awk '{print $6}') | |
max=$(echo $line | awk '{print $7}') | |
std=$(echo $line | awk '{print $8}') | |
echo "PUTVAL $HOSTNAME/diskops/latency-min interval=$INTERVAL N:$min" | |
echo "PUTVAL $HOSTNAME/diskops/latency-avg interval=$INTERVAL N:$avg" | |
echo "PUTVAL $HOSTNAME/diskops/latency-max interval=$INTERVAL N:$max" | |
echo "PUTVAL $HOSTNAME/diskops/latency-stddev interval=$INTERVAL N:$std" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment