Skip to content

Instantly share code, notes, and snippets.

@YarekTyshchenko
Created March 13, 2013 23:44
Show Gist options
  • Save YarekTyshchenko/5157563 to your computer and use it in GitHub Desktop.
Save YarekTyshchenko/5157563 to your computer and use it in GitHub Desktop.
ioping collectd plugin
#!/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