Mtop -mysql monitor

Mtop (MySQL Monitoring Tool)

mtop screen

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:
http://dag.wieers.com/packages/perl-Curses/
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:

up2date perl-Curses

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:

perl Makefile.PL
make
make install

Alternate you can use the rpm available on DAG (I have not tested those rpm packages):
http://dag.wieers.com/packages/mtop/

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
or
up2date mtop

based on what is the tool you are using (yum or up2date).

To summarize Redhat/ContOS install;

wget http://dag.wieers.com/rpm/packages/perl-Curses/perl-Curses-1.23-1.rh9.rf.i386.rpm
rpm -Uvh perl-Curses-1.23-1.rh9.rf.i386.rpm
yum install mtop

g33kadmin

I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.