Full Process of Cacti installation and configuration

Source: Internet
Author: User
Tags rrdtool

Full Process of Cacti installation and configuration

Cacti is a set of network traffic monitoring graphical analysis tools developed based on PHP, MySQL, SNMP, and RRDTool. It uses snmpget to obtain data and draw images using RRDtool, and 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. It can also be used with LDAP for user verification, you can also add templates by yourself, which are very powerful and complete.

Basic information:

OS: RHEL 5.8

SOFT: apr-util-1.4.1.tar.bz2 cmake-2.8.6.tar.gz libmcrypt-2.5.8.tar.gz php-5.4.36.tar.bz2

Rrdtool-1.4.7.tar.tar apr-1.4.6.tar.bz2 cacti-0.8.8c.tar.gz httpd-2.4.2.tar.bz2

Mysql-5.5.22.tar.gz php-5.4.5.tar.bz2

First, compile and install the LAMP platform. We recommend that you uninstall the corresponding rpm package. Otherwise, problems may occur during program collaboration.

1. install apr and apr-util:


2. tar xf apr-1.4.6.tar.bz2

Cd apr-1.4.6

./Buildconf

./Configure -- prefix =/usr/local/apr

Make

Make install

 

Tar xf apr-util-1.4.1.tar.bz2

 

Cd apr-util-1.4.1

./Configure -- prefix =/usr/local/apr-util -- with-apr =/usr/local/apr

Make

Make install


3. install apache:

Yum-y install pcre-devel

Tar xf httpd-2.4.2.tar.bz2

Cd httpd-2.4.2

. /Configure -- prefix =/usr/local/apache -- sysconfdir =/etc/httpd -- enable-so -- enable-suexec -- enable-ssl -- enable-rewrite -- -zlib -- with-pcre -- with-apr =/usr/local/apr -- with-apr-util =/usr/local/apr-util -- enable-modules = most -- enable -modules-shared = most -- enable-mpms-shared = all

Make

Make install

 

Echo "PATH = \ $ PATH:/usr/local/apache/bin">/etc/profile

Export PATH = $ PATH:/usr/local/apache/bin

Echo "MANPATH/usr/local/apache/man">/etc/man. config

Ln-sv/usr/local/apache/include/usr/include/httpd


4. install cmake:

Tar xf cmake-2.8.8.tar.gz

Cd cmake-2.8.8

./Bootstrap

Make

Make install


5. install mysql

Groupadd-r mysql

Useradd-g mysql-r-d/data/mysql

Tar xf mysql-5.5.22a.tar.gz

Cd mysql-5.5.22a

Cmake. -DCMAKE_INSTALL_PREFIX =/usr/local/mysql-DMYSQL_DATADIR =/data/mysql-DSYSCONFDIR =/etc-region = 1-region = 1-region = 1-DWITH_READLINE = 1-DWITH_SSL = system-DWITH_ZLIB = system-DWITH_LIBWRAP = 0-DDEFAULT_CHARSET = utf8-DDEFAULT_COLLATION = utf8_general_ci-DENABLE_PROFILING = 1

Make

Make install

 


6. cd/usr/local/mysql


Chown-R: mysql.

Mkdir-pv/data/mysql

Chown-R mysql: mysql/data/

Cp/usr/local/mysql/support-files/my-large.cnf/etc/my. cnf

Cp/usr/local/mysql/support-files/mysql. server/etc/rc. d/init. d/mysqld

Chmod + x/etc/rc. d/init. d/mysqld

Chkconfig -- add mysqld

Scripts/mysql_install_db -- user = mysql -- datadir =/data/mysql

Sed-I '/\ [mysqld \]/a \ datadir =/data/mysql'/etc/my. cnf

Sed-I's/thread_concurrency = 8/thread_concurrency = 2/G'/etc/my. cnf

Echo "PATH = $ PATH:/usr/local/mysql/bin">/etc/profile

Export PATH = $ PATH:/usr/local/mysql/bin

Echo "MATHPATH/usr/local/mysql/man">/etc/man. config

Ln-sv/usr/local/mysql/include/usr/include/mysql

Echo "/usr/local/mysql/lib">/etc/ld. so. conf. d/mysql. conf

Ldconfig

Service mysqld start

6. install php

Before installing php, you may need to install libmcrypt. I can directly compile and install the source code downloaded from chinaunix, and add -- with-mcrypt = DIR when compiling PHP.

