提交database system 完整监控

master
newrain 3 years ago
parent f4f0379035
commit 9b6614f800
  1. 1
      zabbix_agentd.d/script/dbMonitor.sh
  2. 402
      zbx_export_templates.xml

@ -57,6 +57,7 @@ function SlowLog() {
oldLines=$(cat $slowTmp) oldLines=$(cat $slowTmp)
diff=$(($newLines - $oldLines)) diff=$(($newLines - $oldLines))
tail -n $diff $slowLog tail -n $diff $slowLog
echo -n $newLines >$slowTmp
else else
echo -n $newLines >$slowTmp echo -n $newLines >$slowTmp
fi fi

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<zabbix_export> <zabbix_export>
<version>5.0</version> <version>5.0</version>
<date>2021-06-17T19:15:47Z</date> <date>2021-06-17T20:24:08Z</date>
<groups> <groups>
<group> <group>
<name>Zabbix servers</name> <name>Zabbix servers</name>
@ -37,7 +37,7 @@
<preprocessing> <preprocessing>
<step> <step>
<type>MULTIPLIER</type> <type>MULTIPLIER</type>
<params>1048576</params> <params>9.5367431640625e-7</params>
</step> </step>
</preprocessing> </preprocessing>
</item> </item>
@ -132,6 +132,13 @@
<name>database monitor</name> <name>database monitor</name>
</application> </application>
</applications> </applications>
<triggers>
<trigger>
<expression>{last(#1)}&lt;&gt;0</expression>
<name>database heartbeat</name>
<priority>DISASTER</priority>
</trigger>
</triggers>
</item> </item>
<item> <item>
<name>database mysql ruser</name> <name>database mysql ruser</name>
@ -154,6 +161,14 @@
<name>database monitor</name> <name>database monitor</name>
</application> </application>
</applications> </applications>
<triggers>
<trigger>
<expression>{strlen(#1)}&gt;=1</expression>
<name>database slowlog</name>
<priority>INFO</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item> </item>
<item> <item>
<name>system port connect 22</name> <name>system port connect 22</name>
@ -202,6 +217,14 @@
<name>system monitor</name> <name>system monitor</name>
</application> </application>
</applications> </applications>
<triggers>
<trigger>
<expression>{last(#1)}&gt;=8</expression>
<name>system cpu load 15 min</name>
<priority>AVERAGE</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item> </item>
<item> <item>
<name>system crontab root</name> <name>system crontab root</name>
@ -215,7 +238,7 @@
</applications> </applications>
</item> </item>
<item> <item>
<name>disk free %</name> <name>disk use %</name>
<key>systemcheck.disk</key> <key>systemcheck.disk</key>
<value_type>FLOAT</value_type> <value_type>FLOAT</value_type>
<units>%</units> <units>%</units>
@ -224,6 +247,14 @@
<name>system monitor</name> <name>system monitor</name>
</application> </application>
</applications> </applications>
<triggers>
<trigger>
<expression>{last(#1,60)}&gt;80</expression>
<name>system disk use</name>
<priority>WARNING</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item> </item>
<item> <item>
<name>system file md5 check</name> <name>system file md5 check</name>
@ -235,6 +266,14 @@
<name>system monitor</name> <name>system monitor</name>
</application> </application>
</applications> </applications>
<triggers>
<trigger>
<expression>{str(FAILED,#1)}=1</expression>
<name>system file md5 check</name>
<priority>WARNING</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item> </item>
<item> <item>
<name>memory free %</name> <name>memory free %</name>
@ -252,6 +291,14 @@
<params>100</params> <params>100</params>
</step> </step>
</preprocessing> </preprocessing>
<triggers>
<trigger>
<expression>{last(#5,300)}&lt;10</expression>
<name>system memory free</name>
<priority>WARNING</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item> </item>
<item> <item>
<name>system open portlist</name> <name>system open portlist</name>
@ -308,6 +355,14 @@
<name>system monitor</name> <name>system monitor</name>
</application> </application>
</applications> </applications>
<triggers>
<trigger>
<expression>{last(#1)}&lt;&gt;0</expression>
<name>system swap</name>
<priority>INFO</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item> </item>
<item> <item>
<name>system idletime</name> <name>system idletime</name>
@ -336,6 +391,14 @@
<params>100</params> <params>100</params>
</step> </step>
</preprocessing> </preprocessing>
<triggers>
<trigger>
<expression>{last(#5,300)}&gt;80</expression>
<name>system uptime idle %</name>
<priority>INFO</priority>
<manual_close>YES</manual_close>
</trigger>
</triggers>
</item> </item>
<item> <item>
<name>system uptime</name> <name>system uptime</name>
@ -349,6 +412,339 @@
</applications> </applications>
</item> </item>
</items> </items>
<screens>
<screen>
<name>4</name>
<hsize>2</hsize>
<vsize>2</vsize>
<screen_items>
<screen_item>
<resourcetype>0</resourcetype>
<style>0</style>
<resource>
<name>database select</name>
<host>zabbix-monitor-userparameter</host>
</resource>
<width>500</width>
<height>100</height>
<x>0</x>
<y>0</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<url/>
<application/>
<max_columns>3</max_columns>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<style>0</style>
<resource>
<name>database insert</name>
<host>zabbix-monitor-userparameter</host>
</resource>
<width>500</width>
<height>100</height>
<x>1</x>
<y>0</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<url/>
<application/>
<max_columns>3</max_columns>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<style>0</style>
<resource>
<name>database update</name>
<host>zabbix-monitor-userparameter</host>
</resource>
<width>500</width>
<height>100</height>
<x>0</x>
<y>1</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<url/>
<application/>
<max_columns>3</max_columns>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<style>0</style>
<resource>
<name>database delete</name>
<host>zabbix-monitor-userparameter</host>
</resource>
<width>500</width>
<height>100</height>
<x>1</x>
<y>1</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<url/>
<application/>
<max_columns>3</max_columns>
</screen_item>
</screen_items>
</screen>
<screen>
<name>disk memory</name>
<hsize>2</hsize>
<vsize>1</vsize>
<screen_items>
<screen_item>
<resourcetype>0</resourcetype>
<style>0</style>
<resource>
<name>disk use</name>
<host>zabbix-monitor-userparameter</host>
</resource>
<width>500</width>
<height>100</height>
<x>0</x>
<y>0</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<url/>
<application/>
<max_columns>3</max_columns>
</screen_item>
<screen_item>
<resourcetype>0</resourcetype>
<style>0</style>
<resource>
<name>memory free</name>
<host>zabbix-monitor-userparameter</host>
</resource>
<width>500</width>
<height>100</height>
<x>1</x>
<y>0</y>
<colspan>1</colspan>
<rowspan>1</rowspan>
<elements>0</elements>
<valign>0</valign>
<halign>0</halign>
<dynamic>0</dynamic>
<sort_triggers>0</sort_triggers>
<url/>
<application/>
<max_columns>3</max_columns>
</screen_item>
</screen_items>
</screen>
</screens>
</template> </template>
</templates> </templates>
<graphs>
<graph>
<name>database commit</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>1A7C11</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>dbcheck.crud[commit]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>database delete</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>1A7C11</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>dbcheck.crud[delete]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>database insert</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>1A7C11</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>dbcheck.crud[insert]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>database rollback</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>1A7C11</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>dbcheck.crud[rollback]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>database select</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>1A7C11</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>dbcheck.crud[delete]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>database tps qps</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>1A7C11</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>dbcheck.crud[qps]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>F63100</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>dbcheck.crud[tps]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>database update</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>1A7C11</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>dbcheck.crud[update]</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>disk use</name>
<yaxismax>0</yaxismax>
<show_work_period>NO</show_work_period>
<show_triggers>NO</show_triggers>
<type>PIE</type>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>1A7C11</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>systemcheck.disk</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>memory free</name>
<yaxismax>0</yaxismax>
<show_work_period>NO</show_work_period>
<show_triggers>NO</show_triggers>
<type>PIE</type>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>1A7C11</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>systemcheck.memory</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>system disk swap</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>1A7C11</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>systemcheck.disk</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>F63100</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>systemcheck.memory</key>
</item>
</graph_item>
</graph_items>
</graph>
<graph>
<name>system load</name>
<graph_items>
<graph_item>
<sortorder>1</sortorder>
<color>1A7C11</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>systemcheck.cpuload[1]</key>
</item>
</graph_item>
<graph_item>
<sortorder>2</sortorder>
<color>F63100</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>systemcheck.cpuload[5]</key>
</item>
</graph_item>
<graph_item>
<sortorder>3</sortorder>
<color>2774A4</color>
<item>
<host>zabbix-monitor-userparameter</host>
<key>systemcheck.cpuload[15]</key>
</item>
</graph_item>
</graph_items>
</graph>
</graphs>
</zabbix_export> </zabbix_export>

Loading…
Cancel
Save