[[email protected] ~]# yum-y install httpd php php-mysql php-ldap php-xml net-snmp-utils mysqlmysql-server net-snmp crond rrdtool lm_sensors
gcc gcc-c++ zlib-devel libpng-deve
[[email protected]]# yum -y install libart_lgpl libart_lgpl-devel
[[email protected]]# yum -y install freetype freetype-devel
[[email protected] ~]#mkdir /cacti
[[email protected] ~]# mv/root/Desktop/rrdtool-1.2.27.tar.gz /cacti/
[[email protected] ~]# cd/cacti/
[[email protected] cacti]#tar -zxf rrdtool-1.2.27.tar.gz -C /usr/src
[[email protected] cacti]#cd /usr/src
[[email protected] src]#cd rrdtool-1.2.27/
[[email protected]]# ./configure --prefix=/usr/local
[[email protected]]# make && make install
rrd ------tab键可以补全 rrdtool安装成功
[[email protected]]# cd /root/Desktop/
[[email protected]]# tar -zxf cacti-0.8.7g.tar.gz -C /usr/src/
[[email protected]]# cd /usr/src/
[[email protected] src]#cp -r cacti-0.8.7g/ /var/www/html/
[[email protected]]# useradd cactiuser
[[email protected] cacti]# cd /usr/src/ cacti-0.8.7g/
[[email protected]]# chown -R cactiuser:cactiuser rra/ log/
[[email protected]]# service mysqld start
[[email protected]]# mysql
mysql> createdatabase cactidb default character set utf8;
mysql> grantall on cactidb.* to ‘cactiuser‘@‘localhost‘ identified by ‘123456‘;
mysql> \q
将cacti.sql数据库导入到cactidb中
[[email protected]]# mysql -ucactiuser -p123456 cactidb < cacti.sql
-u用户名 -p密码
数据库名是上面在msyql数据库中创建的
用户名密码是数据库中授权的
[[email protected]]# service httpd restart;chkconfig httpd on
[[email protected] html]#cd /var/www/html/cacti/include
[[email protected] html]#vimconfig.php
更改为在数据库中授权的用户名密码 库名
[[email protected] scripts]# vim/etc/snmp/snmpd.conf
62 access notConfigGroup "" any noauth exact all none none //systemview改为all
85 view all included .1 80 //取消注释
chkconfig snmpd on
112 com2secnotConfigUser 192.168.10.10 public //监控服务器的ip地址
[[email protected]]# service snmpd start;chkconfig snmpd on
监控本机的配置192.168.10.10
另一客户端的配置192.168.10.20
[[email protected] media]#yum -y install net-snmp net-snmp-utils
[[email protected] media]#vim /etc/snmp/snmpd.conf
配置与上面一样
[[email protected] media]#service snmpd restart;chkconfig snmpd on
服务器端的配置操作 device--点击右上角的add
完成以上点击右下角的 create
Associated DataQueries添加以下的数据
SNMP - Get MountedPartitions
SNMP - GetProcessor Information
SNMP - InterfaceStatistics
添加完毕 save保存
保存完成后,点击create graphs for this host
创建图形
点击右下角的创建 , 开始创建图形
安装cacti-plugin-0.8.7g-PA-v2.9.tar.gz是插件
[[email protected]]# tar -xzf cacti-plugin-0.8.7g-PA-v2.9.tar.gz –C /var/www/html/cacti
[[email protected] cacti]#cd /var/www/html/cacti
[[email protected] cacti]#patch–p1 –N cacti-plugin-0.8.7b-PA-v2.1.diff
[[email protected] cacti]#mysql –u root –p cactidb<pa.sql
[[email protected] cacti]# vim include/global.php
[[email protected] cacti]#vim include/config.php
之前修改的配置不需要再进行修改
注意:一定要在cacti后加入 / 否则web页面无法读取正确内容
web页面的配置
[[email protected]]# tar -zxf monitor-v1.3-1.tgz
[[email protected]]# tar -zxf settings-v0.71-1.tgz
[[email protected]]# tar -zxf thold-v0.4.9-3.tgz
[[email protected]]#unzip php-weathermap-0.97a.zip
[[email protected]]#mv clog monitor settings weathermap /var/www/html/cacti/plugins/
[[email protected]]#cd /var/www/html/cacti/plugins/
[[email protected] monitor]#mysql–uroot –p cactidb<monitor.sql
安装好weathermap后,看到点Console在左边的列表里会看到weathermap的菜单,我们点击,会看到设置,因为我们还没有定义一个weathermap配置文件,所以我们点右上角的Add按钮,添加一个weathermap配置文件,如果提示gd之类的错误,需要安装gd、gd-php
点击Add之后,我们看到有二个文件,其实这个时候调用的就是weathermap的configs目录下的文件,simple.conf就是自带的一个配置文件,我们可以点击它前面的Add按钮,把他添加到默认配置文件里
至此我们添加了一个weathermap的配置文件,下面就是对weathermap进行配置了,点击weathermap,然后点击Editor对默认图形配置文件进行配置。
点击editor后我们会看到如下提示
The editor has not been enabled yet. You need to set ENABLED=true at thetop of editor.php
Before you do that, you should consider using FilesMatch (in Apache) orsimilar to limit who can access the editor. There is more information in theinstall guide section of the manual.
我们按照他提示的编辑editor.php
1 |
vi /var/www/html/plugins/weathermap/editor.php |
||
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
<php require_once ‘editor.inc.php‘; require_once ‘Weathermap.class.php‘; // so that you can‘t have the editor active, and not know about it. $ENABLED=true; if(! $ENABLED) { print " The editor has not been enabled yet. You need to set ENABLED=true at the top of editor.php "; print " Before you do that, you should consider using FilesMatch (in Apache) or similar to limit who can access the editor. There is more information in the install guide section of the manual. "; exit(); } 修改完成后点开editor弹出 把上面的$ENABLED=false;改为$ENABLED=true;然后保存。之后我们刷新页面就可以看到如下页面 继续修改配置文件 [[email protected] weathermap]# vim editor.php |
||