blackbird mysql plugin
This plugin gets various information from mysql and sends the data to the backend Currently, you can monitor the following information: (I am targeting mysql 5.5 series, but I think that there is no particular problem with 5.6)
SELECT VERSION()
SHOW GLOBAL VARIABLES
SHOW GLOBAL STATUS
SHOW ENGINE INNODB STATUS
SHOW SLAVE STATUS
Each acquisition item is in the unit of component
.
Zabbix Template is prepared for each component
, so please use the component you want to monitor and Zabbix Template as a set.
The correspondence table between component
and Zabbix Template is as follows.
component | content | zabbix template |
---|---|---|
(defaultt) | get mysql version and check mysql health | MySQL_5.5_general.xml |
global_variables | get information by SHOW GLOBAL VARIABLES | MySQL_5.5_variables.xml |
global_status | get information by SHOW GLOBAL STATUS | MySQL_5.5_status.xml |
innodb_status | get information by SHOW ENGINE INNODB STATUS | MySQL_5.5_innodb.xml |
slave_status | get information by SHOW SLAVE STATUS | MySQL_5.5_slave.xml |
table_count | discovery number of tables in database (lld) | MySQL_5.5_general.xml |
** Each Zabbix Template, but created with Zabbix 2.4 ** ** Since the definition of Trigger has changed, it cannot be used in 2.2 series **
Install
Please install by referring to here
Install mysql plugin
You can either use setup.py or rpm.
There is also a way to insert it manually, but in that case please use the module of MySQLdb
of python separately
git clone https://github.com/Vagrants/blackbird-mysql.git
cd blackbird-mysql
python setup.py install
yum install blackbird-mysql --enablerepo=blackbird
Dependency requires MySQL-python
Create a user to which blackbird connects
mysql> GRANT SELECT, REPLICATION CLIENT, SHOW DATABASES, PROCESS ON *.* TO 'bbd'@'127.0.0.1' IDENTIFIED BY 'bbd';
Please change ip address, username and password as appropriate. Connection user information can be set freely with config If you already have a user for monitoring, you don't have to create it.
config is in /etc/blackbird/conf.d/mysql.cfg
You can set component
and monitoring interval
ini:/etc/blackbird/conf.d/mysql.cfg
[mysql]
module = 'mysql'
# mysql setting
#
# - Please create monitor user like this.
#
# mysql> GRANT SELECT, REPLICATION CLIENT, SHOW DATABASES, PROCESS ON *.* TO 'bbd'@'127.0.0.1' IDENTIFIED BY 'bbd';
#
# mysqlhost = '127.0.0.1'
# mysqluser = 'bbd'
# mysqlpass = 'bbd'
# components
# - global_variables : SHOW GLOBAL VARIABLES;
# - global_status : SHOW GLOBAL STATUS;
# - innodb_status : SHOW ENGINE INNODB STATUS;
# - slave_status : SHOW SLAVE STATUS;
# - table_count (LLD): SELECT table_schema, COUNT(table_name) FROM information_schema.TABLES GROUP BY table_schema;
#
components = 'global_variables,global_status,innodb_status,slave_status,table_count'
# interval for this module
#
# interval = 60
# lld_interval = 600
#
# You can set the different interval time for each component.
#
# [mysql]
# module = 'mysql'
# components = 'version,global_variables,global_status,innodb_status'
# interval = 60
#
# [mysql_slave_monitor_frequent_intervals]
# module = 'mysql'
# components = 'slave_status'
# interval = 10
At the back of config, there is a setting method when you want to change the monitoring interval only for a specific component
as TIPS.
Reboot blackbird
when you're done
sudo /etc/init.d/blackbird restart
Zabbix Templates can be found in the github repository Please import to Zabbix and apply to the target server
** If the host name on Zabbix and the host name of the server on which blackbird is running are different, you need to set the hostname on /etc/blackbird/conf.d/mysql.cfg
**
Please match with Zabbix
ini:/etc/blackbird/conf.d/mysql.cfg
hostname = your_static_hostname
SHOW PROCESSLIST
is under consideration)Recommended Posts