centos6 Cacti部署文档

时间:2023-01-14 21:05:34

centos6 Cacti部署文档


1.安装依赖

yum -y install mysql mysql-server mysql-devel httpd php php-pdo php-snmp php-mysql lm_sensors net-snmp net-snmp-utils net-snmp-libs rrdtool rrdtool-devel perl-PlRPC perl-DBI perl-rrdtool perl-DBD-MySQL

2.下载程序

http://www.cacti.net/downloads/cacti-0.8.8h.tar.gz
tar -xf -C /home/op/
mv cacti-0.8.8h/ cacti

3.数据库

create database cacti;
grant all privileges on cacti.* to cacti@localhost identified by 'cacti' with grant option;
flush privileges; use cacti
source /home/op/cacti/cacti.sql

4.配置数据库

按照下面的配置就行

vim /home/op/cacti/include/config.php

$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";
$database_ssl = false;

5.添加cacti用户并授权

useradd cacti -d /home/op/cacti -s /bin/false
chown -R cacti.cacti /home/op/cacti
su - cacti
crontab -e
*/5 * * * * /usr/local/php/bin/php /home/op/cacti/poller.php > /dev/null 2>&1 -如果暂时未看到图表,可以手工执行,生成图表
php /home/op/cacti/poller.php ]] >  /dev/null 2]] > &1

6.httpd配置

alias /cacti /home/op/cacti/
<Directory /home/op/cacti/>
Options Indexes
AllowOverride AuthConfig Options
Order allow,deny
Allow from all
</Directory>

7.iptables 配置

iptables -I INPUT -p tcp --dport 161 -j ACCEPT
iptables -I OUTPUT -p tcp --dport 161 -j ACCEPT
iptables -I INPUT -p udp --dport 161 -j ACCEPT
iptables -I OUTPUT -p udp --dport 161 -j ACCEPT

8.snpmd 配置

#com2sec notConfigUser  default       public
com2sec notConfigUser 10.171.95.178 public ####
# Second, map the security name into a group name: # groupName securityModel securityName
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser ####
# Third, create a view for us to let the group have rights to: # Make at least snmpwalk -v 1 localhost -c public system fast again.
# name incl/excl subtree mask(optional)
#view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1 view all included .1 80 ## -or just the mib2 tree- #view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc

9 查看

启动httpd

在浏览器登录配置,用户名 密码 都是admin

具体就不详说了。。。。。。