Innotop is an excellent command line tool to monitor your MySQL servers run under InnoDB engine(both locally and remotely). There are different types of modules/options available which helps to monitor different aspects within the server which also helps the DB administrator to get a clear picture of what is going on in your server. For example mode for monitoring replication, one for queries, and one for transactions. innotop refreshes its data periodically, so you see an updating view. Innotop does not requires any additional configuration so you can just install either via rpm or source and run by just executing the ‘ innotop ‘ command from the command line.
The only problem i have seen is it is not documented properly so you have to check the man page to get an idea about the options available or just by pressing ‘ h ‘ at any time while running innotop for context-sensitive help.
Installing innotop from source and rpm
For both the rpm and source installation you need to met the following requirments.
Just install the dependency using the yum command.
- yum install perl-DBD-MySQL perl-DBI perl-TermReadKey
Download the source from : http://innotop.googlecode.com/files/innotop-1.7.2.tar.gz
- # cd /usr/src
- # wget http://innotop.googlecode.com/files/innotop-1.7.2.tar.gz
- # tar zxvf innotop-1.7.2.tar.gz
- # cd innotop-1.7.2# perl Makefile.PL# make && make install
From RPM :
- rpm -ivh http://gnutoolbox.com/download/linux/rpm/mysql/monitoring/innotop/innotop-1.6.0-1.el5.noarch.rpm
To monitor servers normally:
- # innotop
To monitor InnoDB status information from a file:
- innotop /var/log/mysql/mysqld.err
To run innotop non-interactively in a pipe-and-filter configuration:
- innotop –count 5 -d 1 -n
To monitor a database on another system using a particular username and password:
- innotop -u <username> -p <password> -h <hostname>
Make sure port 3306 is open on the remote mysql server.