LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Output of iostat not updating (http://www.linuxquestions.org/questions/linux-server-73/output-of-iostat-not-updating-4175449060/)

winairmvs 02-07-2013 02:57 PM

Output of iostat not updating
 
I am attempting to monitor some statistics via the command iostat by running it at the command line like so:

Code:

# iostat -c
Linux 2.6.32-279.19.1.el6.x86_64 (host)        02/07/2013        _x86_64_        (2 CPU)

avg-cpu:  %user  %nice %system %iowait  %steal  %idle
          0.66    0.00    0.71    0.95    0.00  97.68

# iostat -c
Linux 2.6.32-279.19.1.el6.x86_64 (host)        02/07/2013        _x86_64_        (2 CPU)

avg-cpu:  %user  %nice %system %iowait  %steal  %idle
          0.66    0.00    0.71    0.95    0.00  97.68

Each time I do run the command the output does not update, as if it's keeping the first run's stats forever. If however I run it with the built in interval like this:

Code:

#iostat -c 1

Linux 2.6.32-279.19.1.el6.x86_64 (host)        02/07/2013        _x86_64_        (2 CPU)

avg-cpu:  %user  %nice %system %iowait  %steal  %idle
          0.66    0.00    0.71    0.95    0.00  97.68

avg-cpu:  %user  %nice %system %iowait  %steal  %idle
          3.50    0.00    5.00    0.00    0.00  91.50

The output is updated and I see the stats change. I have scoured the man page for any mention of how it updates it's output to no avail.

Habitual 02-07-2013 06:39 PM

Code:

iostat -c  1 2 /dev/sda1
works here. :)

the "1" is the delay, and "2" is the repetition.
Every 1 second twice with CPU stats is
Code:

iostat -c  1 2 /dev/sda1
/dev/sda1 is optional, so you'd get all of them.

unSpawn 02-07-2013 06:55 PM

From 'man iostat': "The first report generated by the iostat command provides statistics concerning the time since the system was booted. Each subsequent report covers the time since the previous report."


All times are GMT -5. The time now is 10:21 AM.