Hi, there, I am a new guy of Suse linux. This time, I want to get the run-time disks IO,page in and page out information. I refered to some documentations and they said I can get those information from the proc/stat file.But I used "cat stat" to show that file. It gave the following information: linux:/proc # cat stat cpu 261998 101921 22037 876055 26331 1291 35 0 cpu0 261998 101921 22037 876055 26331 1291 35 0 intr 13448413 12898679 10289 0 2 5 3853 0 1 2 2 2 383760 12337 0 113599 25882 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ctxt 12796833 btime 1125723158 processes 10359 procs_running 3 procs_blocked 0 I did not find any information about the disk IO,page in and page out information. Can anybody tell me how to get thoes information? especially the disk IO information. Thanks Raymond _________________________________________________________________ Designer Mail isn't just fun to send, it's fun to receive. Use special stationery, fonts and colors. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*.
On Saturday 03 September 2005 12:31 am, raymond raymond wrote:
Hi, there, I am a new guy of Suse linux. This time, I want to get the run-time disks IO,page in and page out information. I refered to some documentations and they said I can get those information from the proc/stat file.But I used "cat stat" to show that file. It gave the following information:
Have you tried looking into iostat and vmstat? -Nick $ vmstat procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 4 2 2800 8028 31292 276264 0 1 10063 9695 1439 1913 43 37 8 12 $ iostat Linux 2.6.11.4-21.9-default (l06) 09/03/2005 avg-cpu: %user %nice %system %iowait %idle 24.42 18.60 36.86 12.01 8.11 Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn fd0 0.00 0.00 0.00 4 0 sda 17.79 407.95 104.67 814266 208928 sdb 24.23 6675.01 10.89 13323316 21744 sdc 0.07 1.19 0.10 2372 200 sdd 22.38 7141.99 1.08 14255416 2152 sde 0.23 4.12 0.10 8216 200 hda 25.87 6.76 19327.63 13494 38577942 hdb 15.72 554.67 100.06 1107112 199728 hde 63.62 5532.09 47.10 11042056 94008 -- <<< Why, oh, why, didn't I take the blue pill? >>> /`-_ Nicholas R. LeRoy The Condor Project { }/ http://www.cs.wisc.edu/~nleroy http://www.cs.wisc.edu/condor \ / nleroy@cs.wisc.edu The University of Wisconsin |_*_| 608-265-5761 Department of Computer Sciences
Hi, thanks for your reply. Actually, I want to get the disk IO information in a program and use it. So, I need to know where can I get it. Using a command to get it is not what I want. I found a file namd vmstat. It contains the page in and page out information, but no disk IO information. Could someone tell me how to get it? Thanks. Raymond
From: Nick LeRoy <nleroy@cs.wisc.edu> To: suse-linux-e@suse.com Subject: Re: [SLE] How to get disk IO information? Date: Sat, 3 Sep 2005 00:36:13 -0500
On Saturday 03 September 2005 12:31 am, raymond raymond wrote:
Hi, there, I am a new guy of Suse linux. This time, I want to get the run-time disks IO,page in and page out information. I refered to some documentations and they said I can get those information from the proc/stat file.But I used "cat stat" to show that file. It gave the following information:
Have you tried looking into iostat and vmstat?
-Nick
$ vmstat procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 4 2 2800 8028 31292 276264 0 1 10063 9695 1439 1913 43 37 8 12 $ iostat Linux 2.6.11.4-21.9-default (l06) 09/03/2005
avg-cpu: %user %nice %system %iowait %idle 24.42 18.60 36.86 12.01 8.11
Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn fd0 0.00 0.00 0.00 4 0 sda 17.79 407.95 104.67 814266 208928 sdb 24.23 6675.01 10.89 13323316 21744 sdc 0.07 1.19 0.10 2372 200 sdd 22.38 7141.99 1.08 14255416 2152 sde 0.23 4.12 0.10 8216 200 hda 25.87 6.76 19327.63 13494 38577942 hdb 15.72 554.67 100.06 1107112 199728 hde 63.62 5532.09 47.10 11042056 94008
_________________________________________________________________ Take charge with a pop-up guard built on patented Microsoft® SmartScreen Technology http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*.
Raymond, On Saturday 03 September 2005 16:47, raymond raymond wrote:
Hi, thanks for your reply. Actually, I want to get the disk IO information in a program and use it. So, I need to know where can I get it. Using a command to get it is not what I want. I found a file namd vmstat. It contains the page in and page out information, but no disk IO information. Could someone tell me how to get it?
First of all, you should not so quickly write off using a program to produce the information you require. Typically, the implementation of programs such as iostat and vmstat will track any change in the manner in which the underlying data is accessed and formatted. If you go straight to those files in /proc or /sys, your program becomes vulnerable to changes in their content. Between the popen(3) and scanf(3) library routines, you should be able to get the information you need from iostat. In any event, here's something to add to your bag of tricks: # What executable files hold iostat and vmstat? % type -p iostat vmstat /usr/bin/iostat /usr/bin/vmstat # What use of absolute file system names are made by iostat and vmstat? % strings /usr/bin/iostat |egrep ^/ /lib/ld-linux.so.2 /proc/stat /proc/partitions /proc/diskstats /sys/block /dev/ /usr/share/locale % strings /usr/bin/vmstat |egrep ^/ /lib/ld-linux.so.2 /proc/diskstats /proc/slabinfo /proc/sys/kernel/pid_max /proc/vmstat /proc/meminfo /proc/stat /proc /proc/%s/stat /proc/loadavg /proc/uptime This tells you which system status files these two programs use to produce their listings. It looks like /proc/diskstats holds a nice summary. Search the Web for information on the format of the information therein. Be sure to note how it has changed since its inception in the 2.5 kernel.
Thanks.
Raymond
Randall Schulz
Thank you for your reply. But when I tried to use iostat command, the system said " iostat:command not found". The vmstat command works well. I don't know why. Thanks. Raymond
From: Randall R Schulz <rschulz@sonic.net> To: suse-linux-e@suse.com Subject: Re: [SLE] How to get disk IO information? Date: Sat, 3 Sep 2005 18:26:13 -0700
Raymond,
On Saturday 03 September 2005 16:47, raymond raymond wrote:
Hi, thanks for your reply. Actually, I want to get the disk IO information in a program and use it. So, I need to know where can I get it. Using a command to get it is not what I want. I found a file namd vmstat. It contains the page in and page out information, but no disk IO information. Could someone tell me how to get it?
First of all, you should not so quickly write off using a program to produce the information you require. Typically, the implementation of programs such as iostat and vmstat will track any change in the manner in which the underlying data is accessed and formatted. If you go straight to those files in /proc or /sys, your program becomes vulnerable to changes in their content. Between the popen(3) and scanf(3) library routines, you should be able to get the information you need from iostat.
In any event, here's something to add to your bag of tricks:
# What executable files hold iostat and vmstat? % type -p iostat vmstat /usr/bin/iostat /usr/bin/vmstat
# What use of absolute file system names are made by iostat and vmstat? % strings /usr/bin/iostat |egrep ^/ /lib/ld-linux.so.2 /proc/stat /proc/partitions /proc/diskstats /sys/block /dev/ /usr/share/locale
% strings /usr/bin/vmstat |egrep ^/ /lib/ld-linux.so.2 /proc/diskstats /proc/slabinfo /proc/sys/kernel/pid_max /proc/vmstat /proc/meminfo /proc/stat /proc /proc/%s/stat /proc/loadavg /proc/uptime
This tells you which system status files these two programs use to produce their listings.
It looks like /proc/diskstats holds a nice summary. Search the Web for information on the format of the information therein. Be sure to note how it has changed since its inception in the 2.5 kernel.
Thanks.
Raymond
Randall Schulz
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
_________________________________________________________________ Take advantage of powerful junk e-mail filters built on patented Microsoft® SmartScreen Technology. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*.
On Sunday 04 September 2005 16:22, raymond raymond wrote:
Thank you for your reply. But when I tried to use iostat command, the system said " iostat:command not found". The vmstat command works well. I don't know why.
On my system: ~> rpm -qf $(which vmstat) procps-3.2.5-3 ~> rpm -qf $(which iostat) sysstat-5.0.6-4 Try installing the sysstat rpm.
Ray Ray, On Friday 02 September 2005 22:31, raymond raymond wrote:
Hi, there, I am a new guy of Suse linux. This time, I want to get the run-time disks IO,page in and page out information. I refered to some documentations and they said I can get those information from the proc/stat file.But I used "cat stat" to show that file. It gave the following information:
I'd suggest you try the "vmstat" command. It has a man page ("man vmstat").
...
I did not find any information about the disk IO,page in and page out information. Can anybody tell me how to get thoes information? especially the disk IO information.
Thanks
Raymond
Randall Schulz
participants (4)
-
Nick LeRoy
-
Randall R Schulz
-
raymond raymond
-
Robert Paulsen