Zabbix self-template monitoring MySQL service

Source: Internet
Author: User

1.GUI interface Add MySQL template

Configuration--Hosts--click the host you want to add--Templates


Add a new template, click Select--Select "Template DB MySQL"

Click on "Add" to add, and finally click Update Updates;


2. Log in to the MySQL service and create a read-only account;

Mysql> Grant SELECT On * * to "Zabbix" @ "localhost" identified by "123456";    #赋权mysql > Flush Privileges; #刷新权限


3. Modify the agent configuration of the MySQL server

# cd /etc/zabbix/zabbix_agentd.d# cp userparameter_mysql.conf{,.bak}# vim  userparameter_mysql.conf  5 userparameter=mysql.status[*],echo  "show global  Status where variable_name= ' $ '; "  | HOME=/var/lib/zabbix /data/mysql/bin/mysql -N | awk  ' {print $$2} '  15 UserParameter=mysql.size[*],bash -c  ' echo  ' Select sum ($ (case  "$"   In both| "")  echo  "Data_length+index_length";;  data|index)  echo  "$3_length";;  free)  echo  "Data_free";;  ESAC)  from information_schema.tables$ ([[  "$"  =  "All"  | |  !  "$  ]] |" |  echo  " where table_schema=\" $1\ "") $ ([[  "$"  =  "All"  | |  !  "$  ]] |" |  echo  "and table_name=\" $2\ "");  | home=/var/lib/zabbix /data/mysql/bin/mysql -n '  16 17 userparameter=mysql.ping,home=/var/lib/zabbix /data/mysql/bin/mysqladmin ping |  Grep -c alive 18 userparameter=mysql.version,/data/mysql/bin/mysql -v


Note: 1.mysql and mysqladmin with absolute path;

2./var/lib/zabbix to/usr/local/zabbix/etc; as the location for storing the. my.cnf file;


# mkdir-pv/usr/local/zabbix/etc# vim/usr/local/zabbix/etc/.my.cnf\# mysql_agent #文件内容 [mysql]host=localhostuser=z abbixpassword=123456socket=/data/mysql/mysql.sock[mysqladmin]host=localhostuser=zabbixpassword=123456socket=/ data/mysql/mysql.sock# service Zabbix-agent restart# SS-TNL | grep 10050


4.GUI interface

See if MySQL template monitoring is in effect:

Configuration--and Hosts--tap to monitor the server's items options--

Application Select MySQL, click Apply to filter out other monitoring items, check whether the MySQL template monitoring is effective;


Monitoring--Latest data--

The hosts select the MySQL server to monitor; application select MySQL; click allly;


To view the monitoring image:

Monitoring--Graphs--

Host selects the MySQL server to monitor; graph chooses MySQL operations;





Zabbix self-template monitoring MySQL service

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.