I. Preparations
Environment: centos 5.4 x86_64
Required software:
HTTP
PHP
Php-MySQL
Php-SNMP
MySQL
Perl-DBD-MySQL
Php-PDO
Rrdtool
Net-snmp
Net-snmp-libs
Net-snmp-utils
# Download related software
CD/usr/local/src/
Wget http://www.cacti.net/downloads/cacti-0.8.7e.tar.gz
II. Environment Introduction
The master monitoring machine is centos 5.4 x86_64
Master monitoring machine IP = 10.0.0.52
Iii. installation and configuration
(1) install the Apache + PHP + GD web environment on the main monitoring machine. It is recommended that you compile and install the environment.
Yum install PHP-mysql PHP-SNMP MySQL mysql-Server net-snmp-libs net-snmp-utils PHP-PDO Perl-DBD-MySQL
(2) install rrdtool on the main monitoring machine. There are too many packages that rrdtool depends on. Therefore, add the source and install it with yum.
# Add source
VI/etc/yum. Repos. d/CentOS-Base.repo
# Add the following parts at the end of the file
[Dag]
Name = Dag RPM repository for Red Hat Enterprise Linux
Baseurl = http://apt.sw.be/redhat/el?releasever/en/?basearch/dag
Gpgcheck = 1
Gpgkey = http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
Enabled = 1yum install rrdtool
(3) Configure SNMP
VI/etc/snmp. conf
# Set the default value in the following line
Com2secnotconfiguser default public
# Change to 127.0.0.1
Com2secnotconfiguser 127.0.0.1 public
# Set systemview in the following line
Access notconfiggroup "" any noauth exact systemview none
# Change to all
Access notconfiggroup "" any noauth exact all none
# Remove the comment "#" in the following line
# View all supported ded. 1 80
# Restart the snmpd service
Service snmpd restart
(4) install cacti
# Move the decompressed package to your corresponding web directory
Tar xvf cacti-0.8.7e.tar.gz
Music cacti-0.8.7e/var/www/html/cacti
(5) Create, authorize, and import database structures in the database
# Note the file path when importing cacti. SQL
Mysql-P
Mysql> Create Database cacti;
Mysql> grant all privileges on cacti. * to cacti @ localhost identified by 'cacti' with grant option;
Mysql> grant all privileges on cacti. * To cacti@127.0.0.1 identified by 'cacti' with grant option;
Mysql> Use cacti;
Mysql> source/var/www/html/cacti. SQL;
# Configure cacti to connect to the database
VI/var/www/html/cacti/include/config. php
(6) browser configuration
# Open http: // 10.0.0.52/cacti in a browser, and the cacti Installation Guide is displayed.
# Click "Next"
# Select "new install" and click "Next"
# Specify the binary file paths of the rrdtool, PHP, and SNMP tools to ensure that "found" is displayed for all paths without "not found". Click Finish to complete the installation.
# The default cacti user name and password are admin. Enter the user name and password and click Login.
# For security reasons, after the first successful login, cacti will force you to change a new password, enter the new password and confirm the password, and click Save to go To the cacti console interface:
# Click graphs to view the chart of the cacti monitoring machine:
(7) Add a scheduled task so that cacti generates a Monitoring Chart every five minutes.
Crontab-e
# Add the following content. Note the poller. php path.
*/5 * PHP/var/www/html/cacti/poller. php>/dev/null 2> & 1
# Ensure that the/var/www/html/cacti/RRA/directory exists
# If no chart is displayed for the moment, you can manually generate a chart
# PHP/var/www/html/cacti/poller. php>/dev/null 2> & 1
(8) Use cacti to monitor Linux Hosts
# Install net-snmp on the monitored Linux host
Yum install net-snmp
VI/etc/snmp/snmpd. conf
# Modify the following parts
# Set the default value in the following line
Com2secnotconfiguser default public
# Change to 10.0.0.52 (cacti) server address)
Com2secnotconfiguser 10.0.0.52 public
# Set systemview in the following line
Access notconfiggroup "" any noauth exact systemview none
# Change to all
Access notconfiggroup "" any noauth exact all none
# Remove the comment "#" in the following line
# View all supported ded. 1 80 service snmpd restart
(9) If any problem occurs, please note that version 1 is a solution for the SNMP protocol.
If version 1 is used, you need to change snmpd. conf of all invigilators and invigilators.
# Vi/etc/snmp/snmpd. conf
# Set the following line
View systemview embedded ded. 1.3.6.1.2.1.1
# Change
View systemview embedded ded. 1.3.6.1.2.1