Tar xf php-5.4.4.tar.bz2

Cd php-5.4.4

. /Configure -- prefix =/usr/local/php -- with-mysql =/usr/local/mysql -- with-openssl -- with-mysqli =/usr/local/mysql/bin/ mysql_config -- enable-mbstring -- with-freetype-dir -- with-jpeg-dir -- with-png-dir -- with-zlib -- with-libxml-dir =/usr -- enable-xml -- with-apxs2 =/usr/local/apache/bin/apxs -- with-mcrypt -- with-config-file-path =/etc -- with-config-file-scan-dir =/ etc/php. d -- with-bz2 -- enable-sockets

Make

Make install

Cp php-5.4.4/php. ini-production/etc/php. ini

Echo "AddType application/x-httpd-php. php">/etc/httpd. conf

Echo "AddType application/x-httpd-php-source. phps">/etc/httpd. conf

Sed-I's/DirectoryIndex index.html/DirectoryIndex. php index.html/G'/etc/httpd. conf

After all the above operations are completed without errors, you can create a test php page to test whether it is OK. If there is no problem, start to install cacti:

1. I directly set up a VM for cacti:

First modify httpd. conf Add: include/etc/httpd/extra/httpd-vhosts.conf

Then modify http-vhosts.conf:

<VirtualHost *: 80>
DocumentRoot "/usr/local/apache/htdocs/cacti
ServerName cacti.bkjia.com
ErrorLog "log/cacti-error_log"
CustomLog "logs/cacti-access_log" common
</VirtualHost>

2. Install rrdtool:

Tar xf rrdtool-1.4.7.tar.gz

Cd rrdtool-1.4.7

./Configure -- prefix =/usr/local/rrdtool

Make

Make install

Echo "MANPATH/usr/local/rrdtool/share/man">/etc/man. config

Echo "PATH = $ PATH:/usr/local/rrdtool/bin">/etc/profile

Export PATH = $ PATH:/usr/local/rrdtool/bin

Ln-sv/usr/local/rrdtool/include/usr/include/rrdtool

Echo "/usr/local/rrdtool/lib">/etc/ld. so. conf. d/rrdtool. conf

Ldconfig

3. Install net-snmp and net-snmp-util in yum and set automatic running. No detailed commands are provided here.

4. Install cacti

Create a database for cacti and initialize the required tables:

1. mysqladmin create cacti // The password at this time is the mysql password

2. cd/usr/local/apache/htdocs/cacti

3. mysql cacti <cacti. SQL

Create a mysql user and use cacti to access its cacti Database

Mysql-e "grant all on cacti. * TO cactiuser @ localhost identified by 'cactiuser '";

1. // The user cactiuser password is also cactiuser

2. mysqladmin-p flush-privileges

3. mysql-ucactiuser-p // verify if it is correct

Then create a system user cactiuser to run cacti Data Acquisition and logging.

1. useradd cactiuser

2. chown-R cactiuser: cactiuser/usr/local/apache/htdocs/cacti/{log, rra}

Obtain data every five minutes as a cactiuser:

1. echo '*/5 *****/usr/local/php/bin/php/usr/local/apache/htdocs/cacti/poller. php &>/dev/null'>/var/spool/cron/cactiuser

Modify the php time zone:

1. vim/etc/php. ini

2. date. timezone = Asia/Shanghai

Edit the configuration file include/config. php of cacti to enable and modify the following lines:
// $ Url_path = "/cacti /";
Here we will change it:
$ Url_path = "/";

Then open the http://cacti.bkjia.com in the browser, follow the prompts step by step configuration to complete the installation.
When the password is entered for the first time, the password will be changed. By default, the user's admin password is admin.

-------------------------------------- Split line --------------------------------------

In RHEL6.4, the Cacti + Spine monitoring host is used to send mail alarms.

Use Cacti + Spine to monitor remote hosts in RHEL6.4

CentOS 5.5 complete installation of Cacti + Spine

Cacti construction document under CentOS 6

Detailed description of Cacti monitoring deployment under RHEL5.9

How to install Cacti in CentOS 6.3

Quick installation and configuration of Cacti in CentOS Linux

-------------------------------------- Split line --------------------------------------

Cacti details: click here
Cacti: click here

This article permanently updates the link address:

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.