From 9b6614f80060540a65a851abade477e62daa61fa Mon Sep 17 00:00:00 2001 From: newrain Date: Thu, 17 Jun 2021 23:13:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4database=20system=20=E5=AE=8C?= =?UTF-8?q?=E6=95=B4=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zabbix_agentd.d/script/dbMonitor.sh | 3 +- zbx_export_templates.xml | 402 +++++++++++++++++++++++++++- 2 files changed, 401 insertions(+), 4 deletions(-) diff --git a/zabbix_agentd.d/script/dbMonitor.sh b/zabbix_agentd.d/script/dbMonitor.sh index a11dc36..a985859 100644 --- a/zabbix_agentd.d/script/dbMonitor.sh +++ b/zabbix_agentd.d/script/dbMonitor.sh @@ -57,6 +57,7 @@ function SlowLog() { oldLines=$(cat $slowTmp) diff=$(($newLines - $oldLines)) tail -n $diff $slowLog + echo -n $newLines >$slowTmp else echo -n $newLines >$slowTmp fi @@ -79,7 +80,7 @@ function RemoteUser(){ case $1 in heartbeat) - Heartbeat + Heartbeat ;; crud) Crud $2 # insert update delete select commit rollback qps tps diff --git a/zbx_export_templates.xml b/zbx_export_templates.xml index af3c921..7c1a875 100644 --- a/zbx_export_templates.xml +++ b/zbx_export_templates.xml @@ -1,7 +1,7 @@ 5.0 - 2021-06-17T19:15:47Z + 2021-06-17T20:24:08Z Zabbix servers @@ -37,7 +37,7 @@ MULTIPLIER - 1048576 + 9.5367431640625e-7 @@ -132,6 +132,13 @@ database monitor + + + {last(#1)}<>0 + database heartbeat + DISASTER + + database mysql ruser @@ -154,6 +161,14 @@ database monitor + + + {strlen(#1)}>=1 + database slowlog + INFO + YES + + system port connect 22 @@ -202,6 +217,14 @@ system monitor + + + {last(#1)}>=8 + system cpu load 15 min + AVERAGE + YES + + system crontab root @@ -215,7 +238,7 @@ - disk free % + disk use % systemcheck.disk FLOAT % @@ -224,6 +247,14 @@ system monitor + + + {last(#1,60)}>80 + system disk use + WARNING + YES + + system file md5 check @@ -235,6 +266,14 @@ system monitor + + + {str(FAILED,#1)}=1 + system file md5 check + WARNING + YES + + memory free % @@ -252,6 +291,14 @@ 100 + + + {last(#5,300)}<10 + system memory free + WARNING + YES + + system open portlist @@ -308,6 +355,14 @@ system monitor + + + {last(#1)}<>0 + system swap + INFO + YES + + system idletime @@ -336,6 +391,14 @@ 100 + + + {last(#5,300)}>80 + system uptime idle % + INFO + YES + + system uptime @@ -349,6 +412,339 @@ + + + 4 + 2 + 2 + + + 0 + + + database select + zabbix-monitor-userparameter + + 500 + 100 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + + + 3 + + + 0 + + + database insert + zabbix-monitor-userparameter + + 500 + 100 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + + + 3 + + + 0 + + + database update + zabbix-monitor-userparameter + + 500 + 100 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + + + 3 + + + 0 + + + database delete + zabbix-monitor-userparameter + + 500 + 100 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + + + 3 + + + + + disk memory + 2 + 1 + + + 0 + + + disk use + zabbix-monitor-userparameter + + 500 + 100 + 0 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + + + 3 + + + 0 + + + memory free + zabbix-monitor-userparameter + + 500 + 100 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + + + 3 + + + + + + + database commit + + + 1 + 1A7C11 + + zabbix-monitor-userparameter + dbcheck.crud[commit] + + + + + + database delete + + + 1 + 1A7C11 + + zabbix-monitor-userparameter + dbcheck.crud[delete] + + + + + + database insert + + + 1 + 1A7C11 + + zabbix-monitor-userparameter + dbcheck.crud[insert] + + + + + + database rollback + + + 1 + 1A7C11 + + zabbix-monitor-userparameter + dbcheck.crud[rollback] + + + + + + database select + + + 1 + 1A7C11 + + zabbix-monitor-userparameter + dbcheck.crud[delete] + + + + + + database tps qps + + + 1 + 1A7C11 + + zabbix-monitor-userparameter + dbcheck.crud[qps] + + + + 2 + F63100 + + zabbix-monitor-userparameter + dbcheck.crud[tps] + + + + + + database update + + + 1 + 1A7C11 + + zabbix-monitor-userparameter + dbcheck.crud[update] + + + + + + disk use + 0 + NO + NO + PIE + + + 1 + 1A7C11 + + zabbix-monitor-userparameter + systemcheck.disk + + + + + + memory free + 0 + NO + NO + PIE + + + 1 + 1A7C11 + + zabbix-monitor-userparameter + systemcheck.memory + + + + + + system disk swap + + + 1 + 1A7C11 + + zabbix-monitor-userparameter + systemcheck.disk + + + + 2 + F63100 + + zabbix-monitor-userparameter + systemcheck.memory + + + + + + system load + + + 1 + 1A7C11 + + zabbix-monitor-userparameter + systemcheck.cpuload[1] + + + + 2 + F63100 + + zabbix-monitor-userparameter + systemcheck.cpuload[5] + + + + 3 + 2774A4 + + zabbix-monitor-userparameter + systemcheck.cpuload[15] + + + + +