zabbix 4.0 监控磁盘IO的实施笔记
参考资料:
https://www.jianshu.com/p/4b1c83d50e1a
一、两段代码:
1、/usr/zabbix/bin/disk_discovery.sh
#!/bin/bash ############################################################ # $Name: disk_discovery.sh # $Function: DISK DISCOVERY # $Author: Xiaoliu.liu 1377133225@qq.com # $organization: Xiaoliu.liu # $Create Date: 2019/3/17 # $Description: Monitor DISK DISCOVERY ############################################################ disk_array=(`grep -E "(vd[a-z]$|sd[a-z]$)" /proc/partitions | awk '{print $4}'`) length=${#disk_array[@]} printf "{\n" printf '\t'"\"data\":[" for ((i=0;i<$length;i++)) do printf '\n\t\t{' printf "\"{#DISK_NAME}\":\"${disk_array[$i]}\"}" if [ $i -lt $[$length-1] ];then printf ',' fi done printf "\n\t]\n" printf "}\n"
2、/usr/zabbix/bin/disk_io.sh
#!/bin/bash ############################################################ # $Name: disk_io.sh # $Function: DISK IO # $Author: Xiaoliu.liu 1377133225@qq.com # $organization: Xiaoliu.liu # $Create Date: 2019/3/17 # $Description: Monitor DISK IO ############################################################ Device=$1 DISK=$2 case $DISK in #每秒读请求被合并次数 rrqm_s) iostat -dxkt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $2}' ;; #每秒写请求被合并次数 wrqm_s) iostat -dxkt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $3}' ;; #每秒完成的读次数 r_s) iostat -dxkt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $4}' ;; #每秒完成的写次数 w_s) iostat -dxkt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $5}' ;; #每秒读数据量(MB) rkb_s) iostat -dxmt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $6}' ;; #每秒写数据量(MB) wkb_s) iostat -dxmt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $7}' ;; #平均每次IO请求的扇区大小 avgrq_sz) iostat -dxkt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $8}' ;; #平均每次IO请求的队列长度(越短越好) avgqu_sz) iostat -dxkt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $9}' ;; #平均每次IO请求等待时间(毫秒) await) iostat -dxkt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $10}' ;; #读的平均耗时(毫秒) r_await) iostat -dxkt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $11}' ;; #写入平均耗时(毫秒) w_await) iostat -dxkt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $12}' ;; #平均每次IO请求处理时间(毫秒) svctm) iostat -dxkt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $13}' ;; #IO队列非空比例 util) iostat -dxkt 1 2 | grep "\b$Device\b" | awk 'NR==2{print $14}' ;; #IOPS iops) iostat -dk 1 2 | grep "\bsda\b" | awk 'NR==2{print $2}' ;; esac
二、zabbix配置修改:
1、/usr/zabbix/conf/zabbix_agentd.conf
UnsafeUserParameters=1 Include=/usr/zabbix_agents/conf/zabbix_agentd.d/*.conf
2、/usr/zabbix/conf/zabbix_agentd.d/disk_status.conf
UserParameter=disk.discovery[*],/usr/zabbix/bin/disk_discovery.sh UserParameter=disk.io[*],/usr/zabbix/bin/disk_io.sh $1 $2
三、zabbix模板
<?xml version="1.0" encoding="UTF-8"?> <zabbix_export> <version>4.0</version> <date>2019-03-17T02:06:33Z</date> <groups> <group> <name>Templates</name> </group> </groups> <templates> <template> <template>DiskIO</template> <name>DiskIO</name> <description/> <groups> <group> <name>Templates</name> </group> </groups> <applications> <application> <name>Disk-IO</name> </application> </applications> <items/> <discovery_rules> <discovery_rule> <name>DiskIO-Discovery</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.discovery</key> <delay>30s</delay> <status>0</status> <allowed_hosts/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <filter> <evaltype>0</evaltype> <formula/> <conditions/> </filter> <lifetime>30d</lifetime> <description/> <item_prototypes> <item_prototype> <name>平均每次IO请求的队列长度(越短越好) on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},avgqu_sz]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>平均每次IO请求的扇区大小 on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},avgrq_sz]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>平均每次IO请求等待时间(毫秒) on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},await]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>读取(MB/s) on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},rkb_s]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>每秒读请求被合并次数 on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},rrqm_s]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>读的平均耗时(毫秒) on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},r_await]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>每秒完成的读次数 on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},r_s]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>平均每次IO请求处理时间(毫秒) on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},svctm]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>IO队列非空比例 on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},util]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>写入(MB/s) on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},wkb_s]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>每秒写请求被合并次数 on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},wrqm_s]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>写入平均耗时(毫秒) on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},w_await]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> <item_prototype> <name>每秒完成的写次数 on {#DISK_NAME}</name> <type>0</type> <snmp_community/> <snmp_oid/> <key>disk.io[{#DISK_NAME},w_s]</key> <delay>30s</delay> <history>90d</history> <trends>365d</trends> <status>0</status> <value_type>0</value_type> <allowed_hosts/> <units/> <snmpv3_contextname/> <snmpv3_securityname/> <snmpv3_securitylevel>0</snmpv3_securitylevel> <snmpv3_authprotocol>0</snmpv3_authprotocol> <snmpv3_authpassphrase/> <snmpv3_privprotocol>0</snmpv3_privprotocol> <snmpv3_privpassphrase/> <params/> <ipmi_sensor/> <authtype>0</authtype> <username/> <password/> <publickey/> <privatekey/> <port/> <description/> <inventory_link>0</inventory_link> <applications> <application> <name>Disk-IO</name> </application> </applications> <valuemap/> <logtimefmt/> <preprocessing/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <output_format>0</output_format> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> <application_prototypes/> <master_item/> </item_prototype> </item_prototypes> <trigger_prototypes> <trigger_prototype> <expression>{DiskIO:disk.io[{#DISK_NAME},util].last(#3,30s)}>=80</expression> <recovery_mode>1</recovery_mode> <recovery_expression>{DiskIO:disk.io[{#DISK_NAME},util].last(#3,30s)}<80</recovery_expression> <name>DiskIO: IO队列非空比例 >=80 on {#DISK_NAME}</name> <correlation_mode>0</correlation_mode> <correlation_tag/> <url/> <status>0</status> <priority>2</priority> <description/> <type>0</type> <manual_close>1</manual_close> <dependencies/> <tags/> </trigger_prototype> <trigger_prototype> <expression>{DiskIO:disk.io[{#DISK_NAME},await].avg(#3,30s)}>=20</expression> <recovery_mode>1</recovery_mode> <recovery_expression>{DiskIO:disk.io[{#DISK_NAME},await].avg(#3,30s)}<20</recovery_expression> <name>平均每次IO请求等待时间(毫秒) >= 20ms on {#DISK_NAME}</name> <correlation_mode>0</correlation_mode> <correlation_tag/> <url/> <status>0</status> <priority>2</priority> <description/> <type>0</type> <manual_close>1</manual_close> <dependencies/> <tags/> </trigger_prototype> <trigger_prototype> <expression>{DiskIO:disk.io[{#DISK_NAME},rkb_s].last(#2,30)}>=300</expression> <recovery_mode>1</recovery_mode> <recovery_expression>{DiskIO:disk.io[{#DISK_NAME},rkb_s].last(#2,30)}<300</recovery_expression> <name>最近1分钟读取速度 >= 300MB on {#DISK_NAME}</name> <correlation_mode>0</correlation_mode> <correlation_tag/> <url/> <status>0</status> <priority>1</priority> <description/> <type>0</type> <manual_close>1</manual_close> <dependencies/> <tags/> </trigger_prototype> <trigger_prototype> <expression>{DiskIO:disk.io[{#DISK_NAME},wkb_s].last(#2,30)}>=300</expression> <recovery_mode>1</recovery_mode> <recovery_expression>{DiskIO:disk.io[{#DISK_NAME},wkb_s].last(#2,30)}<300</recovery_expression> <name>最近一分钟写入速度 >= 200MB on {#DISK_NAME}</name> <correlation_mode>0</correlation_mode> <correlation_tag/> <url/> <status>0</status> <priority>1</priority> <description/> <type>0</type> <manual_close>1</manual_close> <dependencies/> <tags/> </trigger_prototype> </trigger_prototypes> <graph_prototypes> <graph_prototype> <name>DISK-IO on on {#DISK_NAME}</name> <width>900</width> <height>200</height> <yaxismin>0.0000</yaxismin> <yaxismax>100.0000</yaxismax> <show_work_period>1</show_work_period> <show_triggers>1</show_triggers> <type>0</type> <show_legend>1</show_legend> <show_3d>0</show_3d> <percent_left>0.0000</percent_left> <percent_right>0.0000</percent_right> <ymin_type_1>0</ymin_type_1> <ymax_type_1>0</ymax_type_1> <ymin_item_1>0</ymin_item_1> <ymax_item_1>0</ymax_item_1> <graph_items> <graph_item> <sortorder>0</sortorder> <drawtype>0</drawtype> <color>1A7C11</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},util]</key> </item> </graph_item> <graph_item> <sortorder>1</sortorder> <drawtype>0</drawtype> <color>F63100</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},w_await]</key> </item> </graph_item> <graph_item> <sortorder>2</sortorder> <drawtype>0</drawtype> <color>2774A4</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},svctm]</key> </item> </graph_item> <graph_item> <sortorder>3</sortorder> <drawtype>0</drawtype> <color>A54F10</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},avgrq_sz]</key> </item> </graph_item> <graph_item> <sortorder>4</sortorder> <drawtype>0</drawtype> <color>FC6EA3</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},avgqu_sz]</key> </item> </graph_item> <graph_item> <sortorder>5</sortorder> <drawtype>0</drawtype> <color>6C59DC</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},await]</key> </item> </graph_item> <graph_item> <sortorder>6</sortorder> <drawtype>0</drawtype> <color>AC8C14</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},wkb_s]</key> </item> </graph_item> <graph_item> <sortorder>7</sortorder> <drawtype>0</drawtype> <color>611F27</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},wrqm_s]</key> </item> </graph_item> <graph_item> <sortorder>8</sortorder> <drawtype>0</drawtype> <color>F230E0</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},w_s]</key> </item> </graph_item> <graph_item> <sortorder>9</sortorder> <drawtype>0</drawtype> <color>5CCD18</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},r_s]</key> </item> </graph_item> <graph_item> <sortorder>10</sortorder> <drawtype>0</drawtype> <color>BB2A02</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},rkb_s]</key> </item> </graph_item> <graph_item> <sortorder>11</sortorder> <drawtype>0</drawtype> <color>5A2B57</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},rrqm_s]</key> </item> </graph_item> <graph_item> <sortorder>12</sortorder> <drawtype>0</drawtype> <color>89ABF8</color> <yaxisside>0</yaxisside> <calc_fnc>2</calc_fnc> <type>0</type> <item> <host>DiskIO</host> <key>disk.io[{#DISK_NAME},r_await]</key> </item> </graph_item> </graph_items> </graph_prototype> </graph_prototypes> <host_prototypes/> <jmx_endpoint/> <timeout>3s</timeout> <url/> <query_fields/> <posts/> <status_codes>200</status_codes> <follow_redirects>1</follow_redirects> <post_type>0</post_type> <http_proxy/> <headers/> <retrieve_mode>0</retrieve_mode> <request_method>0</request_method> <allow_traps>0</allow_traps> <ssl_cert_file/> <ssl_key_file/> <ssl_key_password/> <verify_peer>0</verify_peer> <verify_host>0</verify_host> </discovery_rule> </discovery_rules> <httptests/> <macros/> <templates/> <screens/> </template> </templates> </zabbix_export>