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

  1. 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.

  2. 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
  3. Ensure /etc/zabbix_agentd.conf contains the line: Include=/etc/zabbix_agentd.conf.d/

  4. 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.

  1. 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';
  2. 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 ~]#
  3. Configure ~zabbix/.my.cnf

    Example:

    [client]
    user = root
    password = s3cret
    
  4. 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

  1. Grab the latest tarball from the Percona Software Downloads directory to your desktop.
  2. Unpack it to get zabbix/templates/ folder.
  3. Import the XML template using Zabbix UI (Configuration -> Templates -> Import) by additionally choosing “Screens”.
  4. 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 Monitoring Plugins
Call Us
+1-888-316-9775 (USA - Sales)
+1-208-473-2904 (USA - Sales)
+44-208-133-0309 (UK - Sales)
0-800-051-8984 (UK - Sales)
0-800-181-0665 (GER - Sales)
+1-877-862-4316 (Emergency)
+1-855-55TRAIN (Training)
+1-925-271-5054 (Training)

Table Of Contents

Previous topic

Upgrading Percona Monitoring Plugins for Cacti

Next topic

2014-03-21: version 1.1.3



© Copyright 2012, Percona Inc.
Except where otherwise noted, this documentation is licensed under the following license:
CC Attribution-ShareAlike 2.0 Generic
This documentation is developed in Launchpad as part of the Percona Monitoring Plugins source code.
If you spotted innacuracies, errors, don't understood it or you think something is missing or should be improved, please file a bug.
]]>