#!/bin/bash mysql -e "show slave status\G" > mysql_status.txt array=($(egrep 'Slave_IO_Running|Slave_SQL_Running|Seconds_Behind_Master' mysql_status.txt)) if [[ "${array[1]}" == 'Yes' && "${array[3]}" == 'Yes' ]] then if [ "${array[5]}" -eq 0 ] then echo "MySQL slave running OK!" else echo "MySQL slave is behind master ${array[5]} seconds" fi else echo "MySQL slave sync make error" mail -s "MySQL-Slave Error on `uname -n`" 44850823@qq.com fi
MySQL-Slave从服务器状态检测脚本
原创博弈帅哥哥 博主文章分类:linux-shell篇 ©著作权
文章标签 mysql-monitor 文章分类 服务器
上一篇:mysql多实例启动脚本
-
Linux服务器PBS作业提交脚本介绍与代码
本文介绍在Linux服务器中,通过PBS(Portable Batch System)作业管理系统脚本的方式,提交任务到服务器队列,并执行任务的方法~
Linux 服务器 任务队列 PBS脚本 作业提交 -
mysql SEPARATOR用法 mysql-slave
1、Mysql复制方式: * 基于行的复制(5.1中引入) * 基于语句的复制 
mysql SEPARATOR用法 sql 二进制日志 数据