1. Monitoring the throughput of MYSQL which indicators are monitored?
Monitor MYSQL inserts, queries, deletes, updates, etc
2. How do I obtain throughput indicators?
Note: In order for shell scripts to better interact with mysql, mysql security free login is set
mysqladmin status
mysqladmin extended-status
3. How to obtain monitoring indicators using shell scripts?
vim /etc/zabbix/shell/monitor_mysql.sh
#! /bin/bash
# monitor mysql throughput
slow_queries() { mysqladmin status | awk ‘{print $9}’ }
Com_delete() { mysqladmin extended-status | awk ‘/<Com_delete>/{print $4}’ }
Com_insert() { mysqladmin extended-status | awk ‘/<Com_insert>/{print $4}’ }
Com_update() { mysqladmin extended-status | awk ‘/<Com_update>/{print $4}’ }
Com_select() { mysqladmin extended-status | awk ‘/<Com_select>/{print $4}’ }
The $1
4. Define the template for the agent
UserParameter=mysql_status[*],/bin/bash /etc/zabbix/shell/monitor_mysql.sh “$1”
5. There are more enterprise-level monitoring programs for more information
Please pay attention to the public number: always love stray cats