使用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是 ...
随机推荐
- RMI,socket,rpc,hessian,http比较
SOCKET使用时可以指定协议TCP,UDP等: RIM使用JRMP协议,JRMP又是基于TCP/IP: RPC底层使用SOCKET接口,定义了一套远程调用方法: HTTP是建立在TCP上,不是使用S ...
- GIF工具 | 分享几个Gif相关工具
文章目录 LICEcap GiFResizer LICEcap LICEcap 是一款屏幕录制工具,支持导出GIF动画图片格式,轻量级.使用简单,录制过程中可以随意改变录屏范围. 下载地址: 官方地址 ...
- Hadoop 2.2.0 Job源代码阅读笔记
本文所有涉及的内容均为2.2.0版本中呈现. 概述: Job在创建Job并且提交的人的眼中,可以在创建的时候通过配置Job的内容,控制Job的执行,以及查询Job的运行状态.一旦Job提交以后,将不能 ...
- sql索引从入门到精通(十亿行数据测试报告)
原文:sql索引从入门到精通(十亿行数据测试报告) 导读部分 --------------------------------------------------------------------- ...
- 系统学习Linux建议
国内的专业Linux网站(GB) ChinaUnix Linux中国 实验楼: 免费提供了Linux在线实验环境,不用在自己机子上装系统也可以学习Linux,超方便实用!. 国内的专业Linux网站( ...
- UBI文件系统简介
转:http://www.embedu.org/Column/Column102.htm 在linux-2.6.27以前,谈到Flash文件系统,大家很多时候多会想到cramfs.jffs2.yaff ...
- 【Linux】CentOS7上设置快捷键 随时补充
---------------------------------------------------------------------------------------------------- ...
- WIN10 64位 JDK的安装
因为电脑系统换掉,重装系统,重新配置了一下环境,安装JDK,现记录一下过程,以便下次查询使用. 官网下载JDK,地址:http://www.oracle.com/technetwork/java/ja ...
- numpy 多维数组的存取
多维数组的存取和一维数组类似,由于多维数组有多个轴,所以他的下标需要多个值来表示.这里讨论的主要是二维数组.二维数组0轴以行为单位,1轴以列为单位,存取数组使用元组作为下标,需要注意的是,python ...
- Python中的XMLRPC(Calendar)
XMLRPC服务器端代码,定义了三个方法名,getMonth获取所给月份的日历,getYear获取一年的日历,getDict测试返回字典的效果. xmlrpc_server.py: #!/usr/bi ...