Thursday, June 27, 2013

Install cacti in centos server

SHARE

Install cacti in Centos server

 
Install cacti in centos server


Hi to all.
all of admins know Cacti is an open-source, web-based network monitoring and graphing tool designed as a front-end application for the open-source, industry-standard data logging tool RRDtool.
In this Article you will be learning how to install Cacti and installed it on CentOS 6 system.


Step 1 – Prerequisites

First we need to install some of the software packages needed for Cacti to run properly. Software which is not included or enabled in the base CentOS 6 installation are:
  • rrdtool
  • apache
  • mysql
  • cron
  • gcc
Let’s use yum to get these installed.

yum -y install mysql-server php php-cli php-mysql net-snmp-utils rrdtool 
  php-snmp gcc mysql-devel net-snmp-devel autoconf automake libtool dos2unix
 
gcc and the devel packages are required for the installation of spine, hence that’s why we include it here.
Now let’s make sure that our webserver and the database are automatically starting up after a reboot. Use the following commands to enable these:

chkconfig httpd on
chkconfig mysqld on
chkconfig crond on
 
Now that we did make sure that these services start after a reboot, let’s start them manually now in order to continue the installation. Cron may already be running so don’t panic if you don’t see the usual start message:


/etc/init.d/httpd start
/etc/init.d/mysqld start
/etc/init.d/crond start



Step 2 – Cacti Files

Let’s now move to the actualy installation of Cacti. First we need to download and extract it. As of version 0.8.8, a fully patched Cacti including the Plugin Architecture (PIA) is officially available, so we’re downloading that one:

cd /var/www/html
wget http://www.cacti.net/downloads/cacti-0.8.8a.tar.gz
tar -xzvf cacti-0.8.8a.tar.gz
 
I usually suggest to create a symbolic link to the newly created directory “cacti-0.8.8a”. This will make upgrades to never Cacti versions easier:

ln s cacti-0.8.8a cacti

Step 3 – Cron and file permissions

Cacti uses cron (scheduled task) in order to execute its polling process.  It’s always a good idea to run this under a special user. Let’s create the system “cacti” user now:

adduser cacti
 
Having done that, we can now  add a new cron entry to your system for a 5 minute polling interval using the following command:

echo "*/5 * * * * cacti php /var/www/html/cacti/poller.php &>/dev/null" >> /etc/cron.d/cacti

Finally, we also need to make sure that the permissions on the log and rra directories are set correctly:

cd /var/www/html/cacti
chown -R cacti.apache rra log  
chmod 775 rra log

Step 4 – Cacti Database

Now that we have extracted the cacti files, we can move on preparing the database for the final installation step. Your first step should be securing the mysql database. The following command will help you with this task on a CentOS system. Make sure to select a strong password for root, e.g. [email protected]

/usr/bin/mysql_secure_installation
 
Let’s create a new database and assign a special user to it:


mysqladmin -u root -p create cacti
mysql -p cacti < /var/www/html/cacti/cacti.sql
mysql -u root -p
 
With the last command, you should be seing a mysql prompt where you can enter mysql commands. Here we are going to create the special cacti user. That user only needs to be able to connect from the local system and should have a strong password as well. Enter the following commands and make sure to replace the password:

GRANT ALL ON cacti.* TO [email protected] IDENTIFIED BY '[email protected]';
flush privileges;
exit
 
We now have the cacti files and the cacti database setup. The last step before moving to the web-based installer is setting the database credentials within the Cacti config file:

cd /var/www/html/cacti/include/
nano config.php
 
Change the $database_ lines to fit your new settings:


$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "[email protected]";
$database_port = "3306";
$database_ssl = false;
 

Step 5 – Running the Web-based installer


Final Step go to the address of the web like: http://192.168.1.5/cacti
move to  next next next then enter:
User: admin
Password :admin 

If you have any problem to run this please make the following:

cd /etc/httpd/conf.d
nano cacti.conf

then copy to it the following:

Alias /cacti /var/www/html/cacti/
<Directory /var/www/html/cacti/>
Options Indexes FollowSymLinks Includes MultiViews
    Order allow,deny
    Allow from all
</Directory>

save it and restart the apache.
If you need any help don't hesitate to contact me.
SHARE

Author: verified_user

10 comments:

web development company said...

Thanks for this tips.. My problem is solved with your tips.. thanks buddy..

Anonymous said...

The Zooly caseѕ appear in numerous colors, including Clear and Ѕmoκe,
for pеοple indіviduals who don't wish to put in a a little color on their device. So in investigating slideshow much more, I found out there are really two different solutions to this concern: native apps and mobile web sites. Every aspect on the i - OS eco-system is set around be profitable.

My site :: rastreador de celular

Anonymous said...

Post writing is also a fun, if you know then you can write if not it is complex to write.


Look at my weblog :: Password reset

Anonymous said...

Air Jordan Retro Discount Shoes were born in 1992 when he Air Jordan Retro Store USA opened his first in 1992, France
but it rapidly became a worldwide famous brand.

Here is my web site Air Jordan 5 Cool Grey 2011

Anonymous said...

My brother suggested I might like this web site.
He was entirely right. This post actually made my day.
You cann't imagine simply how much time I had spent for
this information! Thanks!

Here is my website :: weight loss supplement

Anonymous said...

Pгеtty great post. Ӏ јust stumbled upon your ωeblog and wiѕhed tο say that I have tгuly enjoyeԁ surfing arojnd
уour blog pоsts. In any саse I
will be subscribing fοr yοuг feed and I
hоpe you write again very soon!

Feell free tto sjrf to mу ωeb page ...

usługi ddd kraków

Anonymous said...

Wow, this paragraph is pleasant, my younger sister is analyzing these things, therefore I am going to tell her.


my homepage - franking machine

Anonymous said...

Forums did not have solutions to get my wireless card working.
Can you probably achieve the same thing by adding some hard liquor to juice.
small businesses, there is no government help for you and if you find some'consider it a gift.



Also visit my site - candy crush saga cheats

Anonymous said...

Water is one of the only must-have types in the game.

"Then at the very least, allow me to suggest that you bring the dead back to life, the same way you did with that Treant. Still, League of Legends offers a reporting system for those that intentionally flame or leave the game in case it is necessary.

Feel free to visit my web page; dota 2 maphack

Anonymous said...

My partner and I stumbled over here coming from a different web address and thought
I may as well check things out. I like what I see so i am just following you.
Look forward to looking at your web page again.

Feel free to surf to my web blog computerrepairsnow