Mtop (MySQL Monitoring Tool)
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.
If you are using Debian then the installation is trivial as mtop is in the debian packages and the installation is as simple as:
aptitude install mtop
This will install all the required dependencies and once it completes you are ready to go. Just type mtop on the command prompt.
To install mtop on RHEL I 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 that can be found for example:
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.
Once you have the required package install it. For example:
rpm -Uvh perl-Curses-1.13-1.1.el3.rf.i386.rpm
Alternate if you have DAG in your up2date sources you can install perl-Curses simply by:
Optional in case you don’t have already perl-DBI and perl-DBD, then install them using up2date:
up2date perl-DBD-MySQL perl-DBI
The other requirements (Getopt::Long, Net::Domain) are normally part of the base install and are already available.
Now that you have all the required dependencies installed all you need is the mtop sources. Uncompress them and use the readme instructions for installation:
Alternate you can use the rpm available on DAG (I have not tested those rpm packages):
As Robeto, has suggested, in case you already have DAG in your sources for up2date or yum, you can install it with all the required dependencies very easy using:
yum install mtop
based on what is the tool you are using (yum or up2date).
To summarize Redhat/ContOS install;
rpm -Uvh perl-Curses-1.23-1.rh9.rf.i386.rpm
yum install mtop