Installation of cacti network monitoring system on CentOS6.7

Source: Internet
Author: User
Tags add time rrdtool snmp

Cacti tool is a set of open source web-based network monitoring and system monitoring graphics solutions. Cacti obtains data through the SNMP service and draws graphics using RRDtool, providing very intuitive data and user management capabilities. Cacti requires web, MySQL, and PHP support. Cacti is typically used to monitor network traffic, usage CPU load, disk space, and so on.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/7A/03/wKioL1agqMHSuWDVAAGQ-kNaHtY778.jpg "title=" 9.jpg " alt= "Wkiol1agqmhsuwdvaagq-knahty778.jpg"/>

Cacti Official website: http://www.cacti.net/


Install cacti packages that need to be installed: Apache, MySQL, PHP, Rrtool, PHP-SNMP, NET-SNMP


First, install the cacti need to install the package

1. Install the extension source

[Email protected] ~]# RPM-IVH http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm

2. Installing Apache

[Email protected] ~]# yum-y install httpd httpd-devel

3. Install MySQL

[Email protected] ~]# yum-y install MySQL Mysql-server

4. Installation of PHP and related software

[email protected] ~]# yum install php php-mysql php-gd php-pear php-devel php-common php-cli php-mbstring php-mcrypt

5. Start Apache, MySQL

[[email protected] ~]# chkconfig httpd on[[email protected] ~]# chkconfig mysqld on[[email protected] ~]# service HTTPD St Art[[email protected] ~]# service mysqld start[[email protected] ~]# mysqladmin-uroot password dbpasswd; set root user password

6. Installation of PHP-SNMP and NET-SNMP

[Email protected] ~]# yum-y install php-snmp net-snmp net-snmp-utils net-snmp-libs

7, installation RRDtool

[Email protected] ~]# yum-y install RRDtool

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/79/FD/wKioL1agUPiRcShDAABcj__hdVY812.jpg "title=" 6.jpg " alt= "Wkiol1agupircshdaabcj__hdvy812.jpg"/>

Second, installation cacti

1. Download cacti-0.8.8f.tar.gz

[Email protected] ~]# wget http://www.cacti.net/downloads/cacti-0.8.8f.tar.gz


2, extract to the site directory/var/www/html/

[Email protected] ~]# tar zxf cacti-0.8.8f.tar.gz

[Email protected] ~]# MV Cacti-0.8.8f/var/www/html/cacti

[Email protected] ~]# chown-r apache.apache/var/www/html/


3. Create cacti database, user and password

[[email protected] ~]# mysql -uroot -penter password: welcome to  The mysql monitor.  commands end with ; or \g.your mysql  connection id is 9server version: 5.1.73 source distributioncopyright   (c)  2000, 2013, Oracle and/or its affiliates. All rights  Reserved. oracle is a registered trademark of oracle corporation and/or  Itsaffiliates. other names may be trademarks of their respectiveowners . 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  ' Cactipass '; query ok, 0 rows affected  (0.01 sec) mysql> flush privileges; query ok, 0 rows affected  (0.04 sec) Mysql> quitbye

4. Import Cacti Database files

[Email protected] ~]# mysql-uroot-p cacti </var/www/html/cacti/cacti.sql


5, modify the cacti related MySQL database configuration file

[Email protected] ~]# vim/var/www/html/cacti/include/config.php
/* Make sure these values refect your actual database/host/user/password * * $database _type = "MySQL"; $database _default = "C Acti "; $database _hostname =" localhost "; $database _username =" cacti "; $database _password =" Cactipass "; $database _port = "3306"; $database _ssl = false;


6. Add Firewall rule to allow external access to port 80

[[email protected] ~]# iptables-a input-p UDP--dport 80-j accept[[email protected] ~]# iptables-a input-p TCP--dpor T 80-j accept[[email protected] ~]# service Iptables Save


7, configure cacti Virtual host file, create/etc/httpd/conf.d/cacti.conf, allow 192.168.1.0 network segment access

[Email protected] ~]# vim/etc/httpd/conf.d/cacti.confalias/cacti/var/www/html/cacti<directory/var/www/html/ Cacti/> Order Deny,allow Deny from all to 192.168.1.0/24</directory>


8, adjust the system time, and modify the php.ini corresponding time zone for ' Asia/shanghai '

[Email protected] ~]# Vim/etc/php.inidate.timezone = ' Asia/shanghai ' [[email protected] ~]# ntpdate time.nist.gov

Add time synchronization Scheduled Tasks

0 * * * */usr/sbin/ntpdate time.nist.gov;hwclock-w


9, configure cacti poll PHP script, add cron scheduled task, let it execute every five minutes to generate image display

*/5 * * * */usr/bin/php/var/www/html/cacti/poller.php
[Email protected] ~]#/usr/bin/php/var/www/html/cacti/poller.phpok u:0.00 s:0.01 r:0.08ok u:0.00 s:0.01 R:0.10OK u:0.00 s:0.01 r:0.11ok u:0.00 s:0.01 r:0.13ok u:0.00 s:0.01 r:0.1901/21/2016 03:15:01 pm-system stats:time:0.3285 Method:cmd. PHP processes:1 threads:n/a hosts:2 hostsperprocess:2 datasources:5 rrdsprocessed:5


10. Restart Service

[[Email protected] ~]# service httpd restart[[email protected] ~]# service mysqld restart[[email protected] ~]# service SN MPD restart[[email protected] ~]# service Crond restart


11, Browser login http://IP/cacti/install/complete the installation Wizard

650) this.width=650; "src=" http://s5.51cto.com/wyfs02/M01/7A/00/wKioL1aggwnBNB_-AAFgGoHIBts880.jpg "title=" 7.jpg " alt= "Wkiol1aggwnbnb_-aafggohibts880.jpg"/>

Cacti default login user and password are admin, according to the prompt to modify, into the cacti web interface

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/7A/00/wKioL1agg5_i1dssAADKHJGyKBs790.jpg "title=" 8.jpg " alt= "Wkiol1agg5_i1dssaadkhjgykbs790.jpg"/>

Installation Complete



Installation of cacti network monitoring system on CentOS6.7

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.