Tag Archives: Getopt Long

Mytop installation on cpanel

What is mytop ?

Mytop is the best opensource tool developed by Jeremy Zawodny Mysql guru. Mytop on cpanel 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 :

/usr/local/cpanel/scripts/perlinstaller –force Getopt::Long
/usr/local/cpanel/scripts/perlinstaller –force DBI
/usr/local/cpanel/scripts/perlinstaller –force DBD::mysql
/usr/local/cpanel/scripts/perlinstaller –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 complete mytop installation edit the mytop script from /usr/local/bin/mytop this location and Search for the line  “long|!”              => \$config{long_nums}, and comment it to #”long|!”              => \$config{long_nums}, and then execute mytop it will start working if nt then follow this instruction.

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