Cacti+nagios Monitoring System (II): Installation Cacti

Source: Internet
Author: User

First, set up MySQL, create cacti database and account

mysql-u root-p

mysql> CREATE DATABASE Cactidb;

Mysql> GRANT all on cactidb.* to [e-mail protected] identified by ' 123456 ';

mysql> flush Privileges;

Mysql> quit

Second, installation RRDtool

yum-y Install RRDtool rrdtool-devel rrdtool-php

Third, install the configuration SNMP

Yum install-y net-snmp net-snmp-utils net-snmp-libs

vi/etc/snmp/snmpd.conf

Can modify community default password public

Service snmpd Restart

chkconfig snmpd on

Iv. Download and install cacti

Mkdir/root/download

Cd/root/download

wget http://www.cacti.net/downloads/cacti-0.8.8b.tar.gz

tar xzf cacti-0.8.8b.tar.gz

MV Cacti-0.8.8b/var/www/html/cacti

Cd/var/www/html/cacti

Mysql-uroot-p Cactidb < Cacti.sql

Five, configuration parameters

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

$database _type = "MySQL";
$database _default = "CACTIDB";
$database _hostname = "localhost";
$database _username = "Cactier";
$database _password = "123456";
$database _port = "3306";
# $url _path = "/cacti/";

Vi. adding users, modifying permissions, and Owner

Useradd Cactier

passwd Cactier

123456

usermod-g cactier Apache

Chown-r root:root/var/www/html/cacti/

cd/var/www/html/cacti/

Chown-r Cactier:cactier rra/log/

Vii. Apache Settings

vi/etc/httpd/conf/httpd.conf

<directory "/var/www/html/cacti" >
Options FollowSymLinks MultiViews
AllowOverride None
Order Allow,deny
Allow from all
</Directory>

Vi/etc/php.ini

Date.timezone=asia/shanghai

Service httpd Restart

Viii. Adding a plan

crontab-e

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

Updated RRD graphics every 5 minutes, Poller is a single-threaded thread, and can be switched to multi-threaded and distributed tools spine

Service Crond Restart

Synchronizing system time

ntpdate 65.55.56.206

Switch users

Su-cactier

Generate the RRD graphics file in the RRA directory after manual execution

php/var/www/html/cacti/poller.php

You can also wait 5 minutes without performing a manual operation, observing if the RRD file is automatically generated in the RRA directory

IX. Web Installation

Http://localhost/cacti

User name Admin Password admin

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/42/2C/wKioL1PW-YKBo0uKAABz0YGe290727.jpg "style=" float: none; "Title=" image (4). png "alt=" wkiol1pw-ykbo0ukaabz0yge290727.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/42/2B/wKiom1PW-Giz4bfBAAC7y_nphu8108.jpg "style=" float: none; "Title=" image (3). png "alt=" wkiom1pw-giz4bfbaac7y_nphu8108.jpg "/>650" this.width=650; "src=" http:/ S3.51cto.com/wyfs02/m01/42/2c/wkiol1pw-ylbjufeaadkz_lps1u018.jpg "title=" image (2). png "style=" Float:none; "alt=" Wkiol1pw-ylbjufeaadkz_lps1u018.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/42/2B/wKiom1PW-B6h772pAACVb1t-ORY806.jpg "title=" image. png "alt=" Wkiom1pw-b6h772paacvb1t-ory806.jpg "/>


X. Testing and collecting data

1. View the data in the RRD file

Cd/var/www/html/cacti/rra

RRDtool fetch-r localhost_mem_buffers_3.rrd AVERAGE

Date +%s

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/42/2E/wKioL1PXBHeDA1MJAABtWckp_Ig700.jpg "title=" image (5). PNG "alt=" wkiol1pxbheda1mjaabtwckp_ig700.jpg "/>

-Nan means no data, and data is fetched every 300 seconds.

2. Check the update time in MySQL

mysql-uroot-p123456

Use CACTIDB;

SELECT * from Poller_time;

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/42/2E/wKioL1PXBMrB8WEbAABbohlFXxc501.jpg "title=" image (6). PNG "alt=" wkiol1pxbmrb8webaabbohlfxxc501.jpg "/>

Normal words are updated every five minutes.

3. Data not collected?

(1) Clear the cache system utilities-->rebuild Poller caches on the Web page

(2) Modify RRA permissions #chmod 777-r/srv/www/htdocs/cacti/rra

(3) Update system time #ntpdate 65.55.56.206

4. Test SNMP Fetch Data

snmpwalk-v 2c-c Public < target machine Ip> system

This article is from the "Moon Ching Xing Fei" blog, please be sure to keep this source http://ywzhou.blog.51cto.com/2785388/1531906

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.