客户机配置
一、安装
rpm -ivh net-snmp-5.5-27.el6.i686.rpm net-snmp-libs-5.5-27.el6.i686.rpm lm_sensors-3.1.1-10.el6.i686.rpm lm_sensors-libs-3.1.1-10.el6.i686.rpm
二、配置
vi /etc/snmp/snmpd.conf
修改第41、62、85行,修改如下:
com2sec notconfigUser 10.0.8.132 public
access notConfitGroup " " any noauth exact all none none
view all included .1 80
三、启动服务
service snmpd start
chkconfig --level 35 snmpd on
服务器配置
一、安装:
1.安装yum
卸载原有的yum
rpm -qa | grep yum | xargs rpm -e --nodeps
安装新的yum
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.i686.rpm
rpm -ivh yum-3.2.29-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm cp local.repo /etc/yum.repos.d/
mkdir /root/cdrom
cd /media/RHEL_6.0\ i386\ Disc\ 1/
cp -Rvf * /root/cdrom/
vi /etc/yum.repos.d/local.repo
[local]
name=local
baseurl=file:///root/cdrom
gpgcheck=0
刷新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();
?>
启动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
cd /var/www/html
chown -R cactiuser.cactiuser cacti/rra/ cacti/log
mysqladmin -u root password 新密码
mysql -u root -p
mysql>CREATE DATABASE cactidb DEFAULT CHARACTER SET utf8;
mysql>GRANT all ON cactidb.* TO [email protected] IDENTIFIED BY ‘[email protected]‘;
mysql>QUIT
mysql -u cactiuser -p cactidb < cacti/cacti.sql
调整cacti配置文件
cd /var/www/html/cacti/
vim 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
5、设置图像添加被监控端设备
1>先点击devices,再点击add,添加要监控的设备及采集的数据类型
2>点击new graphs,全选并保存
3>点击graph trees,点击default tree,点击add,选host,选择要监控的设备IP并保存
4>点击最上面的graphs图标,选择要采集的IP查看图像
6.设置任务计划
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