最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

Cacti监控MySQL笔记

来源:动视网 责编:小采 时间:2020-11-09 12:19:30
文档

Cacti监控MySQL笔记

Cacti监控MySQL笔记:Cacti 监控 MySQL1. 安装监控插件cd /optwget http://mysql-cacti-templates.googlecode.com/files/mysql-cacti-templates-1.1.2 Cacti 监控 MySQL 1. 安装监控插件 cd /optwget tar -xzvf mysql-cacti-te
推荐度:
导读Cacti监控MySQL笔记:Cacti 监控 MySQL1. 安装监控插件cd /optwget http://mysql-cacti-templates.googlecode.com/files/mysql-cacti-templates-1.1.2 Cacti 监控 MySQL 1. 安装监控插件 cd /optwget tar -xzvf mysql-cacti-te


Cacti 监控 MySQL1. 安装监控插件cd /optwget http://mysql-cacti-templates.googlecode.com/files/mysql-cacti-templates-1.1.2

Cacti 监控 MySQL

1. 安装监控插件

cd /opt
wget
tar -xzvf mysql-cacti-templates-1.1.2.tar.gz
cp /opt/mysql-cacti-templates-1.1.2/ss_get_mysql_stats.php /var/www/html/scripts/

chown -R apache.apache /var/www/html/scripts
chmod -R 755 /var/www/html/scripts

使用 http 访问 cacti主机 导入 /opt/mysql-cacti-templates-1.1.2/cacti_host_template_x_db_server_ht_0.8.6i.xml

默认CactiEZ 账户和密码分别是 admin admin

控制台 - 导入导出 - 模板导入 - 浏览

选中 cacti_host_template_x_db_server_ht_0.8.6i.xml
保存

2. 配置cacti的mysql插件

修改 ss_get_mysql_stats.php

vi /var/www/html/scripts/ss_get_mysql_stats.php

$mysql_user = 'cacti';
$mysql_pass = 'cacti';
$cache_dir = "/tmp/cacti/cache/";

这个账户和密码是 被监控端主机 给 Cacti主机 授权的 账户和密码
Cacti需要这个账户和密码去连接 被监控机 查询状态

mkdir -p /tmp/cacti/cache
chown -R apache.apache /tmp/cacti
chmod -R 755 /tmp/cacti

设置 cacti 缓存目录在 /tmp/cacti/cache/ 并给予权限

3. 配置被监控端的mysql 给 cacti 主机授权

mysql -uroot -p
grant process,super on *.* to 'cacti'@'192.168.0.195' identified by 'cacti';
exit

grant process,super on *.* to '账户'@'Cacti主机IP地址' identified by '密码';
此命令 意义
只允许IP为 192.168.0.195 的主机 以 账户 cacti 密码 cacti 去访问 本机数据

4. 在Cacti主机上 监控Mysql

4.1 为主机添加mysql模块
控制台 - 管理 - 设备 - 选中之前创建好的主机
然后移到最下面的 添加图形模版 选中 Mysql相关模块 然后保存

4.2 为mysql模块创建图形
控制台 - 创建 - 创建图形 - 选中该主机 - 选中mysql模块 - 创建

4.3 插件mysql性能数据
监视器 - 选中该主机 - 查阅对应的mysql

完毕

mysqld_safe --user=mysql &

mysql -uroot -p

mysql -uroot -proot
grant ALL PRIVILEGES ON *.* to root@"%" identified by "root" WITH GRANT OPTION;
exit

grant select,insert,update,delete on cacti.* to cacti@* identified by "cacti";
exit

grant process,super on *.* to 'cacti'@'%' identified by 'cacti';
grant all privileges on cacti.* to cacti@"%" identified by "cacti";


客户端开启Cacti访问本机mysql的权限

grant process,super on *.* to 'cacti'@'192.168.0.195' identified by 'cacti';
grant process,super on *.* to 'cacti'@'192.168.0.97' identified by 'cacti';

= = = = =

mysql -ucacti -pcacti -h 192.168.0.97

文档

Cacti监控MySQL笔记

Cacti监控MySQL笔记:Cacti 监控 MySQL1. 安装监控插件cd /optwget http://mysql-cacti-templates.googlecode.com/files/mysql-cacti-templates-1.1.2 Cacti 监控 MySQL 1. 安装监控插件 cd /optwget tar -xzvf mysql-cacti-te
推荐度:
标签: 监控 my mysql
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top