Build cacti monitoring under Linux

Source: Internet
Author: User
Tags php language rrd rrdtool snmp

I. Introduction of CACTI monitoring software
1. Cacti is a PHP language implementation of a software, its main function is to use the SNMP service to obtain data, and then use RRDtool to store and update data, when the user needs to view the data with the RRDtool to generate a chart presented to the user. Therefore, SNMP and RRDtool are the key to cacti. SNMP is related to the collection of data, RRDtool is related to data storage and chart generation.
2. mysql with PHP program to store some variable data and call the variable data, such as: Host name, host IP, SNMP community name, port number, template information and other variables
3. The SNMP catch data is not stored in MySQL, but exists in the RRDtool generated RRD file (under the Rra folder in the cacti root directory). RRDtool Data Update and storage is the RRD file processing, the RRD file is a fixed size of the file (roundrobinarchive), it can store the number of data is defined at the time of creation.

Second, monitoring installation

1. Shutting down firewalls and SELinux

/ent/init.d/iptables Stop chkconfig iptables off permanently off

Setenforce 0 vim/etc/sysconfig/selinux Change selinux=enforcing to selinux=disabled (permanently closed)

2. Installing cacti-dependent software

Yum-y install MySQL mysql-server mysql-devel httpd php php-pdo php-snmp php-mysql lm_sensors net-snmp net-snmp-ut Ils net-snmp-libs rrdtool rrdtool-devel perl-plrpc perl-dbi perl-rrdtool perl-dbd-mysql

3. After you have installed the dependent software, SNMP has three places to configure

Vim/etc/snmp/snmpd.conf

41 line default changed to 127.0.0.1

62 Row SystemView to all

85 rows will be #view all include. 1 80 the # in front of this line is removed

4. Start three important services

/etc/init.d/mysqld start

/ETC/INIT.D/SNMPD start

/ETC/INIT.D/HTTPD start

5. Installation configuration cacti

Official website 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. Import cacti data to the database

Mysql-uroot-p

Create database cacti;

Grant all privileges the cacti.* to [e-mail protected] identified by ' cacti ' with GRANT option;

Use cacti;

Source/var/www/html/cacti/cacti.sql;

7. Configure cacti

vim/var/www/html/cacti/include/config.php

$database _type = "MySQL";
$database _default = "cacti";
$database _hostname = "localhost";
$database _username = "Cactiuser";
$database _password = "Cactiuser";
$database _port = "3306";

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/89/14/wKioL1gHLmqxF_ExAAAW8O8Qw6s726.png-wh_500x0-wm_3 -wmp_4-s_900775649.png "title=" Cacti configuration file. png "alt=" wkiol1ghlmqxf_exaaaw8o8qw6s726.png-wh_50 "/>

8. Increase cacti users to write data to the RRD and log directories, otherwise they will not generate pictures
Useradd cacti

Cd/var/www/html/cacti

Chown-r Cacti rra/log/

9. Add a task schedule

Crontab-e

*/1 * * * * php/var/www/html/cacti/poller.php >/dev/null 2>&1

10. Enter IP/CACTI on the web side

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/89/15/wKioL1gHMxTD4-LFAABb5p9ZZ9Y512.png-wh_500x0-wm_3 -wmp_4-s_787976030.png "title=" Web Interface installation 1.png "alt=" Wkiol1ghmxtd4-lfaabb5p9zz9y512.png-wh_50 "/>

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/89/17/wKiom1gHMxTynn_RAAB6bwvA4JU736.png-wh_500x0-wm_3 -wmp_4-s_1747374657.png "title=" comes with Localhost.png "alt=" Wkiom1ghmxtynn_raab6bwva4ju736.png-wh_50 "/>

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M02/89/15/wKioL1gHM0TgkWhOAACUcWAs7Og300.png-wh_500x0-wm_3 -wmp_4-s_2842418549.png "title=" cacti landing interface. png "alt=" wkiol1ghm0tgkwhoaacucwas7og300.png-wh_50 "/>

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/89/17/wKiom1gHM0TBWrHeAADgKKlvxGg830.png-wh_500x0-wm_3 -wmp_4-s_4249150996.png the first interface after the "title=" cacti interface. png "alt=" wkiom1ghm0tbwrheaadgkklvxgg830.png-wh_50 "/>


Can look at the computer's graphical data monitoring

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/89/17/wKiom1gHM7SjCJ8EAAFXOti0ef8666.png-wh_500x0-wm_3 -wmp_4-s_3267667053.png "title=" 111.png "alt=" Wkiom1ghm7sjcj8eaafxoti0ef8666.png-wh_50 "/>

Build cacti monitoring under Linux

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.