echo "Slave is not running!" | mail -s "warn! $MYSQLIP MySQL Slave is not running" yuhongchun027@163.com fi
We recommend that you run the task every 10 minutes.
*/10 * root/bin/sh/root/mysql_slave.sh
Remember to assign a yuhongchun user to each MySQL instance from the machine. It doesn't matter if you have more permissions. You can only run them locally, as shown below:
grant all privileges on *.* to
Mysql itself is not powerful in performance monitoring, which makes many MySQL DBAs sleep at night,Fortunately, the MySQL database status is monitored through cacti (note that monitoring is not monitoring ).With the powerful drawing function of cacti + rrdtool and dedicated MySQL templates, You can flexibly and quickly
plug-in installation directory/var/lib/zabbix/percona/ Templates, copy it out and import it into the Zabbix web.After importing the template name "Percona MySQL Servertemplate", the template is grouped "Percona Templates".650) this.width=650; "src=" Https://s2.51cto.com/wyfs02/M02/9F/58/wKioL1mbvCDCGeCsAACKzhCW6gU819.png "title=" Template. png "alt=" Wkiol1mbvcdcgecsaackzhcw6gu819.png "/>Note: The templates in the official installation package are te
Environment:192.168.127.131 primary Database and Zabbix server192.168.127.130 from database and Zabbix clientA. First, assign a monitor account to MySQL.Mysql>Grant all privileges the zabbix.* to [e-mail protected] identified by ' Zabbix '; b. Write a script Vim/sh/mysql-replication.sh#!/bin/bash/usr/local/mysql/bin/
Use zabbix to automatically detect and monitor MySQL and zabbixmysqlIntroduction
Use the zabbix's low-level automatic discovery function to monitor multiple ports on a single host. For details, see low_level_discovery. The overall monitoring plug-in is similar to the zabbix monitoring plug-in of percona.mymonitor.plReplaced by scriptss_get_mysql_stats.phpAnd the
Agent/etc/init.d/zabbix_agentd restartIn the Zabbix monitoring platform corresponding to the host to add their own MySQL monitoring template, the most can be seen monitoring data, if there is no data, please resolve the error, you will encounter the following problems
Userparameter configuration file modification error, such as: The specified user is wrong, the path is not correct
Authorization database user permissions are incorrect, da
For the annotation of the script and the whole idea, I'll put it in the script for you.
#!/bin/bashMon_file= "$" # Specify the script path to monitorSEC=60 # Specifies the frequency to monitor, that is, how often to view theMon_point_file=/tmp/mon_mysql_slow.point # Specify the path to the MySQL slow log monitoring pointDiff_mon_file=/tmp/mon_mysql_slow.log # Specifies the
Monitor SQL statement execution efficiency based on mysql slow logsEnable MySQL log-slow-queries (slow query records ).In Linux, find my. cnf file (usually in/etc/mysql/), and you may find that the file cannot be saved after modification, because you do not have the corresponding permissions, you can see from the attri
wkiom1e8lu7y-gezaaai1ntzdby447.png2). Apache [[emailprotected] lepus]# yuminstall httpd httpd-manual httpd-devel-y [[emailprotected]]# Rpm-qa |grep http*wkiol1e8lvjihe0raaarigsop_0688.png [[emailprotected] ] ~]# service httpd startwkiom1e8lwlz8pw8aaaoqqhsjx8897.png above: Httpd:could not ReliAbly determine the server's fully qualifieddomain name hint is that Apache will validate the servername configuration when booting, and can add local parsing or modify by modifying the Hosts file httpd.conf
. It doesn't matter if you have more permissions. You can only run them locally, as shown below:
grantallprivilegeson*.*to"yuhongchun"@"127.0.0.1"identifiedby"yuhongchun101";
grantallprivilegeson*.*to"yuhongchun"@"localhost"identifiedby"yuhongchun101";
Script design ideas:
1. This script should be able to adapt to a variety of different Intranet and Internet environments, that is, environments with different IP addresses;
2. Let the script also moni
This article describes how to monitor mysql master-slave replication using python to check MySQL master-slave replication,
Cur.exe cute ("show slave status;") cannot use cur.exe cute ("show slave status \ G ;")
Result = cur. fetchall ()
Returns a binary array.
Result [0] indicates the status of the show slave status when the result is returned.
Result [0] [n] re
Monitor MySQL Master/Slave synchronization latency
There are usually two ways to monitor the latency between MySQL master and slave: Seconds_Behind_Master and mk-heartbeat.
Method 1: monitor the value of the Seconds_Behind_Master parameter output by the show slave status \ G
string + familiar, Zabbix-server trigger inside cannot recognizeSo you can know that mysqladmin in the MySQL service down, the return of the string alarm + number 0, completely trigger the Zabbix alarm conditions, it is necessary to consider other ways to judge.Search for relevant data telnet is also unable to meet the MySQL down when the alarm triggered by the demand, now with Netstat try650) this.width=6
Tags: Zabbix mysql LinuxMySQL Side settings:The general version of the Zabbix is default with the MySQL monitoring projectUnder the installation directory zabbix_agentd.d/userparameter_mysql.conf[[emailprotected]zabbix_agentd.d]#moreuserparameter_mysql.conf #For allthefollowingcommandshomeshouldbesettothe
Directorythathas.my.cnffilewithpasswordinformation. #flexibleparametertograbglobalvariables.onthefront
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.