Created
August 7, 2012 23:12
-
-
Save alq666/3290405 to your computer and use it in GitHub Desktop.
iostat.py
This file contains 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
from statsd import statsd | |
import sys | |
device = sys.argv[1] | |
while True: | |
a = sys.stdin.readline().strip() | |
data = a.split() | |
if len(data) == 3: | |
try: | |
values = [float(d) for d in data] | |
statsd.gauge("system.io.tx_size", float(values[0]) * 1024, tags=[device]) | |
statsd.gauge("system.io.tx_per_s", float(values[1]), tags=[device]) | |
stastd.gauge("system.io.throughput", float(values[2]) * 1024 * 1024, tags=[device]) | |
except: | |
pass |
Author
alq666
commented
Aug 7, 2012
Sorry, I meant:
iostat -w 1 -d disk1 | python iostat.py disk1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment