Monitor MySQL with the Percona monitor plugin

Source: Internet
Author: User
Tags php script percona

1. Monitor MySQL with the Percona monitor plugin

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 script is used to collect 2.shell call this PHP 3.zabbix profile 4.zabbix template file to create Zabbix monitoring dedicated user.

Percona monitoring Plugins for Zabbixthese templates is mainly adopted from the existing Cacti ones. Currently, only the MySQL template is available. There is a few major differences between CACTI and Zabbix Templates:zabbix does not support negative Y axis, that's why Y OU can see the negative values in 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 could not look so nice as in Ca CTI as the stacks is replaced with lines. Other Zabbix specific points:the items is populated by polling Zabbix agent. There is predefined triggers available to use. There is a screens 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 Requirementszabbix version 2.0.x. The actual testing have been done On the version 2.0.9.Zabbix Agent, PHP, php-mysql packages on monitored node. Installation Instructionsconfigure Zabbix Agentinstall The package from Percona software Repositories:yum install Percona -zabbix-templatesor:apt-get install percona-zabbix-templatesit would 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/percon A/. 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.confensure/etc/zabbix_agentd.conf Contains the Line:include=/etc/zabbix_agentd.conf.d/restart agent:service zabbix-agent restartconfigure MySQL Connectivity on Agenton 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 fileexample:<?php$mysql_user = ' root '; $mysql _pass = ' S3cret '; Test the script:[[email protected] main]#/var/lib/zabbix/percona/scripts/get_mysql_stats_wrapper.sh Gg405647should return any number. If The password is wrong in. cnf file, you'll get something like:[[email protected] ~]#/VAR/LIB/ZABBIX/PERCONA/SCR ipts/get_mysql_stats_wrapper.sh ggerror:run The command manually to investigate the problem:/usr/bin/php-q/var/lib/zab bix/percona/scripts/ss_get_mysql_stats.php--host localhost--items gg[[email protected] ~]#/usr/bin/php-q/var /lib/zabbix/percona/scripts/ss_get_mysql_stats.php--host localhost--items ggerror:can ' t connect to local MySQL server Through socket '/var/lib/mysql/mysql.sock ' (2) [[email protected] ~] #Configure ~zabbix/.my.cnfexample:[client] user = Rootpassword = s3crettest the script:[[email protected] ~]# sudo-u zabbix-h/var/lib/zabbix/percona/scripts/ Get_mysql_stats_wrapper.sh running-slave0should return 0 or 1 buT not the "Access denied" error. Configure Zabbix Servergrab 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" (Te Mplates tab). You were done. Support Optionsif You has questions, comments, or need help with the plugins, there is 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.

Monitor MySQL with the Percona monitor plugin

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.