System environment
Os:centos
database:mysql5.0
PHP Apache
Net-snmp
The environment required to deploy the CentOS cacti configuration
Install MySQL
Yum-y install MySQL
Yum-y Install Mysql-server
Yum-y Install Mysql-devel
Installing Apache
Yum-y Install httpd
Install PHP
Yum-y Install PHP
Yum-y Install Php-mysql
Start a variety of services and join the startup list
Service httpd Start
Service mysqld Start #第一次启动会初始化MySQL的数据字典
Chkconfig httpd on
Chkconfig mysqld on
Since the CentOS cacti configuration requires a lot of support from other libraries, we also need to install some:
Zlib
Yum-y Install Zlib
Libpng
Yum-y Install libpng
FreeType
Yum-y Install FreeType
Jpeg:
Yum-y Install Libjpeg
Fontconfig:
Yum-y Install Fontconfig
Gd:
Yum-y Install GD
Libxml
Yum-y Install LIBXML2
Yum-y Install PHP-GD//If Weathermap does not run properly, you can check this
Installing RRDtool
Under/etc/yum.repos.d/, create a new Dag.repo file to enter the source address in the file:
[email protected] yum.repos.d]# cat 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
[[email protected] yum.repos.d] #yum-y install RRDtool
Start the RRDtool service and join the startup list
Service rrdcached Start
Chkconfig rrdcached on
Support Tools for installing SNMP
Yum-y Install NET-SNMP
Yum-y Install Net-snmp-utils
Start the SNMPD service and join the startup list
Service SNMPD Start
Chkconfig snmpd on
Installing the CentOS cacti
Download CentOS cacti,cacit official website: http://www.cacti.net/download_cacti.php
wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz
Unzip and place in Apache document directory (/var/www/html is the default Apache Web site Directory)
TAR-XF cacti-0.8.7g.tar.gz
MV Cacti-0.8.7g/var/www/html/cacti
Edit the CentOS cacti configuration file, where you configure the username, password, port, etc. of the link MySQL service.
Cd/var/www/html
VI cacti/include/config.php
$database _type = "MySQL";
$database _default = "cacti";
$database _hostname = "localhost";
$database _username = "cacti";
$database _password = "cacti";
$database _port = "3306″;
Add a cacti user and add a cron task:
Useradd cacti
Su–cacti
Crontab-e
*/1 * * * */usr/bin/php/var/www/html/cacti/poller.php >/dev/null 2>&1
Change the Cacti Site Directory group to cacti:
Su–root
Chgrp-r Cacti/var/www/html/cacti
Additionally, the owner of the two directories needs to be modified so that cacti has write access:
Chown-r Cacti/var/www/html/cacti/rra
Chown-r Cacti/var/www/html/cacti/log
Chown-r cacti/var/www/html/cacti/poller.php
CentOS Cacti Configuration Database
Create a CentOS cacti database mysqladmin-–user=root create cacti
Import Cacit.sql
MySQL cacti</var/www/html/cacti/cacti.sql to cacti user authorization
Mysql-uroot
mysql> use cacti
Mysql> Grant All on * * to [e-mail protected] identified by ' Somepassword ';
mysql> flush Privileges;
Mysql> exit
cacti+ Picture Display Fork
#/usr/bin/php/var/www/html/cacti/poller.php >/dev/null 2>&1
Centos5.5 under Installation cacti