Created
March 13, 2013 23:44
-
-
Save YarekTyshchenko/5157563 to your computer and use it in GitHub Desktop.
ioping collectd plugin
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 | |
# Collectd plugin to monitor disk IO Wait time | |
# Author Yarek T | |
HOSTNAME="${COLLECTD_HOSTNAME:-`hostname -f`}" | |
INTERVAL="${COLLECTD_INTERVAL:-10}" | |
ENDPOINT='/tmp/' | |
IOPING='/usr/local/bin/ioping' | |
while sleep "$INTERVAL" | |
do | |
VALUE=$(($IOPING -q -p 1 -c 1 -w 10 $ENDPOINT | awk '{printf("%.3f", $1/1000)}') 2>/dev/null) | |
if [ $? -ne 0 ] | |
then | |
VALUE='U' | |
fi | |
echo "PUTVAL $HOSTNAME/ioping/latency interval=$INTERVAL N:$VALUE" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment