I understand by installing dstat, iostat I can get the disk activity stats information. However, now I am hoping to minimize the dependencies as I don't want to force my script users to install additional stuff. So I'm wondering if there is any way to read the disk stats information from somewhere in /proc/? Thanks.
You can find disk statistics in two places.
/proc/diskstats represents the statistics of each single block device including partitions and device mapper devices.
Unfortunately these numbers do not provide per second statistics but a grand total of the single statistics. So you would have to write a script that monitors the figures over a given time, then do the math to get a per second result. This job is done by
A more comprehensive description of these files can be found in the kernel documentation Documentation/block/stat.txt and Documentation/iostats.txt.
Most users want to install the packages containing
iostatas the dependencies aren't too huge.
dstat depends on
pyhton2 but most distros have
python2 installed anyways.