Cacti-0.8.8b详细安装及配置步骤

上传人:平*** 文档编号:11122116 上传时间:2017-10-12 格式:DOCX 页数:23 大小:1.82MB
返回 下载 相关 举报
Cacti-0.8.8b详细安装及配置步骤_第1页
第1页 / 共23页
Cacti-0.8.8b详细安装及配置步骤_第2页
第2页 / 共23页
Cacti-0.8.8b详细安装及配置步骤_第3页
第3页 / 共23页
Cacti-0.8.8b详细安装及配置步骤_第4页
第4页 / 共23页
Cacti-0.8.8b详细安装及配置步骤_第5页
第5页 / 共23页
点击查看更多>>
资源描述

《Cacti-0.8.8b详细安装及配置步骤》由会员分享,可在线阅读,更多相关《Cacti-0.8.8b详细安装及配置步骤(23页珍藏版)》请在金锄头文库上搜索。

1、1. Cacti 环境安装1.1 安装 LAMP 环境安装 LAMP 环境,当然,如果你有兴趣可以采用编译,我线上 Mysql 是编译的,其余是 yum 安装的。在这次实验采用 yum 安装。关闭 iptables 与 selinux,如果有需要,后面再开启。配置好 yum 源,开始安装。yum -y install httpd http-devel httpd-manual mysql mysql-devel mysql-server php php-devel php-mysql php-common php-pdo php-gd lm_sensors net-snmp php-snmp

2、net-snmp-utils chkconfig mysqld onchkconfig httpd on chkconfig snmpd on service mysqld start service httpd start service snmpd start 在浏览器中输入 http:/serverip,查看测试页有没有出现。1.2 配置 snmpvim /etc/snmp/snmd.conf#/etc/init.d/snmpd restart验证 snmp 配置是否正确,# snmpwalk -v 2c -c public 127.0.0.1 if 表示正确IF-MIB:ifIndex

3、.1 = INTEGER: 1IF-MIB:ifIndex.2 = INTEGER: 2IF-MIB:ifDescr.1 = STRING: lo如果提示 Timeout: No Response from 127.0.0.1 则配置不对。1.3 创建数据库存储 cacti 的数据# mysqladmin -u root password sky123 # mysql -u root -p :输入密码 mysql create database cacti;Query OK, 1 row affected (0.00 sec) mysql grant all on cacti.* to cac

4、tiuserlocalhost identified by cactiuser;Query OK, 0 rows affected (0.01 sec) mysql flush privileges;Query OK, 0 rows affected (0.00 sec) mysql exitTip:创建 cacti 数据库与 cactiuser,可以省略在 cacti 配置文件中修改。当然也可以创建别的名字,只是在 cacti 的配置文件需要多做两步。1.4 安装 cacti1.4.1 安装 rrdtool 需要的软件包yum -y install cairo-devel libxml2-d

5、evel pango pango-devel perl-CPAN1.4.2 安装 rrdtooltar zxf rrdtool-1.4.8.tar.gz cd rrdtool-1.4.8./configure -prefix=/usr/local/rrdtool;make;make install1.4.3 安装 cacti-0.8.8btar zxf cacti-0.8.8b.tar.gz -C /var/www/html/ cd /var/www/html/ mv cacti-0.8.8b cacti chown -R apache:apache /var/www/html/cacti/

6、cd /var/www/html/cacti/patch -p1 -N /dev/null /var/spool/cron/cactiuser#/etc/init.d/crond restartTip:以 cactiuser 的身份定时执行这个脚本。1.4.7 初始化 cacti将/usr/local/bin/rrdtool 修改成正确的路径/usr/local/rrdtool/bin/rrdtool,点完成输入用户和密码都 是 admin,输入之后会要求强制修改密码。打开 http:/192.168.187.110/cacti 打开 ConsolesettingGenernal-修改下面两项

7、RRDTool Utility Version 选择 RRDTOOL 1.4.x,SNMP Version 选择 version 2手动执行一次 php /var/www/html/cacti/poller.php 会提示下警告PHP Warning: date(): It is not safe to rely on the systems timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you

