CentOS + Cacti installation Configuration

Source: Internet
Author: User
Tags rrdtool import database


####################################
# Cacti Configuration
# Date: 2009-11-04
# Env: Centos 5.4 x86_64
# Author:
Http://www.chengyongxu.com/blog/centoscacti%E5%9F%BA%E6%9C%AC%E5% AE %89%E8%A3%85%E9%85%8D%E7%BD% AE/
####################################
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 = 1
Yum 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

Related Article

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.