标签:cacti安装部署
cacti安装
[root@client~]# rpm -ivh http://www.aminglinux.com/bbs/data/attachment/forum/month_1211/epel-release-6-7.noarch.rpm
//安装epel扩展源
[root@client ~]# yum install -y httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng libpng-devel
//安装httpd、php、mysql
[root@client ~]# yum install -y cacti net-snmp net-snmp-utils rrdtool
//安装cacti net-snmp rrdtool
[root@client ~]# /etc/init.d/mysqld start
[root@client ~]# /etc/init.d/httpd start
[root@client ~]# /etc/init.d/snmpd start
[root@client ~]# vim /etc/httpd/conf.d/cacti.conf
<Directory /usr/share/cacti/>
<IfModule mod_authz_core.c>
# httpd 2.4
Require host localhost
</IfModule>
<IfModule !mod_authz_core.c>
# httpd 2.2
Order deny,allow
Allow from all
Allow from localhost
</IfModule>
</Directory>
[root@client ~]# /etc/init.d/httpd restart
[root@client ~]# mysql -uroot -e "create database cacti"
[root@client ~]# mysql -uroot -e "grant all on cacti.* to ‘cacti‘@‘127.0.0.1‘ identified by ‘cacti‘;"
[root@client ~]# mysql -uroot cacti < /usr/share/doc/cacti-0.8.8b/cacti.sql
[root@client ~]# 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;
web访问192.168.137.21/cacti进入cacti安装的图形页面
next-----next------finish
User Name: admin
Password:admin
//输入用户名密码登入
Password:admin
Confirm:admin
//修改密码
登入成功
[root@client ~]# /usr/bin/php /usr/share/cacti/poller.php
[root@client ~]# vim /etc/php.ini
date.timezone =‘Asia/Chongqing‘
[root@client ~]# crontab -e
*/5 * * * * /usr/bin/php /usr/share/cacti/poller.php
等待5分钟以上,任务计划执行后,有监控信息参数,产生为图片信息。
以上监控的为本机
现cacti增加客户端监控,安装客户端(增加一个linux服务器)
打开一台客户机
[root@client ~]# yum install -y net-snmp
[root@client ~]# vim /etc/snmp/snmpd.conf
syslocation 137.21 //可写本机IP
syscontact Root 123@456.com //管理员的邮箱
[root@client ~]# service snmpd start
在网页上增加该客户机的监控
console-------Device-------Add----
Description 可写本机ip(或自定义)
Hostname 可写本机ip
Host Template 选ucd/net SNMP Host
SNMP Version 选Version 2
----create------Create Graphs for this Host---------
Graph Types: SNMP - Interface Statistics
选中网卡-----create
Graph Types: Graph Template Based
Create: ucd/net - CPU Usage
Create: ucd/net - Load Average
Create: ucd/net - Memory Usage
三项全选,监控CPU、Load、Memory
create
将这台设备的监控加入tree
Graph Trees------- Default Tree--------- Add------
Host-----选中刚加的设备---create
graphs---------Default Tree----192.168.137.21
查看监控数据产生
本文出自 “Linux学习笔记” 博客,请务必保留此出处http://9656134.blog.51cto.com/9646134/1678497
标签:cacti安装部署
原文地址:http://9656134.blog.51cto.com/9646134/1678497