你好,游客 登录 注册 搜索
背景:
阅读新闻

Cacti监控系统的安装配置

[日期:2014-09-13] 来源:Linux社区  作者:kimileonis [字体:大 中 小]

7、rrdtool安装配置

# yum install -y freetype-devel libart_lgpl-devel gd-devel cairo cairo-devel pango pango-devel

# tar zxvf rrdtool-1.4.8.tar.gz

# cd rrdtool-1.4.8

# ./configure --prefix=/usr/local/rrdtool

# make && make install

# ln -s /usr/local/rrdtool/bin/rrdtool /usr/bin

 


8、net-snmp安装配置

# tar zxvf net-snmp-5.7.2.1.tar.gz

# cd net-snmp-5.7.2.1

# ./configure --prefix=/usr/local/net-snmp

# make && make install

# ln –s /usr/local/net-snmp/bin/* /usr/local/bin/

# cp /usr/local/src/net-snmp-5.7.2.1/EXAMPLE.conf /usr/local/net-snmp/share/snmp/snmpd.conf

# vim /usr/local/net-snmp/share/snmp/snmpd.conf

添加以下内容

view    all          included  .1

view    systemview    included  .1.3.6.1.2.1.2 

# /usr/local/net-snmp/sbin/snmpd

# lsof -i:161

COMMAND  PID USER  FD  TYPE DEVICE SIZE/OFF NODE NAME

snmpd  41107 root    8u  IPv4 616363      0t0  UDP localhost:snmp

# snmpwalk -v 1 -c public localhost system

# vim /etc/rc.d/rc.local

追加以下内容,开机自启动

/usr/local/net-snmp/sbin/snmpd

# 关于snmpd.conf的内容还可以引用以下配置

com2sec notConfigUser  default      test

group  notConfigGroup v1          notConfigUser

group  notConfigGroup v2c          notConfigUser

view    all          included  .1       

view    systemview    included  .1.3.6.1.2.1.1

view    systemview    included  .1.3.6.1.2.1.2

view    systemview    included  .1.3.6.1.2.1.25.1.1

access  notConfigGroup ""      any      noauth    exact  all none none

com2sec local    localhost        test

com2sec mynetwork 10.0.2.0/24      test

view mib2  included  .iso.org.dod.internet.mgmt.mib-2 fc

 

9、cacti安装配置

# tar zxvf cacti-0.8.8b.tar.gz

# mv cacti-0.8.8b /usr/local/cacti

# vim /usr/local/apache2/conf/httpd.conf

DocumentRoot "/usr/local/apache2/htdocs" => DocumentRoot "/usr/local/cacti"

<Directory "/usr/local/apache2/htdocs"> => <Directory "/usr/local/cacti">

# vim /usr/local/cacti/include/config.php

$database_type = "mysql";

$database_default = "cacti";

$database_hostname = "localhost";

$database_username = "cactiuser";

$database_password = "cactipassword";

$database_port = "3306";

$database_ssl = false;

 


/* load up old style plugins here */  #enable plugins

$plugins = array();

//$plugins[] = 'thold';

# useradd cactiuser

# chown -R cactiuser.cactiuser ./rra ./log

# service httpd restart

# rrdtool fetch localhost_users_6.rrd AVERAGE|MAX#查看rrd文件是否有数据

 


10、被监控机安装snmp服务

# yum install -y net-snmp*

# vim /etc/snmp/snmpd.conf

view    all          included  .1

view    systemview    included  .1.3.6.1.2.1.2 

# service snmpd start

# lsof -i:161

 


11、问题汇总

问题1:

Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /usr/local/apache2/htdocs/cacti/include/global_constants.php on line 165

解决方法:

# vim /usr/local/php/lib/php.ini

修改

date.timezone = PRC

并取消注释

 


问题2:

PHP Strict Standards:  Only variables should be passed by reference in /usr/local/nginx/html/cacti/lib/ping.php on line 382

解决方法:

socket_select($r = array($this->socket), $w = NULL, $f = NULL, $to_sec, $to_usec){

=>修改为

$r = array($this->socket);

$w = NULL;

$f = NULL;

switch(socket_select($r, $w, $f, $to_sec, $to_usec)){

 


问题3:

WARNING: Cron is out of sync with the Poller Interval!  The Poller Interval is '300' seconds, with a maximum of a '300' second Cron, but 2135 seconds have passed since the last poll!

解决方法:

*/1    *      *      *      *      /usr/bin/php /usr/local/apache2/htdocs/cacti/poller.php  > /dev/null 2>&1

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-09/106582.htm

linux
相关资讯       Cacti配置  Cacti安装配置 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款