Detailed instructions on Cacti Installation

Source: Internet
Author: User
Tags rrd rrdtool snmp http blank page

Cacti is a set of graphic analysis tools for network traffic monitoring developed based on PHP, MySQL, SNMP, and RRDTool. Cacti uses snmpget to obtain data and uses RRDtool to draw images. In addition, you do not need to understand the complex parameters of RRDtool. It provides powerful data and user management functions, allowing each user to view the tree structure, host, and any graph, and perform user verification with LDAP, you can also add templates by yourself, which are very powerful and complete. User-friendly. The development of the software Cacti is based on making it easier for RRDTool users to use the software. In addition to the basic Snmp traffic and system information monitoring, cacti can also plug-in Scripts and add Templates to make a variety of monitoring charts.
Cacti is a software implemented in php. Its main function is to use the snmp service to obtain data and then use rrdtool to store and update data, when you need to view data, use rrdtool to generate charts and present them to users. Therefore, snmp and rrdtool are the key to cacti. Snmp is related to data collection, and rrdtool is related to data storage and chart generation.
Mysql works with PHP programs to store some variable data and call the variable data, such as the host name, Host ip address, snmp group name, port number, template information, and other variables.
The data captured by snmp is not stored in mysql, but in the rrd file generated by rrdtool (in the rra folder of the cacti root directory ). Rrdtool updates and stores data as rrd files, and rrd files as Round Robin Archive files ), the number of data records it can store has been defined at the time of creation. For more information about RRDTool, see RRDTool.
Preparations:
Cacti Official Website: http://www.cacti.net/download_cacti.php
Find the Linux/Unix in tar.gz format connection icon,
: Http://www.cacti.net/downloads/cacti-0.8.8b.tar.gz
: Http://www.cacti.net/downloads/spine/cacti-spine-0.8.8b.tar.gz
Net-snmp-develmysqlmysql-developenssl-devel
Prepare required software packages
Apache http://www.apache.org/
Mysql http://www.mysql.com/
Php http://www.php.net
Rrdtool http://oss.oetiker.ch/rrdtool/
Net-snmp http://www.net-snmp.org/
Cacti http://www.cacti.net/
Install apache, mysql, and php using yum
The following describes the installation process:
1. Install RRDTool and SNMP
1. Install RRDTool
Wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.8.tar.gz
Chkconfig also failed
2. Install the snmp support tool
You can install yum or source code, such
Wget http://sourceforge.net/projects/net-snmp/files/net-snmp/5.6.2.1/net-snmp-5.6.2.1.tar.gz/download
Yum-y install net-snmp
3 install LAMP
[Root @ cacti ~] # Yum-y install httpd mysql-server php-mysql-devel
[Root @ cacti ~] # Chkconfig httpd on
[Root @ cacti ~] # Chkconfig mysqld on
[Root @ cacti ~] #/Etc/init. d/httpd start
[Root @ cacti ~] #/Etc/init. d/mysqld start
After starting httpd, you can openHttp://10.xx.1.xx/The interface is as follows:



Ii. Download cacti
Download the latest version of wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8b.tar.gz
And cacti-spine, http://www.cacti.net/downloads/spine/
Download the latest version of cacti-spine, wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8b.tar.gz
3. Start InstallationCacti-spine
1. Create a cacti user
[Root @ squid-2 ~] # Useradd-m cacti
[Root @ squid-2 ~] # Passwd cacti
Password: cacti
2. install several devel packages required for cacti-spine Compilation:
3. Install gcc and libtool
4. Download cactid and unzip it:
5. After the installation, We need to configure it again:

Vim/etc/spine. conf
6. Start it.
#/Usr/local/spine/bin/spine
 General display
SPINE: Using spine config file [/etc/spine. conf]
7. Create a mysql account:
Mysql> set names utf8;
Log on to mysql and delete the mysql account ''@ localhost and'' @ hostname.

[Cacti @ squid-2 ~] $/Usr/local/spine/bin/spine
Find the running mysql. sock path and make a soft connection:

[Root @ mysqlvm2 bin] # find/-name mysql. sock
Start again and report the following error:

[Root @ mysqlvm2 bin] #/usr/local/spine/bin/spine
Export the imported cacti.sqlto decompress .tar.gz and obtain cacti. SQL

[Cacti @ squid-2 cacti-0.8.8b] tar-xvf cacti-0.8.8b.tar.gz
Started successfully.

8. After cacti is installed, select setting on the cacti web configuration page.

4. start installing the master cacti

1 Configuration

Decompress the package and put it in the apache document directory (/var/www/html)

Cd/var/www/html/

Vim/var/www/html/cacti/include/config. php 

2. Add a scheduled task (so that cacti obtains data every 5 minutes)

3. Database Configuration

You have configured the database cacti and the user in the first step.

4. Create a login. jsp file

[Root @ mysqlvm2 cacti] # vim login. php

Simple demo

<? Php

Phpinfo ();

?>

As shown in:

Open the URL page:
 

After starting httpd, you can open http://10.xx.1.xx/. the interface is as follows:

 

If you encounter a small problem, open the index. php is a blank page, as shown below:

View logs without any information:

Where is the problem?

Find the apache configuration file httpd. conf.

[Root @ mysqlvm2 www] # vim/etc/httpd/conf/httpd. conf

View the log information one by one and find the error information in ssl_error_log:

[Root @ mysqlvm2 httpd] # tail-f ssl_error_log

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.