Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to monitor disk I/Os on a server.
I need to fetch two metrics:

  • read IO/sec
  • write IO/sec

Using iotop I'm able to read those metrics (DISK READ and DISK WRITE). My major problem is that I can't use any non-built-in commands.

How can I get an instant snapshot of read IO/sec and write IO/sec without any third-party utility?

share|improve this question
    
Ahrm...what's wrong with iotop? Not installed? –  Bobby Sep 20 '12 at 11:01
    
By “built in”, do you mean already installed. –  richard Sep 20 '12 at 11:37
    
iotop is not installed on target server and I don't have rights to install a new utility. @richard: yes –  Florent Sep 20 '12 at 11:37

2 Answers 2

up vote 0 down vote accepted

I finally found a good way to read the I/O metrics:

  1. Get all processes ID from /proc/ by listing the directory
  2. Extract the metrics from cat /proc/[pid]/io
  3. Do some maths
share|improve this answer

Look in file /proc/diskstats it has the info you need. read http://www.kernel.org/doc/Documentation/iostats.txt

The files in /proc are not real files, they are dynamic pseudo files.

Also, if it does not depend on any non existent dynamic libraries you can copy pstop to ~/bin then chmod +x ~/bin/pstop. If it does you will have to compile a staticly linked version.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.