On CentOS, Cacti configures and monitors mysql.

Source: Internet
Author: User
This document introduces how to install and configure Cacti on CentOS and how to monitor mysql using Cacti. At the end of the article, we also attached common troubleshooting methods. I. prepare the working environment: software required for Centos5.4x86 _ 64: httpPhp label: CentOSCacti

This document introduces how to install and configure Cacti on CentOS and how to monitor mysql using Cacti. At the end of the article, we also attached common troubleshooting methods.

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 php-mysql php-snmp mysql mysql-server net-snmp 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 section at the end of the file [dag] name = Dag RPM Repository for Red Hat Enterprise Linuxbaseurl = configure install rrdtool

(3) configure snmp

Vi/etc/snmp. conf # change defaultcom2secnotConfigUser default public # to maid public # change systemviewaccess notConfigGroup "" any noauth exact systemview none # Change to allaccess notConfigGroup "" any noauth exact all none in the following line none # remove the comment "#" in the following line # view all supported ded. 1 80 # restart snmpd service snmpd restart

(4) install cacti

# Move the unzipped package to your corresponding web directory tar xvf cacti-0.8.7e.tar.gzmv cacti-0.8.7e/var/www/html/cacti

(5) create, authorize, and import database structures in the database

# Import cacti. in SQL, the file path is mysql-pmysql> 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-snmpvi /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 none

# Change to all

access notConfigGroup "" any noauth exact all none none

# Remove the comment "#" in the following line

#view all included .1 80service snmpd restart

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.