Cacti的安装配置-相关扩展设置

运维 系统运维
Cacti安装配置:cacti是一套开源的网络监控工具,可以用来监控apache服务器和mysql服务器的运行状态。本文讲述的是Cacti下php、mysql、Apache的扩展

  Cacti 安装配置:回大纲

  PHP扩展设置

  Cacti 使用如下 PHP 扩展组件:mysql、session、sockets、xml、pcre,同时,我们也建议使用snmp扩展。你可以选择使用 net-snmp 来代替 php-snmp 扩展(有时是 net-snmp-utils )。

  Cacti 插件会使用额外的扩展,比如gd (reportit 使用)、dom (cli 脚本使用,只在 PHP 5 中才被支持)

  当使用一个较新版本的 PHP 时,你可能会发现的提示

  1.   ;;;;; Note: packaged extension modules are now loaded via the .ini files; found in the directory /etc/php.d; these are loaded by default.;;;;  
  2.  

  这种情况下,并没有什么特殊的地方。不过需要验证下扩展模块相关 的ini配置文件是否已经配置在php支持的目录下。

  对于较老版本版本的PHP,你需要编辑 php.ini 并且增加

  1.   extension_dir = /etc/php.d  
  2.  

  这将支持 PHP 在配置的目录下寻找更多的扩展配置文件。对不同的 Linux 分支而言,扩展文件夹的路径可能并不相同,比如会在 extension_dir=/usr/lib/php/modules。

  编辑 /mysql.ini 以激活 mysql 扩展。

  1.   ; Enable mysql extension moduleextension=mysql.so  
  2.  

  编辑 /snmp.ini 以激活 snmp 扩展。

  1.   ; Enable snmp extension moduleextension=snmp.so  
  2.  

  如果使用 PHP 4.3.5 以下的版本,那么在 php.ini 中添加以下配置;如果使用 PHP 4.3.6 之上的版本,那么请在配置文件中移除此行(如果存在的话)。

  1.   session.save_path=/tmp  
  2.  

  配置网络服务器(Apache)

  如果你还在使用 Apaceh 1.3.x 版,那么安装使用 PHP 5.x 或许并不合适。

  请查找文件类似 "/etc/httpd/conf/httpd.conf" 的文件,并且确认文件中包含

  1.   # Load config files from the config directory "/etc/httpd/conf.d". Include conf.d/*.conf  
  2.  

  现在,请编辑其中的包含的PHP配置文件 "/etc/httpd/conf.d/php.conf",如果是使用 PHP 5,那么,确认文件中包含:

  1.   # PHP is an HTML-embedded scripting language which attempts to make it # easy for developers to write dynamically generated webpages. LoadModule php5_module modules/libphp5.so # # Cause the PHP interpreter to handle files with a .php extension. AddHandler php5-script .php AddType text/html .php # # Add index.php to the list of files that will be served as directory # indexes. DirectoryIndex index.php  
  2.  

  如果你不是安装 Cacti 到 Apache 默认的网络目录文件夹位置,那么在 /etc/httpd/conf.d 中新增配置文件 cacti.conf,并且按如下内容编辑。设置 /your/cacti/dir 为你自己的cacti目录名称。更新 Allow from 127.0.0.1 为任何你需要的的配置(比如,你所在公司的某个子网段)。请留意注释中的配置提示,尤其是在你启用了 SELinux 的时候!

  1.   # Cacti - the complete rrdtool-based graphing solution# # Allows only localhost by default## Allowing cacti to anyone other than localhost should be considered# dangerous unless properly secured by SSL# Make sure, that httpd can read your cacti directories.# At minimum, you need# chmod ugo+r -R /your/cacti/dir# Make sure to replace with your directories# When using SELinux, set the following:# chcon -R -h -t httpd_sys_content_t /your/cacti/dir# when using SELinux and you private homedir, enable# setsebool -P httpd_enable_homedirs 1# setsebool -P httpd_read_user_content 1Alias /cacti /your/cacti/dir AllowOverride None Order Deny,Allow Deny from all Allow from 127.0.0.1 Allow from ::1 Options Indexes Includes FollowSymLinks# These directories do not require access over HTTP # Order Deny,Allow Deny from All Allow from None  
  2.  

  MySQL设置

  为 MySQL 的 root 用户设置一个密码。

  1.   shell> mysqladmin --user=root password somepassword shell> mysqladmin --user=root --password reload  
  2.  

  请参阅MySQL的文档以了解详细内容。

  1.   UCD-SNMP-MIB::versionConfigureOptions.0 = STRING: "'-disable-shared'  
  2.  
  3.   '--with-mib-modules=host/hr_system'"  
  4.  

【编辑推荐】

Cacti安装篇

Cacti配置下的使用技巧

Cacti如何监控Tomcat

责任编辑:zhaolei 来源: cnblogs
相关推荐

2011-04-02 15:30:20

Cacti安装

2011-04-02 15:26:51

Cacti安装

2011-03-25 13:40:28

Cacti安装配置

2011-04-02 15:26:58

Cacti安装

2011-04-02 15:17:59

2011-03-25 15:01:44

Cacti安装

2011-04-02 15:17:48

Cacti安装

2010-01-13 11:17:50

2011-04-02 15:26:45

Cacti安装

2011-03-31 15:51:51

cacti

2011-03-25 11:02:19

Cacti安装

2011-04-01 12:22:35

2011-03-11 12:57:30

CentosLAMP

2010-06-09 16:55:04

2010-01-13 15:50:23

CentOS安装

2010-06-13 17:07:10

Cacti使用手册

2010-03-18 17:57:17

Python安装配置

2014-01-16 14:20:38

CactiCacti监控

2011-03-30 15:05:40

MRTG安装

2011-11-08 21:55:58

MRTG 配置
点赞
收藏

51CTO技术栈公众号