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. 代理模式(Proxy)--动态代理(JDK)

    在是上一篇博客中实现了静态代理. 在上篇的结尾提到了一个问题: 思考:如果我们下需要对火车,自行车实现相同的代理,我们又该如何实现呢? 这篇博客就来解决这个问题: 解决这类问题需要用到动态代理技术,实 ...

  2. 动态路由协议(2)--rip

    1.设置pc ip 网关 192.168.1.1 192.168.1.254 192.168.4.1 192.168.4.254 2.设置路由器 (1)设置接口ip Router(config-/ R ...

  3. CQRS读写职责分离模式(Command and Query Responsibility Segregation (CQRS) Pattern)

    此文翻译自msdn,侵删. 原文地址:https://msdn.microsoft.com/en-us/library/dn568103.aspx 通过使用不同的接口来分离读和写操作,这种模式最大化了 ...

  4. 6、Python模块

    最常用的两个模块: os    #可以允许python调用执行系统命令,如shell sys    #处理与python程序本身的事情   Python自带200多个常用模块 Python官网收集了2 ...

  5. python 验证码识别之pytesser以及image学习记录

    一般的步骤就是上面这些,总的来说分为三部分,去除背景,分割字符,识别. 去除背景可以通过灰度化,二值化,去噪,倾斜度校正等(一般来说灰度化和二值化都是需要的,去噪和倾斜度看情况) 安装PIL工具,下载 ...

  6. Bean的作用域scope

    Bean的作用域scope 1.singleton 单例,指一个bean容器中只存在一份 2.prototype 每次请求(每次使用)创建新的实例,destroy方式不生效 3.request 每次h ...

  7. 基于HDFS的SparkStreaming案例实战和内幕源码解密

    一:Spark集群开发环境准备 启动HDFS,如下图所示: 通过web端查看节点正常启动,如下图所示: 2.启动Spark集群,如下图所示: 通过web端查看集群启动正常,如下图所示: 3.启动sta ...

  8. 2017.4.10 spring-ldap官方文档学习

    官网:http://www.springframework.org/ldap 官方文档及例子(重要):http://docs.spring.io/spring-ldap/docs/2.1.0.RELE ...

  9. C#.NET为List加入扩展方法:获取唯一值

    public static class ListTools { /// <summary> /// 获取唯一值列表 /// </summary> /// <param n ...

  10. S3:代理模式 Proxy

    为其他对象提供一种代理以控制对这个对象的访问. 使用场合: 1.远程代理:为一个对象在不同的地址空间提供局部代表,隐藏对象存在于不同地址空间的事实.2.虚拟代理:根据需要创建开销很大的对象,通过它来存 ...