Centos 6 installs Cacti to monitor network traffic
Centos 6 installs Cacti to monitor network traffic
1. Installation of the operating system, there is no need to write tutorials (briefly) I personally use CentOS6.5 minimized installation
Turn off the firewall and selinux after installing the system
# service iptables stop / * disable firewall service * /
# chkconfig iptables off / * permanent shutdown * /
# vim / etc/sysconfig/selinux / * change SELINUX=enforcing to SELINUX=disabled*/
2. Install the software that cacti depends on
# yum-y install mysql mysql-server mysql-devel httpd php php-pdo php-snmp php-mysql lm_sensors net-snmp net-snmp-utils net-snmp-libs rrdtool rrdtool-devel perl-PlRPC perl-DBI perl-rrdtool perl-DBD-MySQL
3. After installing the dependency software, snmp needs to be configured in three places
# vim / etc/snmp/snmpd.conf
Line 41: change "default" in com2sec notConfigUser default public to "127.0.0.1"
Line 62: change "systemview" in "access notConfigGroup"any noauth exact systemview none none" to "all"
Line 85: remove the # sign before the line # view all include. 180
4. After configuring snmp, let's start three important services
# service snmpd start / * start snmp service * /
# chkconfig snmpd on / * set boot * /
# service httpd start
# chkconfig httpd on
# service mysqld start
# chkconfig mysqld on
5. Install and configure cacti
# wget http://www.cacti.net/downloads/cacti-0.8.8b.tar.gz
# tar-zxvf cacti-0.8.8b.tar.gz & & mv cacti-0.8.8b / var/www/html/cacti
6. Set up mysql database
Mysqladmin-u root password
# mysql-uroot-p / * the newly installed mysql does not have a password, so enter directly into the mysql database * /
Mysql > create database cacti; / * first create the cacti database, be careful not to lose the semicolon * /
Mysql > grant all privileges on cacti.* to cacti@localhost identified by 'cacti' with grant option; / * create cacti user and authorize * /
Mysql > use cacti
Mysql > source / var/www/html/cacti/cacti.sql; / * Import cacti database file * /
Mysql > exit
7. Configure cacti
# vim / var/www/html/cacti/include/config.php
$database_type = "mysql"
$database_default = "cacti"
$database_hostname = "localhost"
$database_username = "cactiuser"; / * since the user we previously built in the database is "cacti", the default "cactiuser" here should be changed to "cacti" * /
$database_password = "cactiuser"; / * the default password here should also be changed to "cacti" * /
$database_port = "3306"
8. Add cacti users to write data to rrd and log directories, otherwise pictures will not be generated
# useradd cacti
# cd / var/www/html/cacti
# chown-R cacti rra/ log/
9. Add a task schedule
It is up to cacti to decide how long it takes to generate a monitoring chart. Here, take the default time of 5 minutes for cacti as an example.
# crontab-e
Just join this line and save it.
* / 5 * php / var/www/html/cacti/poller.php > / dev/null 2 > & 1
10. Restart the input http://ip/cacti after configuration