1. Install lamp environment
There is no introduction, a bunch of related documents on the Internet, and a lot of automated installation scripts written by cattle.
2. Installing RRDtool
Yum install cairo-devel libxml2-devel Pango pango-devel rrdtool–y
3. Install SNMP
The operating system typically comes with SNMP, if not installed
Yum-y Install NET-SNMP net-snmp-libs net-snmp-utils
4. Installing cacti
(1) Download cacti
#wget http://www.cacti.net/downloads/cacti-0.8.8b.tar.gz
#tar-ZXFV cacti-0.8.8b.tar.gz
#mv Cacti-0.8.8b/var/www/html/cacti
#cd/var/www/html/cacti/
(2) Initializing the database
Create a database
Mysql> CREATE DATABASE Nagios default character set UTF8;
Mysql> Grant all privileges the nagios.* to ' nagios ' @ ' localhost ' identified by ' XXXX ' with GRANT option;
Mysql> Grant all privileges the nagios.* to ' nagios ' @ '% ' identified by ' XXXX ' with GRANT option;
mysql> flush Privileges;
Initializing the database
#mysql-unagios-p Nagios<cacti.sql
(3) Configuring connection Information
#cd/var/www/html/cacti/
#vim include/config.php
$database _type = "MySQL";
$database _default = "Nagios";
$database _hostname = "127.0.0.1";
$database _username = "Nagios";
$database _password = "XXXX";
$database _port = "3306";
$database _ssl = false;
(4) Set directory permissions
# Useradd Cactiuser
# chown-r Cactiuser rra/log/
(5) Increased timing tasks
#echo "*/5 * * * * cactiuser php/var/www/html/cacti/poller.php >/dev/null 2>&1" >>/etc/crontab
#每5分钟以cactier去抓取数据绘图, this time 5 minutes should be the minimum interval, it is not recommended to modify to a smaller value.
#service Crond Restart
#service httpd Restart
Visit http://172.18.1.113/cacti
First access no data graph can do the following, be sure to use cactiuser, otherwise the normal scheduled task does not have permission to write to the file
# Su-cactiuser
#php/var/www/html/cacti/poller.php >/dev/null 2>&1
This article is from the "No Technology Madness" blog, please be sure to keep this source http://s8576.blog.51cto.com/9510968/1745537
Open Source Monitoring Solution Nagios+cacti+pnp4nagios+nconf+ndoutils+nagvis (v) Cacti installation