Cacti installation documentation

Source: Internet
Author: User
Tags rrdtool
Environment: centos5.4 & nbsp; cacti Server Address: 192.168.1.1001. use yum source to automatically install rrdtool (for plotting) # vi/etc/yum. repos. d/dag. repo [dag] nameDagRPMRepositoryforRedHatEnterpriseLinuxbaseurlhttp: // apt

Environment: centos 5.4 cacti Server Address: 192.168.1.100
1. automatic installation of rrdtool through yum source (for plotting)
# Vi/etc/yum. repos. d/dag. repo
[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
Then install yum:
# Yum install rrdtool
2. install the lamp environment (refer to the lamp installation I wrote)
Note:
A. You need to add the parameter -- enable-sockets to compile php. Otherwise, an Error will be prompted when you access cacti.
The following PHP extensions are missing:
* Sockets
Please install those PHP extensions and retry
B. lamp requires gd support
3. install snmp
# Yum install net-snmp-devel net-snmp-utils net-snmp
Modify the snmp configuration file and set the management string to testsnmp for security.
A. change com2sec notConfigUser 127.0.0.1 public
Com2sec notConfigUser 127.0.0.1 testsnmp
Modify access notConfigGroup "" any noauth exact systemview none to: access notConfigGroup "" any noauth exact all none
Delete the # Number of the following line
View all supported DED. 1 80
B. restart snmp and set startup of the startup service.
Service snmpd restart
Chkconfig -- levels 35 snmpd on
4. install cacti
Mkdir? P/usr/local/httpd/htdocs/cacti
Tar? Zxvf cacti-0.8.7g.tar.gz
Cd cacti-0.8.7g
Mv */usr/local/httpd/htdocs/cacti
Chmod + w/usr/local/httpd/htdocs/cacti
5. start apache
/Usr/local/httpd/bin/apachectl start
6. log on to mysql using mysql root to create a cacti database.
Create database cacti;
Use cacti
Source/usr/local/httpd/htdocs/cacti. SQL
7. to improve security, cacti does not apply root to create users corresponding to cacit.
Grant all privileges on cacti. * to cactitest @ "%" identified by "cactitest ";
Flush privileges;
8. modify the cacti configuration file/usr/local/httpd/htdocs/cacti/include/config. php as follows:
 
$ Database_type = "mysql ";
$ Database_default = "cacti ";
$ Database_hostname = "localhost ";
$ Database_username = "cactitest ";
$ Database_password = "cactitest ";
$ Database_port = "3306 ";
9 access http: // 192.168.1.1/cacti through a browser
Select new install
Cacti automatically selects the required software path. If no software path is found, it is manually specified.
PHP Binary Path:/usr/local/php/bin/php
10 cacti default administrator password is admin
11 Use the following command to generate an initial image file
/Usr/local/php/bin/php/usr/local/httpd/htdocs/cacti/poller. php>/dev/null 2> & 1
12 Use crontab? E. add automatic execution content.
*/5 */usr/local/php/bin/php/usr/local/httpd/htdocs/cacti/poller. php>/dev/null 2> & 1
13. log onto the system and click graphs. The system collects data once every five minutes by default.
14 considering that the interval between 5-minute data collection is too large, please change it to 1 minute
A. change crontab from 5 minutes to 1 minute.
B. change console-settings-poller Poller Interval and Cron Interval to-save every minute.
C. change the Data Sources step (sampling time) to 60, and heartbeat (timeout) to 120. you can also use the SQL command to modify it.
Use cacti
UPDATE data_template_data SET rrd_step = 60 WHERE rrd_step = 300;
UPDATE data_template_rrd SET rrd_heartbeat = 120 WHERE rrd_heartbeat = 600;
UPDATE poller_item SET rrd_step = 60 WHERE rrd_step = 300;
D. modify RRAs to set the display time to 1 minute, and retain the drawing time to 5 minutes.
Reduce the steps of RRAS by five times, and increase Rows by five times. you can also use SQL statements
Mysql> delete from rra;
Mysql> insert into rra values (1, "c21df5178e5c955013591239eb0afd46", "Daily (1 Minute Average)", 0.5, 86400 );
Insert into rra values (2, "0d9c0af8b8acdc7807943937b3208e29", "Weekly (30 Minute Average)", 0.5, 604800 );
Insert into rra values (3, "6fc2d038fb42950138b0ce3e9874cc60", "Monthly (2 Hour Average)", 0.5, 2678400 );
Insert into rra values (4, "e36f3adb9f152adfa5dc50fd2b23337e", "Yearly (1 Day Average)", 0.5, 1440,1600, 33053184 );
E. discard the data obtained every five minutes and delete all the files in the rra directory.
Rm? Rf/usr/local/httpd/htdocs/cacti/rra /*
 
Next we configure a local monitoring object to monitor Nic traffic
1. select console-device and click add.
2. on the add monitoring site page, enter the Description. enter 127.0.0.1 as the IP address (Hostname) of the monitoring Host, and set Host Templete to ucd/net, select Version 2 SNMP Community for Snmp Host SNMP Options and fill in testsnmp. Click create and then click save in the pop-up window. If snmp information appears, the configuration is successful.
3. click Create Graphs for this Host in the upper-right corner to check the box on the right of the NIC and then click create
4. to view the graphic interface in graph, click Graph Trees point Default Tree and click Add.
Select root for Parent Item, Host for Tree Item Type, Host for Host, Graph Grouping Style for Graph Template, click Create, and then click save.
The network card traffic diagram will be displayed in graphs in a few minutes.

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.