MySQL Monitoring Tool : Mtop on RHEL
Mtop is a little perl utility that shows in real time statistics of your MySQL server. It allows you to quickly identify problems related to mysql poor performance, using an interface similar to the normal ‘top’ command.
To install mtop on RHEL We needed to first satisfy a dependency (perl-Curses) that is not available in the regular RHEL packages. The quickest way to install perl-Curses is to use a build rpm.
Depending from your RHEL version download the respective package, perl-Curses-1.13-1.1.el3.rf.i386.rpm for RHEL3 i386, or perl-Curses-1.13-1.2.el4.rf.x86_64.rpm for RHEL4 on x86_64.
Optional in case you don’t have already perl-DBI and perl-DBD, then install them using
yum install perl-DBD-MySQL perl-DBI
The other requirements (Getopt::Long, Net::Domain) are normally part of the base install and are already available
To install on your Red Hat 5 i386 servers I did the following:
wget http://apt.sw.be/redhat/el4/en/i386/rpmforge/RPMS/mtop-0.6.6-1.2.el4.rf.noarch.rpm
wget http://apt.sw.be/redhat/el4/en/i386/rpmforge/RPMS/perl-Curses-1.27-1.el4.rf.i386.rpm
rpm -Uvh mtop-0.6.6-1.2.el4.rf.noarch.rpm perl-Curses-1.27-1.el4.rf.i386.rpm
The RPMs installed the binary file in the /usr/bin directory. To use the program as the MySQL root user you can type on the command line:
mtop --dbuser=root --password=<MySQL root password>
For more information on using mtop you can type ‘man mtop’ on the command line.