Official documents for the three types of software: cacti: License
Official documentation for the three types of software:
Cacti: http://docs.cacti.net/manual:087:1_installation#installation
Nagios: http://www.nagios.org/documentation
Ganglia: http://ganglia.info/
In the field of monitoring platform, the three monitoring software have their own strengths and weaknesses. This document first introduces the installation and configuration methods of the three software, and then integrates the three software, make use of the advantages of each software.
System Environment: rhel6 selinux and iptables disabled
Cacti:
The cacti software periodically collects host information through the net-snmp protocol and stores it in the mysql database. When you want to view the host information, find the corresponding rra file in the database and use the rrdtool for plotting, then, the image is returned to the user. Its advantage is that it can generate intuitive reports.
Therefore, the premise for cacti to run is to install rrdtool, mysql, php, and a web publishing program. This article uses apache.
First install the required software and dependencies:
# Yum install httpd mysql-server mysql-devel php-mysql php-snmp net-snmp-utils net-snmp-libs net-snmp-devel libart_lgpl-devel libpng-devel freetype-devel cairo-devel pango-devel gcc make
Note that the php-snmp package is in the Optional library.
Start mysql and apache after installation
- # /etc/init.d/httpd start
- # /etc/init.d/mysqld start
Configure PHP: you only need to modify the/etc/php. ini file and set the time zone to Shanghai:
Date. timezone = Asia/shanghai
Configure snmp:
The configuration of snmp in cacti official documents is too cumbersome.
- # vi /etc/snmp/snmpd.conf
Replace some statements in the configuration
- #com2sec notConfigUser default public
- com2sec local localhost public
- com2sec mynetwork 192.168.0.0/24 public
-
- #group notConfigGroup v1 notConfigUser
- #group notConfigGroup v2c notConfigUser
- group MyRWGroup v1 local
- group MyRWGroup v2c local
- group MyRWGroup usm local
- group MyROGroup v1 mynetwork
- group MyROGroup v2c mynetwork
- group MyROGroup usm mynetwork
-
-
- #view systemview included .1.3.6.1.2.1.1
- #view systemview included .1.3.6.1.2.1.25.1.1
- view all included .1
-
- #access notConfigGroup "" any noauth exact systemview none none
- access MyROGroup "" any noauth exact all none none
- access MyRWGroup "" any noauth exact all all none
-
- #syslocation Unknown (edit /etc/snmp/snmpd.conf)
- #syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
- syslocation Linux (RH3_UP2), Home Linux Router.
- syscontact yejk <mrye1990@gmail.com>
Start snmpd
- # chkconfig snmpd on
- # service snmpd start
Install rrdtool
- # yum install libxml2-devel
- # tar zxf rrdtool-1.4.4.tar.gz
- # cd rrdtool-1.4.4
- # ./configure
- # make
- # make install
- # ln -s /opt/rrdtool-1.4.4/bin/rrdtool /usr/local/bin
Install cacti:
- # tar zxf cacti-0.8.7h.tar.gz
- # mv cacti-0.8.7h /var/www/html/cacti
- # cd /var/www/html/cacti/
- # useradd cacti
- # chown -R cacti rra log
- # mysql cacti < cacti.sql
Create a user in the database for cacti, and only have the permission to operate on the cacti database:
- #mysql
- mysql> grant all on cacti.* to cacti@localhost identified by 'cacti';
- mysql> flush privileges;
- mysql> quit
Edit the cacti configuration file, www.linuxidc.com, and change the user and password used to log on to the database.
- # vim include/config.php
- $database_type = "mysql";
- $database_default = "cacti";
- $database_hostname = "localhost";
- $database_username = "cacti";
- $database_password = "cacti";
- $database_port = "3306";
- $database_ssl = false;
- $url_path = "/cacti/";