使用Percona监控插件监控MySQL
1.使用Percona监控插件监控MySQL
yum install http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm
https://www.percona.com/doc/percona-monitoring-plugins/1.1/zabbix/index.html#installation-instructions
yum install percona-zabbix-templates php php-mysql
1.php脚本用来数据采集 2.shell 调用这个php 3.zabbix配置文件 4.zabbix模板文件 创建zabbix监控专用用户。
Percona Monitoring Plugins for Zabbix
These templates are mainly adopted from the existing Cacti ones. Currently, only MySQL template is available. There are a few major differences between Cacti and Zabbix templates: Zabbix does not support negative Y axis, that’s why you can see the negative values on some graphs to work out that - consider them the same as positive ones.
Zabbix does not support stacked graph items with mixed draw styles, that’s why some graphs may not look so nice like in Cacti as the stacks are replaced with lines.
Other Zabbix specific points: The items are populated by polling Zabbix agent.
There are predefined triggers available to use.
There is a screen as a placeholder for all graphs.
300 sec. polling interval - like with Cacti, the existing PHP script is used to retrive and cache MySQL metrics except some trigger-specific items. Due to the caching of results, PHP script runs only once per period.
System Requirements
Zabbix version 2.0.x. The actual testing has been done on the version 2.0.9.
Zabbix agent, php, php-mysql packages on monitored node.
Installation Instructions
Configure Zabbix Agent
Install the package from Percona Software Repositories: yum install percona-zabbix-templates
or: apt-get install percona-zabbix-templates
It will place files under /var/lib/zabbix/percona/. Alternatively, you can grab the tarball and copy folders zabbix/scripts/ and zabbix/templates/ into /var/lib/zabbix/percona/. See below for the URL.
Copy Zabbix Agent config: mkdir -p /etc/zabbix_agentd.conf.d/
cp /var/lib/zabbix/percona/templates/userparameter_percona_mysql.conf /etc/zabbix_agentd.conf.d/userparameter_percona_mysql.conf
Ensure /etc/zabbix_agentd.conf contains the line: Include=/etc/zabbix_agentd.conf.d/
Restart Agent: service zabbix-agent restart
Configure MySQL connectivity on Agent
On this step we need to configure and verify MySQL connectivity with localhost on the Agent node. Create .cnf file /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php.cnf as described at configuration file Example: <?php
$mysql_user = 'root';
$mysql_pass = 's3cret';
Test the script: [root@centos6 main]# /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh gg
405647
Should return any number. If the password is wrong in .cnf file, you will get something like: [root@centos6 ~]# /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh gg
ERROR: run the command manually to investigate the problem: /usr/bin/php -q /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php --host localhost --items gg
[root@centos6 ~]# /usr/bin/php -q /var/lib/zabbix/percona/scripts/ss_get_mysql_stats.php --host localhost --items gg
ERROR: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)[root@centos6 ~]#
Configure ~zabbix/.my.cnf Example: [client]
user = root
password = s3cret
Test the script: [root@centos6 ~]# sudo -u zabbix -H /var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh running-slave
0
Should return 0 or 1 but not the “Access denied” error.
Configure Zabbix Server
Grab the latest tarball from the Percona Software Downloads directory to your desktop.
Unpack it to get zabbix/templates/ folder.
Import the XML template using Zabbix UI (Configuration -> Templates -> Import) by additionally choosing “Screens”.
Create/edit hosts by assigning them “Percona Templates” group and linking the template “Percona MySQL Server Template” (Templates tab).
You are done.
Support Options
If you have questions, comments, or need help with the plugins, there are several options to consider. You can get self-service help via Percona’s forums, or the Percona mailing list. You can report bugs and submit patches to the Launchpad project.
使用Percona监控插件监控MySQL的更多相关文章
- Jmeter添加性能监控插件监控被测系统资源
使用jmeter来监控服务器资源(CPU.I/O.内存.网络等),需要安装jmeter性能监控插件以及在被测服务器中启动监控服务. 一.下载并安装插件 下载 Plugins Manager插件管理器, ...
- zabbix通过percona插件监控mysql
percona zabbix mysql-plugin是percona发布的一个使用zabbix监控mysql数据库的工具,这款工具比zabbix自带的监控模板要强大的多,毕竟percona是Mysq ...
- zabbix4.2学习笔记--安装percona插件监控MySQL
percona-monitoring-plugins是percona专门为MySQL监控的工具,支持Nagios,cacti,zabibx,本文主要介绍percona-monitoring-plugi ...
- 转 zabbix debug and zabbix使用percona插件监控mysql
########## https://www.cnblogs.com/keithtt/p/8542987.html zabbix使用percona插件监控mysql 1.添加percona仓库. ...
- 011-通过安装percona插件监控MySQL
percona-monitoring-plugins是percona专门为MySQL监控的工具,支持Nagios,cacti,zabibx,本文主要介绍percona-monitoring-plugi ...
- zabbix监控nginx,mysql,java
zabbix 支持的主要监控方式(1)agent代理程序 在Agent监控方式下,zabbix-agent会主动收集本机的监控信息并通过TCP协议与zabbix-server传递信息.Agent 监控 ...
- [k8s]prometheus+grafana监控node和mysql(普罗/grafana均vm安装)
https://github.com/prometheus/prometheus Architecture overview Prometheus Server Prometheus Server 负 ...
- 通过Centreon监控apache、MySQL、Hadoop服务状态
在上面的章节中,只是简单介绍了Centreon的几个基础监控项,例如添加主机.服务等,这些对于一个监控系统来说是远远不够的,本节将重点介绍对一些扩展服务的监控,也就是对一些常见应用的监控. 一. Na ...
- 【linux环境下】RabbitMq的安装和监控插件安装
[注意安装过程中,提示某些命令not found,直接yum isntall一下就好了] 以下是我在CentOS release 6.4下亲测成功的. RabbitMq的安装: RabbitMQ是 ...
随机推荐
- BZOJ 2669- [cqoi2012]局部极小值
不错的题啊 挺好的结合了容斥和状压DP 保证每个数各不相同,又有大小关系,那么就可以将数字从小到大填. 不难发现 局部极小值<=8,这个可以状压,f[i][j] 表示填了前i个数,局部极小值被填 ...
- [COCI2015]ZGODAN
题目大意: 给你一个数$n(n\leq10^1000)$,定义一个数是“美丽数”当且仅当这个数各个数位上的数奇偶性不同. 求最接近$n$的“美丽数”,若有多个,则依次输出. 思路: 贪心+高精度. 首 ...
- [NOIP模拟赛][贪心]奶牛晒衣服.
奶牛晒衣服(dry) [问题描述] 在熊大妈英明的带领下,时针和它的同伴生下了许多牛宝宝.熊大妈决定给每个宝宝都穿上可爱的婴儿装.于是,为牛宝宝洗晒衣服就成了很不爽的事情. 圣人王担负起了这个重任.洗 ...
- 细说JavaScript对象(2):原型对象
JavaScript 并没有类继承模型,而是使用原型对象 prototype 进行原型式继承. 尽管人们经常将此看做是 JavaScript 的一个缺点,然而事实上,原型式继承比传统的类继承模型要更加 ...
- 设计模式之享元模式(PHP实现)
github地址:https://github.com/ZQCard/design_pattern /** * 减少创建对象的数量,以减少内存占用和提高性能.这种类型的设计模式属于结构型模式, * 它 ...
- python里的“__all__ ”作用
转载:http://python-china.org/t/725 参考:http://www.cnblogs.com/alamZ/p/6943869.html 用 __all__ 暴露接口,这是一种约 ...
- vim常用操作之复制剪切粘贴,注释取消注释,多行缩进等
进入vim按下v键,选择要操作的对象 按下y复制,d剪切,p粘贴 >缩进,<取消缩进 按下esc退出操作 按下ctrl+v,选择要操作对象, 按下大写I,写入注释符号,按下d取消注释 按下 ...
- ES翻译之Function Score Query
Function Score Query 原文链接 function_score允许你修改通过查询获取文档的分数,很有用处,score function是计算昂贵的,以及在过滤一系列文档上计算分数是高 ...
- kata-container环境搭建
一.安装qemu 注意,目前kata-container所要求的qemu最低版本是v2.7.0.在笔者的环境下(Ubuntu16.04 VM),apt-get官方源的最高版本是v2.5.0.所以不要用 ...
- fabricjs line
let line1 = new fabric.Line([lineleft, lineheight, lineleft, 0], {//终止位置,线长,起始位置,top,这里是从项目中截下来的我用了变 ...