UnixServerAdmin

Server Administration & Management

How to Installing MyTop on WHM-cPanel Server

MyTop is one of the best MySQL monitoring tools available, Its vital for monitoring your MySQL health, especially in a shared hosting environment. Installation on a RHEL/CentOS (for cPanel) server is quite straight forward with this guide.
First off, we need a few perl modules, cPanel’s realperlinstaller comes in handy, if you aren’t on cPanel, you’ll need to CPAN or manually install these modules.

# /scripts/realperlinstaller –force Getopt::Long

# /scripts/realperlinstaller –force DBI

# /scripts/realperlinstaller –force DBD::mysql

# /scripts/realperlinstaller –force Term::ReadKey

Now, we download and install 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

NOTE: You may get following error in CentOS 5.x
Error in option spec: “long|!”

Search for the line in Makefile.PL

“long|!”              => $config{long_nums},

Change it to by commenting using #

#”long|!”              => $config{long_nums},

Easy fix.
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

Now you can run mytop

# mytop -d mysql

August 28, 2011 Posted by | cPanel, MySQL | , , | Leave a comment