Tag Archives: config

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

Install & configuration for Nagios & Nagios Client (NRPE) on CentOS 5

Install

Add RPMForge Yum Repository

It is recommended that you configure yum-priorities prior to following this tutorial to avoid having base CentOS packages being overwritten by the RPMForge repository. Instructions to do so can be found on the CentOS Wiki.

Install & Configure Prerequisites

How to install filezilla on centos 5.X

The default RPMforge repository does not replace any CentOS base packages. In the past it used to, but those packages are now in a separate repository (rpmforge-extras) which is disabled by default.

You can find a complete listing of the RPMforge package packages at http://packages.sw.be/

Download the rpmforge-release package. Choose one of the two links below, selecting to match your host’s architecture. If you are unsure of which one to use you can check your architecture with the command uname -i

The preferred rpmforge-release package to retrieve and to install in order to enable that repository is one of the two listed above.

Install DAG’s GPG key

rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

Verify the package you have downloaded

rpm -K rpmforge-release-0.5.2-2.el5.rf.*.rpm

:The rpmforge-release package imports GPG keys into your RPM database. As long as you have verified the md5sumof the key injection package, and trust Dag, et al., then it should be as safe as your trust of them extends.

Install the package

rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm

This will add a yum repository config file and import the appropriate GPG keys.

install filezilla

yum install filezilla

Restoring The Database via SSH/Telnet

Use SSH/Telnet Client, such as PuTTy.
Note:
If your database backup resides on your home computer, you will first have to upload it via FTP to your website
Open your SSH/Telnet client and log into your website. The command line prompt you will see will vary by OS. For most hosting companies, this will bring you into the FTP root folder.

You can either change directoties to wherever the backup is located and type in the following:

mysql -u dbusername -p databasename < backupname.sql

Or if you do not want to change directories and you know the path to where the backup is located, type in the following:

mysql -u dbusername -p databasename < /path/to/backupname.sql

You will be prompted for the database password. Enter it and the database will backup.

If your hosting company has you on a remote MySQL server, such as mysql.yourhost.com, you will need to add the servername to the command line. The servername will be the same as in your config.php. The command line will be:

mysql -h servername -u dbusername -p databasename < backupname.sql

Or:

mysql -h servername -u dbusername -p databasename < /path/to/backupname.sql

Backing Up The Database via SSH/Telnet

Use SSH/Telnet Client, such as PuTTy.

Open your SSH/Telnet client and log into your website. The command line prompt you will see will vary by OS.
For most hosting companies, this will bring you into the FTP root folder.

Type in the following to create a backup in the current directory:

mysqldump –opt -Q -u dbusername -p databasename > backupname.sql

Or to create a backup in a separate directory (signified by /path/to/) type:

mysqldump –opt -Q -u dbusername -p databasename > /path/to/backupname.sql

You will be prompted for the database password. Enter it and the database will backup.

If your hosting company has you on a remote MySQL server, such as mysql.yourhost.com, you will need to add the servername to the command line. The servername will be the same as in your config.php. The command line will be:

Current directory:

mysqldump –opt -Q -h servername -u dbusername -p databasename > backupname.sql

Separate directory:

mysqldump –opt -Q -h servername -u dbusername -p databasename > /path/to/backupname.sql

You can then, if you wish, download the backup to your home computer.