标签:cacti
第一部分:cacti安装配置
1. 首先要安装epel扩展源
[root@64 ~]# ping www.baidu.com
PING www.a.shifen.com (119.75.218.70) 56(84) bytes of data.
64 bytes from 119.75.218.70: icmp_seq=1 ttl=57 time=4.96 ms
64 bytes from 119.75.218.70: icmp_seq=2 ttl=57 time=3.68 ms
[root@xin-3-91 ~]# yum install -y epel-release(6.7前版本不支持)
[root@64 ~]# yum install -y wget
[root@64 ~]# wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo
安装扩展YUM源
2. (lamp)然后分别安装httpd、php、mysql
[root@64 ~]# yum install -y httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng libpng-devel
3. 安装cacti net-snmp rrdtool
[root@64 ~]# yum install -y cacti net-snmp net-snmp-utils rrdtool
4. 启动服务:
[root@64 ~]# /etc/init.d/mysqld start
[root@64 ~]# /etc/init.d/httpd start
[root@64 ~]# /etc/init.d/snmpd start
5. 编辑httpd配置文件
[root@64 ~]# vim /etc/httpd/conf.d/cacti.conf
把"Deny from all" 改为 "Allow from all",否则会403报错
[root@64 ~]# /etc/init.d/httpd restart
6. 导入数据创建cacti库
[root@64 ~]# mysql -uroot -e "create database cacti"
创建cacti用户
[root@64 ~]# mysql -uroot -e "grant all on cacti.* to ‘cacti‘@‘127.0.0.1‘ identified by ‘cacti‘;"
导入sql文件
[root@64 ~]# mysql -uroot cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
7. 编辑cacti配置文件
[root@64 ~]# vim /usr/share/cacti/include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "127.0.0.1";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";
$database_ssl = false;
8. web访问cacti并安装
http://192.168.1.108/cacti/
点两下“next” 和一次”Finish“ 即可
输入admin admin 登录,重新设置新的密码
9. 执行poller.php, 生成图形
[root@64 ~]# vim /etc/php.ini
/timezone (搜索关键字)
date.timezone = ‘Asia/Chongqing‘
[root@64 ~]# /usr/bin/php /usr/share/cacti/poller.php
10. 加入计划任务
[root@64 ~]# crontab -e
*/5 * * * * /usr/bin/php /usr/share/cacti/poller.php
[root@64 ~]# crontab -l
*/5 * * * * /usr/bin/php /usr/share/cacti/poller.php
第二部分客户端配置
1. 安装snmp
[root@64 ~]# yum install -y net-snmp
2. 修改/etc/snmp/snmpd.conf
[root@64 ~]# vim /etc/snmp/snmpd.conf
syscontact Root xin@xin.com
syslocation 1.109
3.启动snmp
[root@64 ~]# /etc/init.d/snmpd start
正在启动 snmpd: [确定]
标签:cacti
原文地址:http://dongbingxin.blog.51cto.com/3486403/1771247