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的更多相关文章

  1. Jmeter添加性能监控插件监控被测系统资源

    使用jmeter来监控服务器资源(CPU.I/O.内存.网络等),需要安装jmeter性能监控插件以及在被测服务器中启动监控服务. 一.下载并安装插件 下载 Plugins Manager插件管理器, ...

  2. zabbix通过percona插件监控mysql

    percona zabbix mysql-plugin是percona发布的一个使用zabbix监控mysql数据库的工具,这款工具比zabbix自带的监控模板要强大的多,毕竟percona是Mysq ...

  3. zabbix4.2学习笔记--安装percona插件监控MySQL

    percona-monitoring-plugins是percona专门为MySQL监控的工具,支持Nagios,cacti,zabibx,本文主要介绍percona-monitoring-plugi ...

  4. 转 zabbix debug and zabbix使用percona插件监控mysql

    ########## https://www.cnblogs.com/keithtt/p/8542987.html zabbix使用percona插件监控mysql   1.添加percona仓库. ...

  5. 011-通过安装percona插件监控MySQL

    percona-monitoring-plugins是percona专门为MySQL监控的工具,支持Nagios,cacti,zabibx,本文主要介绍percona-monitoring-plugi ...

  6. zabbix监控nginx,mysql,java

    zabbix 支持的主要监控方式(1)agent代理程序 在Agent监控方式下,zabbix-agent会主动收集本机的监控信息并通过TCP协议与zabbix-server传递信息.Agent 监控 ...

  7. [k8s]prometheus+grafana监控node和mysql(普罗/grafana均vm安装)

    https://github.com/prometheus/prometheus Architecture overview Prometheus Server Prometheus Server 负 ...

  8. 通过Centreon监控apache、MySQL、Hadoop服务状态

    在上面的章节中,只是简单介绍了Centreon的几个基础监控项,例如添加主机.服务等,这些对于一个监控系统来说是远远不够的,本节将重点介绍对一些扩展服务的监控,也就是对一些常见应用的监控. 一. Na ...

  9. 【linux环境下】RabbitMq的安装和监控插件安装

    [注意安装过程中,提示某些命令not found,直接yum isntall一下就好了] 以下是我在CentOS release 6.4下亲测成功的. RabbitMq的安装:   RabbitMQ是 ...

随机推荐

  1. 1.14(java学习笔记)数组

    假如我们需要用到1000个相同类型的数据,肯定不可能创建1000个变量, 这样既不方便,也不直观,也不便于我们使用.这时就需要用到数组. 一.数组的声明与使用 public class Array { ...

  2. elasticsearch 分布式部署

    修改配置文件 /config/elasticsearch.yml 我用两台机器,内网地址分别为230 和 231 处理启动报错一: [2017-01-12T15:55:55,433][INFO ][o ...

  3. 细说JavaScript对象(1):对象的使用和属性

    JavaScript 中的一切都可以视为对象,除了两个特例:null 和 undefined. false.toString(); // 'false' [1, 2, 3].toString(); / ...

  4. [sharepoint]文档库,文件夹授权

    写在前面 在项目中用到了文档库授权的方法,这里将查询到的方式总结一下. 涉及到的方法 在逻辑中用到的方法. /// <summary> /// 获取sharepoint站点角色定义 res ...

  5. Web性能压力测试工具之WebBench详解

    PS:在运维工作中,压力测试是一项很重要的工作.比如在一个网站上线之前,能承受多大访问量.在大访问量情况下性能怎样,这些数据指标好坏将会直接影响用户体验.但是,在压力测试中存在一个共性,那就是压力测试 ...

  6. log4j教程 11、日志记录到文件

    要写日志信息到一个文件中,必须使用org.apache.log4j.FileAppender.有以下FileAppender的配置参数: FileAppender配置: 属性 描述 immediate ...

  7. tar命令解压缩出错

    [root@zhoucentos share1]# tar zxvf otp_src_19..tar.gz gzip: stdin: not in gzip format tar: Child ret ...

  8. Intellij Idea如何不显示.idea target文件夹

    Intellij Idea如何不显示.idea target文件夹 学习了:https://jingyan.baidu.com/article/ceb9fb108e26958cac2ba047.htm ...

  9. node-表单验证

    var http = require('http'); var url = require('url'); var fs = require('fs'); var querystring = requ ...

  10. 打造你的前端神器-webstorm11

    说起前端编辑器,用过dw,sublime,hbuilder,webstorm也不陌生,之前的版本8有用过一下,但是觉得比sublime重量太多,但是随着后来用node的开始,发现需要打造个web前端神 ...