配置 Cacti 监控 MySQL 数据库状态


MySQL 自身在性能监测方面很不给力、这是令许多 MySQL DBA 夜夜辗转难眠、幸运的是、通过 Cacti 监测(注意是监测而非监控)MySQL 数据库状态。

借助 cacti+rrdtool 强大的绘图功能、加上专用的 mysql 模板、能够灵活快速的创建对多个 MySQL 实例的监测

㈠ 如果是RPM方式安装,需要下列RPM包:

httpd

php

php-mysql

php-snmp

mysql

mysql-server

net-snmp*

㈡ 安装 RRDTool

# wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.14.tar.gz

# tar -zxv -f rrdtool-1.4.4.tar.gz

# ./configure --prefix=/usr/local/rrdtool  --disable-python  --disable-tcl

# make

# make install

可能遇到的故障:

configure: error: Please fix the library issues listed above and try again

请查阅→→troubleshoting 

㈢ 安装 CACTI

# wget http://www.cacti.net/downloads/

# useradd cacti

# tar -zxv -f cacti-0.8.7i.tar.gz

# mv cacti-0.8.7i /var/www/cacti

# chown -R cacti:cacti /var/www/cacti

㈣ 配置 apache 模块

编辑 apache 配置文件:vim httpd.conf

① 修改服务名称:

ServerAdmin 192.168.1.113:80

② 修改站点起始目录:

DocumentRoot "/var/www"

③ 修改目录:

<Directory "/var/www">

④ 增加默认做为首页的文件名:

DirectoryIndex index.html index.php

⑤ 增加对php类型的支持:

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

然后:wq保存退出!

执行 apachectl -t 检查配置文件语法,正常情况下应返回Syntax OK:

启动snmp服务:service snmpd start

启动apache服务:apachectl start

  • 1
  • 2
  • 下一页

相关内容