8、 used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected America/New_York for EST/-5.0/no DST instead in /var/www/html/cacti/lib/functions.php on line 486#vim /etc/php.ini 启用下面并修改。date.timezone = Asia/Chongqing/etc/init.d/http

9、d restart,再执行行 php /var/www/html/cacti/poller.php 没警告了,这下应该正常了。等几钟应该会出图最后得到的结果如下所示。Tip:1. 初始化出现这种 FATAL: Cannot connect to MySQL server on localhost. Please make sure you have specified a valid MySQL database name in include/config.php,则用 cactiuser 连接数据库,是否有权限完全控制 cacti 库。2. 如果不是 cactiuser 导致的,但是 my

10、sql 是编译的,由于/var/www/html/cacti/poller.php 使用的/var/lib/mysql/mysql.sock,因为编译的 mysql的 sock 文件在 tmp 下,因此做一个软件链接ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock3. 初始化时,点击 finished 后又弹回初始化界面,则检查数据库配置文件是否有 read-only=1,有则删除,并重启 Mysql4. cacti 图片显示的字体是方框,则需要安装字体,yum -y install dejavu-*,安装完后,刷新 cacti 界面就行。5. 在

11、 Console-Devices 中显示 localhost 的状态为 unknow,在 rrd 目录中没有生成文件,查看 rra,log 目录的权限是否正确,并手动执行 php /var/www/html/cacti/poller.php。注意调整时间,系统有两个时间,一个硬件时间和系统时间。在虚拟机中往往要注意。1.5 安装 spinetar zxf cacti-spine-0.8.8b.tar.gzcd cacti-spine-0.8.8b./configure -prefix=/usr/local/cacti-spine configure: error: Cannot find SN

12、MP headers. Use -with-snmp= to specify non-default path.#yum -y net-snmp-devel#./configure -prefix=/usr/local/cacti-spine #Make & make install#cd /usr/local/cacti-spine/etc/#cp spine.conf.dist spine.conf#vim spine.confDB_Host localhostDB_Database cactiDB_User cactiuserDB_Pass cactiuserDB_Port 3306DB

13、_PreG 0#/usr/local/cacti-spine/bin/spine -conf=/usr/local/cacti-spine/etc/spine.conf 测试spine 安装是否正确,输出下面信息表示安装成功SPINE: Using spine config file /usr/local/cacti-spine/etc/spine.confSPINE: Version 0.8.8a startingSPINE: Time: 0.1251 s, Threads: 5, Hosts: 2打开 catcti 网页。Consolesettingpoller 将 cmd.php 修改成

14、 spine,并保存。Consolesettings-paths,添加 spine 命令的路径并保存。1.6 安装 setting,thold,monitor在安装 thold 插件,必须先安装 settings 插件,后安装 thold 插件。因为 settings 插件提供email 的相关设置,thold 插件的报警功能是根据 settings 里的设置来决定发送邮件的。# tar xf settings-v0.71-1.tgz -C /var/www/html/cacti/plugins# tar xf thold-v0.4.9-3.tgz -C /var/www/html/cacti

15、/plugins#tar xf monitor-v1.3-1.tgz -C /var/www/html/cacti/plugins# vim /var/www/html/cacti/include/config.php/$url_path = /cacti/; 在这一行下面添加一行$plugins = settings;$plugins = thold;$plugins = monitor;保存后,打开 cacti 网页,启用插件 consoleplugin management将插件安装与启用,如下图表示已经正确启用。1.7 设置邮件报警通知在 Console-setting-mail/DN

16、S 中填写好如果点了 send a test Email 出现下图的错误解决办法# cat /var/log/httpd/error.log 中提示没权限sendmail: fatal: chdir /var/spool/postfix: Permission denied#setenforce 0 再测试就 ok 了如果成功后,登录邮箱会收到一封邮件。若未安装 sendmailyum -y install sendmail-cf sendmail-doc cyrus-sasl m4 dovecot mailxservice sendmail startchkconfig sendmail on测试发送邮件邮件可以发送即可。1.8 设置主机宕机通知

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 办公文档 > 其它办公文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号