Installation and configuration of the monitoring tool cacti under centos5.4

Source: Internet
Author: User
Tags cairo file info install php install openssl openssl pear snmp install perl

Installation Requirements:

CentOS5.6

Mysql

Apache

Php

Net-snmp

RRDTool

Spine--Non-essential

Cacti


environment required for deployment of cacti

"Install MySQL"

Rpm-qa|grep-i MySQL #系统自带

Yum install MySQL mysql-server mysql-devel #安装

"Install Apache"

Yum Install httpd

"Install PHP"

Yum Install PHP Php-mysql

Start the service:
/ETC/INIT.D/HTTPD start

/etc/init.d/mysqld Start #第一次启动会初始化MySQL的数据字典
Or

Service httpd Start

Service mysqld Start

To set up self-booting:

Chkconfig httpd on

Chkconfig mysqld on

NTSYSV #设置自启动


Check if MySQL is installed successfully :

Can you enter MySQL and then set the root password:

mysqladmin--user=root Password MySQL

Mysqladmin--user=root--password Reload

Or

Set password for ' root ' @ ' localhost ' =password (' MySQL '); #设置root密码


Check if Apache is installed successfully:

URL input Native Address: http://localhost/(success as shown below)

Check if PHP is installed successfully:

New File info.php

touch/var/www/html/info.php

vi/var/www/html/info.php

The contents of the file are as follows:

<?php

Phpinfo ();

?>

Enter in the URL: http://localhost/info.php (success as shown below)

Dependent Package Installation:

Yum install-y cairo-devellibxml2-devel pango-devel pango libpng-devel freetype freetype-devellibart_lgpl-devel Pear Pear-devel



"Install configuration SNMP"

Cacti uses SNMP to fetch data from the remote host. As a result, all hosts with SNMP services enabled can be cacti monitored

Yum-y Install NET-SNMP net-snmp-utils net-snmp-devel #安装

Cp/etc/snmp/snmpd.conf/etc/snmp/snmp.conf

Edit File Modification vi/etc/snmp/snmp.conf

Modify 41st Line default to 127.0.0.1

Com2sec notconfiguser 127.0.0.1 Public

Change line 62nd SystemView to all

Access Notconfiggroup "" Any noauth exact none none

Uncomment 85th Line

View all included. 1 80

/ETC/INIT.D/SNMPD Start #启动服务

Chkconfig snmpd on #开机自启动

"Install RRDtool"

 

Cacti uses RRDtool to store data, one of the most admirable features is its drawing capabilities

Yum-y install NTP vim-enhanced gcc gcc-c++gcc-g77 Flex bison autoconf automake bzip2-devel ncurses-devel zlib-devellibjpe G-devel libpng-devel libtiff-devel freetype-devel libxpm-develgettext-devel pam-devel libxml2-devel glib pango-devel Pango Cairo-devellibart_lgpl-devel

Cd/usr/local

wgethttp://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.8.tar.gz

Tar zxf rrdtool-1.4.8.tar.gz

MV rrdtool-1.4.8 RRDtool

CD RRDtool

./configure--prefix=/usr/local/rrdtool #指定目录安装

Make && make install #编译

#PS: Installation may be error, yum-y install perl* can solve

Ln-s/usr/local/rrdtool/bin/*/usr/local/bin/



"Install the polling spine(not required)"

For efficiency reasons, it is slower to use the cmd.php polling device when collecting data in large quantities, and the acquisition frequency of 1 minutes and 1 times may not complete polling of all machines. In order to optimize, we use the officially recommended spine for efficient polling.

Yum Install Openssl-devel Mysql-develnet-snmp-devel

Cd/usr/local

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

Tar zxf cacti-spine-0.8.8a.tar.gz

MV Cacti-spine-0.8.8a/spine

CD Spine

./configure--prefix=/usr/local/spine #指定目录安装

############

#错误:

#error: Cannot find MySQL headers. Use--with-mysql= to specify Non-defaultpath.

#解决:

Yum Installmysql-devel

Yum Installnet-snmp-devel

./configure--prefix=/usr/local/spine--with-results-buffer=2048

############

Make && make install #编译

Cp/usr/local/spine/etc/spine.conf/etc/spine.conf

Or:

Cp/usr/local/spine/etc/spine.conf.dist/etc/spine.conf

Vi/etc/spine.conf #末尾设置如下

Db_host 127.0.0.1--not localhost.
Db_database cacti
Db_user cacti
Db_pass cacti

Db_port 3306
Db_preg 0


#设置mysql中用于cacti的数据库的户登录名. The following is again created

"Install Cactid"

Cactid is written in C to replace the cmd.php to produce pictures, the performance is stronger, but need to compile the installation. First install several devel packages required for compiling Cactid:

Yum-y Install net-snmp-devel mysql-devel OPENSSL-DEVELGCC Libtool

Download Cacti,cacit official website: http://www.cacti.net/downloads/

cd/var/www/html/

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/cacti

Configuration Database

create cacti users and databases in MySQL (previously spine.conf configured as cacti users):

Mysql-uroot-p

mysql> Insert Intomysql.user (Host,user,password) VALUES (' localhost ', ' cacti ', password (' cacti '));

mysql> Insert Intomysql.user (Host,user,password) VALUES (' 127.0.0.1 ', ' Cacti ', password (' cacti '));

mysql> CREATE database cacti;

mysql> use cacti;

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

mysql> flush Privileges;

Mysql> grant all privileges on Cacti.*to cacti@localhost identified by ' cacti ';

Mysql> grant all privileges on Cacti.*to cacti@127.0.0.1 identified by ' cacti ';

mysql> flush Privileges;

Mysql> exit

Add cacti Users:

Useradd cacti

echo "cacti" |passwd--stdin cacti

Chgrp-r cacti/var/www/html/cacti/

Chown-r Cacti/var/www/html/cacti/rra

Chown-r Cacti/var/www/html/cacti/log


let cacti's poller fetch data at a fixed time:

Vi/etc/crontab

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

Service Crond Restart


#cat/var/spool/cron/root

Edit the configuration file (if you use cacti users instead cacti users):

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

$database _type = "MySQL";

$database _default = "cacti";

$database _hostname = "localhost";

$database _username = "cacti";

$database _password = "cacti";

$database _port = "3306";

========*

Http://localhost/cacti

Error: apache/2.2.3 (CentOS) Server at localhost Port 80

Vi/etc/selinux/config

Change the selinux=enforcing into a permissive.

========*


=============================== completed. =================================

Enter: http://localhost/cacti (cacti server IP) on the browser









Default login:

Name:admin

Password:admin

The password will be changed directly after login. After modifying the password to enter the interface:

Add Plugins:

Official website Download: http://docs.cacti.net/plugins

Monitor-v1.3-1.tgz

Settings-v0.71-1.tgz

Thold-v0.5.0.tgz

To be extracted to the Cacti/plugins directory:

Cd/var/www/html/cacti/plugins

TAR-ZXF monitor-v1.3-1.tgz

TAR-ZXF settings-v0.71-1.tgz

TAR-ZXF thold-v0.5.0.tgz

Mysql–uroot–pmysql Cacti<monitor.sql

Installing Weathermap

Cd/var/www/html/cacti/plugins

Wgetwww.network-weathermap.com/files/php-weathermap-0.97c.zip

Unzip Php-weathermap-0.97c.zip

Console-->plugine management--> activation, start plugin













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.