码迷,mamicode.com
首页 > 其他好文 > 详细

cacti (可以利用yum安装cacti的配置)

时间:2016-04-17 17:39:05      阅读:221      评论:0      收藏:0      [点我收藏+]

标签:

[root@localhost ~]# yum install -y epel-release[root@localhost ~]# 
[root@localhost ~]# yum install -y  httpd php php-mysql mysql mysql-server mysql-devel php-gd  libjpeg libjpeg-devel libpng libpng-devel //安装lamp
[root@localhost ~]# yum install -y cacti  net-snmp  net-snmp-utils  rrdtool 
[root@localhost ~]# /etc/init.d/mysqld start
[root@localhost ~]# /etc/init.d/httpd  start
[root@localhost ~]# /etc/init.d/snmpd start
[root@localhost ~]# vim /etc/httpd/conf.d/cacti.conf  
//修改
...
...
Deny from all    //change to --> Allow from all
[root@localhost ~]# /etc/init.d/httpd  restart
[root@localhost ~]# mysql -uroot
...
...
mysql> create database cacti;
mysql> grant all on cacti.* to cacti@127.0.0.1 identified by cacti;
mysql> quit
Bye
[root@localhost ~]# mysql -uroot cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
[root@localhost ~]# vim /usr/share/cacti/include/config.php 
//according to the following to change
$database_type = "mysql";
$database_default = "cacti";
$database_name = "cacti";
$database_hostname = "127.0.0.1";
$database_username = "cacti";
$database_password = "cacti";
$database_port = "3306";
$database_ssl = false;

 

web访问cacti并安装

//http://ip/cacti/  --> next --> next  --> Finish 

技术分享

技术分享

技术分享

//回到Linux页面执行
[root@cacti ~]# /usr/bin/php /usr/share/cacti/poller.php 
OK u:0.00 s:0.00 r:0.00
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.03
OK u:0.00 s:0.00 r:0.05
OK u:0.00 s:0.00 r:0.08
06/13/2015 09:59:49 PM - SYSTEM STATS: Time:0.1974 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:5 RRDsProcessed:5
[root@cacti ~]# crontab -e
# 让命令每5分钟执行一次
*/5 * * * * /usr/bin/php /usr/share/cacti/poller.php > /dev/null 2>&1
//点击 Graphs--> Default Tree --> Host Localhost

已经有图有数据了!!

技术分享

// 在需要被监控的客户端执行
[root@localhost ~]# yum install -y net-snmp
[root@localhost ~]# vim /etc/snmp/snmpd.conf 
//ADD
//syslocation --> 本机ip  syscontact --> 管理员邮箱
...
...
#syslocation Unknown (edit /etc/snmp/snmpd.conf)
syslocation 192.168.1.118      
syscontact Root 1212@1212.com
...
[root@localhost ~]# service  snmpd  start

技术分享

 

开始添加被监控主机的信息,填写完毕,点击Create

技术分享

 

创建完毕,看是否通信正常,创建完主机,创建要监控的项目点击 Create Graphs for this Host

技术分享

 

根据需要,去选择要监控的项目

 

如果没有出现可被监控的项目,可点击上面的run...再回到这个页面

技术分享

监控项目添加完毕,将主机添加到监控主干线上,点击左侧Graph Trees

技术分享

点击Add,添加被监控的主机

技术分享

类型选择Host,再选择要添加的主机

技术分享

添加完毕,点击Save

技术分享

//到Linux界面再配置
[root@cacti ~]# /usr/bin/php /usr/share/cacti/poller.php --force
OK u:0.00 s:0.00 r:0.00
OK u:0.00 s:0.00 r:0.01
OK u:0.00 s:0.00 r:0.03
OK u:0.00 s:0.00 r:0.05
OK u:0.00 s:0.00 r:0.08
OK u:0.00 s:0.00 r:0.09
OK u:0.00 s:0.00 r:0.09
OK u:0.00 s:0.00 r:0.09
OK u:0.00 s:0.00 r:0.09
OK u:0.00 s:0.00 r:0.09
OK u:0.00 s:0.00 r:0.09
OK u:0.00 s:0.00 r:0.09
OK u:0.00 s:0.00 r:0.09
OK u:0.00 s:0.00 r:0.09
OK u:0.00 s:0.00 r:0.09
OK u:0.00 s:0.00 r:0.09
OK u:0.00 s:0.00 r:0.10

//再将页面刷新

技术分享

 

cacti (可以利用yum安装cacti的配置)

标签:

原文地址:http://www.cnblogs.com/frankielf0921/p/5401235.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!