Giter Club home page Giter Club logo

zabbix_mysql's Introduction

zabbix_mysql

Yet another mysql monitor for zabbix, like percona monitor for zabbix. only test in zabbix 2.2.

read more:

percona-monitor

Note

Instead of ss_get_mysql_stats.php with mymonitor.pl, the other configuration is similar with ss_get_mysql_stats.php.

Read more: perldoc mymonitor.pl

mysql_port.pl: MySQL port discovery for multiport of MySQL, and generate json format strings.

get_mysql_stats_wrapper.sh: a wrapper for parse MySQL status, runs every 5min.

Require

perl-DBI
perl-DBD-mysql

Install

Configure MySQL connectivity on Agent

1. # git clone https://github.com/arstercz/zabbix_mysql.git /usr/local/zabbix_mysql 

2. # bash /usr/local/zabbix_mysql/install.sh eth0

note: eth0 is your ip address interface.

Configure Zabbix Server

1. import templates/zabbix_mysql_multiport.xml using Zabbix UI(Configuration -> Templates -> Import), and Create/edit hosts by assigning them “MySQL” group and linking the template “MySQL_zabbix” (Templates tab).

Note

The following privileges are needed by monior user. the user and password in get_mysql_stats_wrapper.sh and mymonitor.pl can be changed, but without following privileges:

    PROCESS, SUPER, REPLICATION SLAVE

you can specify the user and password in get_mysql_stats_wrapper.sh with --user and --password option.

As zabbix process running by zabbix user, netstat must run with following command:

    chmod +s /bin/netstat

Test

# perl  mymonitor.pl --host 10.0.0.10 --port 3300 --items hv
hv:36968
# perl  mymonitor.pl --host 10.0.0.10 --port 3300 --items kx
kx:1070879944

# php ss_get_mysql_stats.php --host 10.0.0.10 --port 3300 --items hv
hv:36968
# php ss_get_mysql_stats.php --host 10.0.0.10 --port 3300 --items kx 
kx:1070911408

# zabbix_get -s 10.0.0.10 -p 10050 -k "MySQL.Bytes-received[3300]"
472339244134

changelog

20190730: Add slave check, also report error message:

item                        throttle
slave_check              report last_error if io_thread or sql_thread is No
20170526: Add innodb status check, like percona-monitor
item                       throttle
max_duration             if > 100s, then trigger an alarm
waiter_count             if > 10, then trigger an alarm
idle_blocker_duration    if > 200s, then trigger an alarm

such as:

zabbix_get -s cz-test2 -p 10050 -k "MySQL.max_duration[3301]"
max_duration:longest transaction active seconds: max time: 18, thread_id: 4838781, user: [email protected]:59980

zabbix_mysql's People

Contributors

arstercz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zabbix_mysql's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.