I spent some time googling around this afternoon, and kept reading that iotop requires kernel 2.6.20 and python 2.6, and therefore was a bit of a challenge to get running on RHEL/CENTOS 5.X. However, the requirements are actually pretty basic, and easy to get running on a somewhat recent update of RHEL 5.
Redhat has backported the per process IO accounting feature to the 2.6.18-144 kernel. So if /proc/self/io exists, and you get results from /proc/<PID #>/io then iotop will work.
[root@gateway /]# cat /proc/self/io
[root@gateway /]# cat /proc/3227/io
Basic Steps for setting up iotop on RHEL 5.7 (And probably older versions as well, though I haven’t tested).
Update Kernel to 2.6.8-144 or higher.
yum update kernel
Install epel repository – There are plenty of instructions out there, but it will look something like this for x64 RHEL:
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
Then you just need Python 2.4, python-ctypes, and iotop packages:
yum install python python-ctypes iotop
Thats it! Pretty easy huh?
I had a case where iotop wouldn’t run on a linux 3.1 kernel, I believe because of mprotect() (Not sure though). In either case, I discovered that htop gets you most of what iotop will get you , plus a lot more. Its a pretty neat tool. I suggest checking it out. You still need a kernel that has IO statistics in /proc (as mentioned above).