Skip to content
zabbix mysql module
C Makefile
Branch: master
Clone or download
Shawn Cao
Shawn Cao update readme.md
Latest commit 44f3c32 Dec 23, 2016
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
LICENSE Initial commit Dec 7, 2015
Makefile upload code Dec 7, 2015
README upload code Dec 7, 2015
README.md update readme.md Dec 23, 2016
mysql.c fix bug Dec 10, 2015
zbx_module_mysql.conf upload code Dec 7, 2015
zbx_template_mysql_active.xml upload code Dec 7, 2015
zbx_template_mysql_slave_active.xml upload code Dec 7, 2015

README.md

Description

This directory contains a sample module, which extends functionality of Zabbix Agent.

Status

This module is testing.

Installation

	$ git clone https://github.com/cnshawncao/zabbix-module-mysql.git
	$ cp -r zabbix-module-mysql zabbix-x.x.x/src/modules/mysql	# zabbix-x.x.x is zabbix version
  1. run 'make' to build it. It should produce mysql.so.

  2. copy mysql.so to the module directory, like LoadModulePath=/etc/zabbix/modules

  3. change config file add line : LoadModule=mysql.so

  4. cp zbx_module_mysql.conf to /etc/zabbix, modify it

    mysql_inst_ports = 3306,192.168.9.9:3307,3308:S

    mysql_inst_user = USER

    mysql_inst_password = PASSWORD

  5. restart zabbix_agent daemon

  6. import the mysql and mysql slave template

  7. create mysql user

    GRANT PROCESS, SUPER ON . TO 'USER'@'127.0.0.1' IDENTIFIED BY 'PASSWORD';

  8. link the template to the host

Synopsis

key: mysql.discovery

value:

{"data":[{"{#MYSQLHOST}":"127.0.0.1","{#MYSQLPORT}":"3306"},{"{#MYSQLHOST}":"192.168.9.9","{#MYSQLPORT}":"3307"},{"{#MYSQLHOST}":"127.0.0.1","{#MYSQLPORT}":"3308"}]}

key: mysql.status[{#MYSQLHOST},{#MYSQLPORT},key]

key: mysql.ping[{#MYSQLHOST},{#MYSQLPORT}]

key: mysql.slave.discovery

value:

{"data":[{"{#MYSQLSLAVEHOST}":"127.0.0.1","{#MYSQLSLAVEPORT}":"3308"}]}

key: mysql.slave.status[{#MYSQLSLAVEHOST},{#MYSQLSLAVEPORT},key]

You can’t perform that action at this time.