客户机配置
一、安装
rpm -ivh net-snmp-5.5-27.el6.i686.rpmnet-snmp-libs-5.5-27.el6.i686.rpm lm_sensors-3.1.1-10.el6.i686.rpmlm_sensors-libs-3.1.1-10.el6.i686.rpm
二、配置
vi /etc/snmp/snmp.conf
修改第41、62、85行,修改如下:
com2sec notconfigUser 10.0.8.132 public
access notConfitGroup " " any noauth exact all none none
view all included .1 80
修改第41、62、85行,修改如下:
com2sec notconfigUser 10.0.8.132 public
access notConfitGroup " " any noauth exact all none none
view all included .1 80
启动服务
服务器配置
一、安装:
1.安装yum
卸载原有的yum
rpm -qa | grep yum | xargs rpm -e --nodeps
安装新的yum刷新yum
yum clean all
yum repolist all
2、用安装如下软件包(用YUM安装)
yum install -y httpd* mysql* php*
vim /etc/httpd/conf/httpd.conf
DirectoryIndex index.php index.html
在网页根目录创建index.php
vim /var/www/html/index.php
<?php
phpinfo();
?>
在网页根目录创建index.php
vim /var/www/html/index.php
启动http和mysql
service httpd start
service mysqld start
chkconfig --level 35 httpd on
chkconfig --level 35 mysqld on
测试lamp是否可以正常访问
3、安装 (rrdtool、cacti)
用rpm安装 rrdtool、perl-rrdtool、ruby-rrdtool、rrdtool-devel 、libdbi
解压cacti到网页根目录
tar zvxf cacti-0.8.8a.tar.gz -C/var/www/html
mv /var/www/html/cacti-0.8.8a/var/www/html/cacti
useradd cactiuser
chown -R cactiuser.cactiuser cacti/rra/cacti/log
mysqladmin -u root password 新密码
mysql -u root -p
mysql>CREATE DATABASE cactidb DEFAULTCHARACTER SET utf8;
mysql>GRANT all ON cactidb.* [email protected] IDENTIFIED BY ‘[email protected]‘;
mysql>QUIT
mysql -u cactiuser -p cactidb <cacti/cacti.sql
调整cacti配置文件
cd /var/www/html/cacti/
vi include/config.php
<?
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost"
$database_username = "cactiuser";
$database_password = "[email protected]";
$database_port = "3306";
$config[‘url_path‘] = "/cacti";
?>
4.安装cacti
重启服务
service httpd restart
初始化cacti系统
访问http://10.0.8.132/cacti
设置图像添加被监控端设备
1>先点击devices,再点击add,添加要监控的设备及采集的数据类型
2>点击new graphs,全选并保存
3>点击graph trees,点击defaulttree,点击add,选host,选择要监控的设备IP并保存
4>点击最上面的graphs图标,选择要采集的IP查看图像
设置任务计划
php /var/www/html/cacti/poller.php
crontab -e
*/2 * * * * /usr/bin/php/var/www/html/cacti/poller.php
等待大概十分钟左右就可以看到图像
如果看不到图像请修改时区格式
vim /etc/php.ini
date.timezone = Asia/Shanghai
配置路由器的SNMP服务。
在cacti服务器监控端添加路由器