views:

105

answers:

2

Hi,

I would like to monitor system IO load from a python program, accessing statistics similar to those provided in /proc/diskstats in linux (although obviously a cross-platform library would be great). Is there an existing python library that I could use to query disk IO statistics on linux?

+1  A: 

What's wrong with just periodically reading /proc/diskstats, e.g. using sched to repeat the operation every minute or whatever? Linux's procfs is nice exactly because it provides a textual way for the kernel to supply info to userland programs, as text is easiest to read and use in a huge variety of languages...!

Alex Martelli
A: 

I haven't seen a library, but you may want to check out the Python tool named "dstat" [1] for reading Linux kernel stats.

[1] - http://dag.wieers.com/home-made/dstat/

Vahid Pazirandeh