Cacti Installation on Centos 6 ?

Cacti Installation on Centos 6

Cacti is very excellent and effective monitoring tool across all open source based monitoring tools in market. Cacti provide you graphical view of IT infrastructure resource like server, network & other (memory, disk utilization, network ping response, load & bandwidth utilization.

User authentication, External authentication system like (Active Directory / OpenLdap) supported.

User Roles and Privilleges can be managed as per the requirement .

Cacti installation on Centos or Cacti installation on Redhat is very simple and easy to manage. There are two ways to install cacti monitoring tool

Source code ,
RPM package from associated repository system.
Prior to install cacti from EPEL repository, fallowing packages are need to be preinstalled

(apache, mysql, php , php-snmp, net-snmp,net-snmp-devel &  rrdtool)

Step: 1

[root@solutons]#yum install httpd httpd-devel  mysql mysql-server php-mysql php-pear php-common php-gd php-devel php php-mbstring php-cli php-mysql php-snmp net-snmp-utils net-snmp-libs

start service and make them on in default runlevel (apache , mysql & SNMP)

[root@solutons]service snmpd start 

&

[root@solutons]chkconfig snmpd on
 [root@solutons]service mysqld start (Set the mysql root password "#mysqladmin -u root password "password")

&

[root@solutons]chkconfig mysqld on
[root@solutons]service httpd start

&

[root@solutons]chkconfig httpd on   

Chkconfig command is needed to run above services in default runlevel , on next boot.

Step: 2

RPM package from associated repository system.

You can download and installed from EPEL repository (Extra Package for Enterprise Linux).  This is an open source based repository you can download or install at free of cost, repository packages are maintained by Fedora.

How to enabling EPEL repository on you Centos or Redhat box.?

You have to verify OS bits (32bit or 64bit) based on that you can select appropriate version from below URL.

For Redhat / Centos 6 32bit

http://epel.mirror.net.in/epel/  (from here you can download required version repository package).

For Redhat / Centos 6 32-bit

[root@solutons]#wget http://epel.mirror.net.in/epel/6/i386/epel-release-6-8.noarch.rpm
[root@solutions]#rpm -ivh epel-release-6-8.noarch.rpm
 

For Redhat / Centos 6 64-bit

[root@solutions]#wget http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm
[root@solutions]#rpm -ivh epel-release-6-8.noarch.rpm

OR you can use below command to install directly from URL instead of download than install.

[root@solutons]#rpm -ivh http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm

Output:

Retrieving http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm

Preparing…                ########################################### [100%]

1:epel-release           ########################################### [100%]

EPEL repository is added, you can start installing cacti package from EPEL repository using yum command line utility.

[root@solutions ~]# yum install cacti

Output:

Loaded plugins: fastestmirror, refresh-packagekit, replace, security

Loading mirror speeds from cached hostfile

* base: ftp.iitm.ac.in

* epel: ftp.cuhk.edu.hk

* extras: ftp.iitm.ac.in

* updates: ftp.iitm.ac.in

* webtatic: uk.repo.webtatic.com

Setting up Install Process

Resolving Dependencies

–> Running transaction check

—> Package cacti.noarch 0:0.8.8a-2.el6 will be installed

–> Finished Dependency Resolution

Dependencies Resolved
================================================================================
Package         Arch             Version                  Repository      Size
================================================================================

Installing:
cacti           noarch           0.8.8a-2.el6             epel           2.0 M
Transaction Summary
================================================================================
Install       1 Package(s)
Total download size: 2.0 M
Installed size: 5.4 M
Is this ok [y/N]: y
Downloading Packages:
cacti-0.8.8a-2.el6.noarch.rpm                            | 2.0 MB     00:18
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : cacti-0.8.8a-2.el6.noarch                                                                                                                 1/1

Verifying  : cacti-0.8.8a-2.el6.noarch                                                                                                                 1/1

Installed:

cacti.noarch 0:0.8.8a-2.el6

Complete!

Step: 3
Go to cacti mysql dump file which is located in fallowing location

[root@solutions ~]# cd /usr/share/doc/cacti-0.8.8a/

Run ls command to list all files located here.

[root@solutions cacti-0.8.8a]# ls

Output :
cacti.sql  docs  LICENSE  README

[root@solutions cacti-0.8.8a]#

Now login to mysql server as shown below

[root@solutions cacti-0.8.8a]#mysql –p

Output:
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2385
Server version: 5.1.69 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

mysql>create database cacti;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on cacti.* to cacti@localhost identified by "password";
mysql>exit

Copying cacti sql dump file data to newly create cacti database, the dump file is located in /usr/share/doc/cacti-0.8.8a/

[root@solutions cacti-0.8.8a]#mysql -u cacti cacti < cacti.sql -p 

Modify database configuration setting as created in above steps , cacti database configuration file location is  /etc/cacti/db.php

[root@solutions ~]# vi /etc/cacti/db.php

/* make sure these values refect your actual database/host/user/password         */

$database_type = “mysql”;
   $database_default = “cacti”;
$database_hostname = “localhost”;
$database_username = “cacti”;
$database_password = “password”;
$database_port = “3306″;
$database_ssl = false;

Save and exit the file.

Step : 4
Apache configuration  settings in order to allow cacti web console from known IP’s by default localhost is allowed to invoke installation wizard and access cacti web console  to configure remote host .  the apache configuration file associated to cacti is located in “/etc/httpd/conf.d/cacti.conf”

Allow from 192.168.0.2 192.168.0.10,  two ip’s are added to allow access in below configuration file..

[root@solutions cacti-0.8.8a]# vi /etc/httpd/conf.d/cacti.conf

#

# Cacti: An rrd based graphing tool
#
# Change the following ACLs to open up Cacti to other network devices.
# For example:
# On httpd 2.4, change “Require host localhost” to “Require all granted”.
# On httpd 2.2, change “Allow from localhost” to “Allow from all”.
Alias /cacti    /usr/share/cacti
<Directory /usr/share/cacti/>
<IfModule mod_authz_core.c>
# httpd 2.4
Require host localhost
</IfModule>
<IfModule !mod_authz_core.c>
# httpd 2.2
Order deny,allow
Deny from all
Allow from localhost
  Allow from 192.168.0.2 192.168.0.10      
</IfModule>
</Directory>
<Directory /usr/share/cacti/install>
# mod_security overrides.
# Uncomment these if you use mod_security.
# allow POST of application/x-www-form-urlencoded during install
#SecRuleRemoveById 960010
# permit the specification of the rrdtool paths during install
#SecRuleRemoveById 900011
</Directory>

# These sections marked “Require all denied” (or “Deny from all”)
# should not be modified.
# These are in place in order to harden Cacti.
<Directory /usr/share/cacti/log>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
Save and exit the file.

[root@solutions cacti-0.8.8a]#service httpd reload

Step: 5

Cacti installation wizard screen shots:
Installation step1 (installation, simply select next)

 

Installation step2 (installation or up gradation)

Installation step3 (checks dependencies, simply select  next)

Installation step4 (default user name :admin and password:admin, immediately asked for new password)

 

Installation step5(apply new admin password )

Installation step6 (ready to go)

 how to install cacti , cacti installation steps , cacti installation on centos , cacti installation on centos 6.2 , cacti installation on centos 6.3

 

Both comments and pings are currently closed.

Comments are closed.

Copyright ©Solutions@Experts.com
Copyright © NewWpThemes Techmark Solutions - www.techmarksolutions.co.uk