Services Status
agent:
UserParameter=mysqld.status,/etc/init.d/mysqld status | grep -c running
#servers agentd restart
server:
#/usr/local/bin/zabbix_get -s [agent ip] -k "mysqld.status"
Mysql Master slave synchronization
slave agent:
UserParameter=mysql.replication,/usr/bin/mysql -uzabbix -e ‘show slave status\G‘ |grep -E "Slave_IO_Running|Slave_SQL_Running"|awk ‘{print $2}‘|grep -c Yes
#servers agentd restart
server:
#/usr/local/bin/zabbix_get -s [agent ip] -k "mysql.replication"
Mysql Processlist
master&slave agent:
UserParameter=mysql.process,/usr/bin/mysql -uroot -ppassword -sNe "show full processlist" | egrep -v "Sleep|Id|show full processlist" | wc -l
#servers agentd restart
server:
#/usr/local/bin/zabbix_get -s [agent ip] -k "mysql.process"
时间: 2024-11-05 17:23:32