Senin, 26 Januari 2015

Cacti Installation with Centos 6 Part2

First part, we installed required components for Cacti. In this part, we’ll install and configure Cacti.
After MySQL installation, first we should set MySQL root password.
1
2
mysqladmin --user=root password p@ssw0rd!
mysqladmin --user=root --password reload

Let’s download latest Cacti release.
1
2
cd /home
wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz

Untar tar ball.
1
2
tar -zxvf cacti-0.8.7g.tar.gz
cd cacti-0.8.7g

Create the MySQL database for Cacti. You have to type your root password to create database.
mysqladmin --user=root create cacti --password

Import the default Cacti database.
mysql -u root -p cacti < cacti.sql

Create a MySQL username and password for Cacti for security reasons.
1
2
3
4
mysql -u root -p mysql
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactipass!';
flush privileges;
exit

Edit “include/config.php” and specify the database type, name, host, user and password for your Cacti configuration.
nano include/config.php
$database_type = “mysql”;
$database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cactiuser”;
$database_password = “cactipass!”;

Move Cacti files into /var/www/html for web access.
1
2
cd /home
mv /home/cacti-0.8.7g /var/www/html/cacti

Go into Cacti directory and set the appropriate permissions for graph/log generation.
1
2
cd /var/www/html
chown -R apache:apache cacti

Add a line to your ”/etc/crontab” file.
nano /etc/crontab
*/5 * * * * cactiuser /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1

Disable SeLinux to web restrictions.
nano /etc/sysconfig/selinux
SELINUX=disabled

Reboot your server to apply changes. After reboot, go to php.ini configuration and change timezone.
nano /etc/php.ini
date.timezone = “Europe/Istanbul”

We finished Cacti installation. Now go to your web browser and connect to http://yourserverip/cacti.

Choose “New Install” and click next.

Correct RRDTool default path.
RRDTool Binary Path: /usr/local/rrdtool/bin/rrdtool

Now Cacti is online!

You can login to Cacti with default username and password. After your first login, you should change password.
username: admin
password: admin
Now you can start adding your graphs :)

Tidak ada komentar:

Posting Komentar