Zabbix:mysql Monitoring

Source: Internet
Author: User

Originally wanted to use Percona's msyql template to monitor MySQL, but still want to write their own script more paste into need to cause.


I. (Zabbix-agent end)


1. On the agent side configuration, I use the Yum installation version 3.2.17 (the server is also 3.2.17 but is compiled installation) only the MySQL monitoring other parameters please own Baidu

[[email protected] ~]# grep ^[a-z]/etc/zabbix/zabbix_agentd.conf

Pidfile=/var/run/zabbix/zabbix_agentd.pid

Logfile=/var/log/zabbix/zabbix_agentd.log

Logfilesize=0

server=10.29.64.153

listenip=10.30.2.85

Hostname=6l-test.system.com

Timeout=30

Include=/etc/zabbix/zabbix_agentd.d/*.conf


2. Write MySQL to extract the value of the script I put it here under the/etc/zabbix/zabbix_agentd.d/.


[Email protected] ~]# vi/etc/zabbix/zabbix_agentd.d/mysql_02.sh

#!/bin/bash

# date:2017/09/07

# descriptor:mysql Montior Script

Custom_parameter=$1

If ["$#"-eq 1];then

/usr/bin/mysql-uroot-p123456-e "Show session Status like ' ${custom_parameter} ';" 2>/dev/null | /usr/bin/awk ' nr==2 {print $NF} '

Else

echo "Parameter input error"

Fi


3. Configure the user parameters file

[Email protected] ~]# cat/etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf

Userparameter=custom.mysql[*],/etc/zabbix/zabbix_agentd.d/mysql_02.sh "$"


4. Restart Service Systemctl Restart Zabbix-agent

The script is sent to the server by the service side, so this is suitable for passive mode to this agent side has been configured to complete

On Zabbix-server Server # Execute this command to verify Zabbix_get-s 10.24.249.178-k Custom.mysql[uptime]


I. (Zabbxi-server end) can be made into a template in the key place to fill in the need to monitor parameters can be:

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M01/A5/E6/wKioL1nE1SiDsCTGAABaj4BOZ7k319.png "title=" QQ picture 20170919153152.png "alt=" Wkiol1ne1sidsctgaabaj4boz7k319.png "/>


Note : The Red arrow in parentheses is the corresponding agent side of the specific change script can be

This article is from the "Lost Night" blog, please be sure to keep this source http://36yyk.blog.51cto.com/7133831/1967841

Zabbix:mysql Monitoring

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.