Mytop on cpanel

This articles discuss how to install mytop on cpanel servers

What is mytop ?

Mytop is the best opensource tool developed by Jeremy Zawodny Mysql guru. 😉 this tools helps you to monitor Mysql health, current query process running, no of sleep process, mysql load etc.

Before downloading and install the tool, we need to install few perl modules to support the mytop script .

Ssh the server as root and execute the following commands :

/scripts/realperlinstaller –force Getopt::Long
/scripts/realperlinstaller –force DBI
/scripts/realperlinstaller –force DBD::mysql
/scripts/realperlinstaller –force Term::ReadKey


Download the latest mytop tool from http://jeremy.zawodny.com/mysql/mytop/

wget http://jeremy.zawodny.com/mysql/mytop/mytop-1.6.tar.gz
tar zxpfv mytop-1.6.tar.gz
cd mytop-1.6
perl Makefile.PL && make && make install

On cpanel centos 5.x versions you will get Error in option spec: “long|!” error message if you are trying to execute the mytop command. Please do the following to solve this error.
After doing perl Makefile.PL edit the mytop script inside the installation location and Search for the line  “long|!”              => \$config{long_nums}, and comment it to #”long|!”              => \$config{long_nums}, and then execute make install from the source directory to install the altered mytop script.

After installing mytop you need to create a new file under /root/.mytop (mytop config file for root) with the lines below (mysql root password is found on /root/.my.cnf:
user=root
pass=<your mysql password>
host=localhost
db=mysql
delay=5
port=3306
socket=
batchmode=0
header=1
color=1
idle=1
that’s it 😉
Screen-shots :

Mytop