On BNET: Gadget love: Logitech V550 Mouse

Gather disk usage statistics with iostat

Tags: Document management, OPEN SOURCE, system monitoring, Vincent Danen, disk, I/O, printing, Linux, Linux Tips Newsletter

  • Save
  • Print
  • 0

Takeaway: The iostat tool monitors I/O (Input/Output) performance related to disk drives. Find out how you can use iostat to better manage your network.

System monitoring is an important part of network administration. Fortunately, there are numerous tools on the market that monitor performance, network activity, and SMART status of hard drives. One tool that isn't very well known is called iostat, and it monitors I/O (Input/Output) performance related to disk drives.

Some Linux distributions ship with iostat. If your distribution doesn’t include it, simply download the iostat source code and build it as follows:

$ tar xvzf iostat-2.2.tar.gzcd iostat-2.2make

When the build is complete, you'll have the tool iostat and the manpage iostat.8 in the current directory. To install iostat and its manpage in the /usr/local directory tree, simply perform a "make install":

$ tar xvzf iostat-2.2.tar.gzcd iostat-2.2make install

You can run iostat with a number of options and two optional arguments: "interval" and "count." To view disk activity over time, provide it with an interval of 15 (seconds) and a count of 10 (samples). Here’s how:

$ ./iostat 15 10

However, this will give you only basic information on the installed physical disk drives. To obtain more information, pass iostat a few more options, such as printing statistics per disk (-d), printing CPU activity stats (-c), including per-partition stats (-p), and including extended statistics (-x). For a good sampling of data, enter this code snippet:

$ ./iostat -Dpxc

Since iostat prints out a lot of information, you'll want to keep the manpage handy so that you can identify what each column means. Some of the information includes total transfer rate per second, total number of requests per second, number of reads (and writes) per second, percentage of CPU time spent in user, system, and idle modes, and much more.

If your system is slowing down and you're having a hard time finding the bottleneck, iostat may clue you in on some problem areas. Even before that slowdown, iostat can tell you what disks are over- and under-utilized, which allows you to plan ahead and balance the I/O load.

Delivered each Tuesday, TechRepublic's free Linux NetNote provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!

  • Save
  • Print
  • 0

Print/View all Posts Comments on this article

PreinstalledRoger  | 06/14/05
RE: Gather disk usage statistics with iostatMark.Seger@...  | 12/08/07

What do you think?

Article Categories

Security
Security Solutions, IT Locksmith
Networking and Communications
E-mail Administration NetNote, Cisco Routers and Switches
CIO and IT Management
Project Management, CIO Issues, Strategies that Scale
Desktops, Laptops & OS
Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
Data Management
Oracle, SQL Server
Servers
Windows NT, Linux NetNote, Windows Server 2003
Career Development
Geek Trivia
Software/Web Development
Web Development Zone, Visual Basic, .NET
advertisement
Click Here