zoukankan      html  css  js  c++  java
  • zabbix监控mysql主从同步可用性

    [test@test-cratedb-4nqdg11-prd zabbix_agentd.d]$ more mysql.conf 
    UserParameter=check_sync_available,sh /etc/zabbix/scripts/check_sync_available.sh
    
    [root@dev-env23 scripts]# more check_sync_available.sh
    #!/bin/bash
    check_time=`date "+%Y-%m-%d,%H:%M:%S"`
    mysql -h 192.168.1.197 -urepl -pmysql -P13306 -e 'show slave statusG'>/tmp/slave_197_13306.txt 2>&1
    
    slave_io_running=`cat /tmp/slave_197_13306.txt|grep Slave_IO_Running|sed s/[[:space:]]//g|cut -d ':' -f2`
    slave_sql_running=`cat /tmp/slave_197_13306.txt|grep Slave_SQL_Running|grep -v Slave_SQL_Running_State|sed s/[[:space:]]//g|cut -d ':' -f2`
    ##slave_io_running=bb
    ##slave_sql_running=aa
    
    if [ "$slave_io_running" == "Yes" ] && [ "$slave_sql_running" == "Yes" ]; then
       echo "ok"
    else
       echo "failed"
    fi
  • 相关阅读:
    BSGS
    聪聪可可(未完成)
    强连通分量,缩点
    bozj 1823(未完成)
    网络流
    bzoj1026
    点分治 poj1741
    bzoj 3270 博物馆
    高斯消元 模板
    bzoj 3143 [Hnoi2013]游走
  • 原文地址:https://www.cnblogs.com/hxlasky/p/14767145.html
Copyright © 2011-2022 走看看