zabbix3.0.4利用iostat工具监控centos主机磁盘IO

该监控基于iostat,然后iostat 命令用来监视系统输入/输出设备负载

1.安装IOSTAT工具

# yum install sysstat -y

测试iostat 查看所有硬盘io

# iostat
Linux 2.6.32-431.11.25.el6.ucloud.x86_64 (test8_hadoop_kaf) 07/27/2017 _x86_64_    (4 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle
0.04 0.00 0.04 0.00 0.00 99.92

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn
vda 0.10 0.23 0.92 447172 1765488
vdb 0.00 0.00 0.15 4298 277632

2.部署脚本

# mkdir -p /usr/local/zabbix-agent/scripts/
# vim /usr/local/zabbix-agent/scripts/zabbix-iostat.sh
#!/bin/bash

ZBX_DEV="$1"
ZBX_METRIC="$2"
IOSTAT_LOG=/tmp/iostat.log

# Check iostat util
if ! which iostat 2>&1>/dev/null; then
  >&2 echo "Can‘t find ‘iostat‘ binary in \$PATH"
  >&2 echo "Make sure that you‘ve installed ‘sysstat‘ package"
  exit 1
fi

# Check args
[[ $# -lt 1 ]] && { echo "Give some more arguments, please :)"; exit 1; }

# Discovering devices and spits out JSON
if [ "$ZBX_DEV" = ‘discovery‘ ]; then
  iostat -d |   tail -n +4 |
  awk ‘BEGIN {
    ORS="";
    print "{\"data\":["}
    /\d/ {printf "%s{\"%s\":\"%s\"}", separator, "{#DEVICENAME}", $1, separator = ","}
    END {print "]}" }‘
  exit 0
fi

# Test iostat log
[[ ! -f "${IOSTAT_LOG}" ]] && echo "[m|ZBX_NOTSUPPORTED] [No such file ${IOSTAT_LOG}]" && exit 1

# Parse iostat file
function parse_iostat() {
  grep ${ZBX_DEV} ${IOSTAT_LOG} |   tr ‘,‘ ‘.‘ |   awk -v field="$1" ‘
  {sum+=$field; n++;}
  END {if (n > 0) print sum/n;
  else {print "[m|ZBX_NOTSUPPORTED] [Nodata.]" > "/dev/stderr"; exit 1};}‘
}

# Exec parse funcion with number of column
case ${ZBX_METRIC} in
  rrqm/s    ) parse_iostat ‘2‘;;
  wrqm/s    ) parse_iostat ‘3‘;;
  r/r       ) parse_iostat ‘4‘;;
  w/r       ) parse_iostat ‘5‘;;
  rkb/s     ) parse_iostat ‘6‘;;
  wkb/s     ) parse_iostat ‘7‘;;
  avgrq-sz  ) parse_iostat ‘8‘;;
  avgqu-sz  ) parse_iostat ‘9‘;;
  await     ) parse_iostat ‘10‘;;
  r_await   ) parse_iostat ‘11‘;;
  w_await   ) parse_iostat ‘12‘;;
  svctm     ) parse_iostat ‘13‘;;
  util      ) parse_iostat ‘14‘;;
  *         ) echo "[m|ZBX_NOTSUPPORTED] [Unsupported item key.]" && exit 1;;
esac
添加脚本执行权限# chmod +x /usr/local/zabbix-agent/scripts/zabbix-iostat.sh

# 设置参数

# echo ‘UserParameter=iostat[*],/usr/local/zabbix-agent/scripts/zabbix-iostat.sh "$1" "$2"‘ > /etc/zabbix/zabbix_agentd.d/iostat.conf

#重启zabbix_agentd

service zabbix-agent restart

# 测试自动发现

zabbix_agentd -t iostat[discovery]

3.加入crontab

# crontab -e

* * * * * ( sleep 10 && iostat -dxk 1 20 > /tmp/iostat.tmp && mv /tmp/iostat.tmp /tmp/iostat.log )
* * * * * ( sleep 40 && iostat -dxk 1 20 > /tmp/iostat.tmp && mv /tmp/iostat.tmp /tmp/iostat.log )

# 重启计划任务
/etc/init.d/crond restart
测试监控项

# zabbix_agentd -t iostat[vda,rkb/s]
iostat[vda,rkb/s] [t|0.007]

图像展示

模板:
Template_Linux_DISK_IO_Discovery_English.xml

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>3.0</version>
    <date>2017-07-27T06:45:24Z</date>
    <groups>
        <group>
            <name>Templates</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>Template_Linux_DISK_IO_Discovery_English</template>
            <name>Template_Linux_DISK_IO_Discovery_English</name>
            <description>Low-Level Discovery disk devices and I/O Performance monitoring</description>
            <groups>
                <group>
                    <name>Templates</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>DISK/IO</name>
                </application>
            </applications>
            <items/>
            <discovery_rules>
                <discovery_rule>
                    <name>Disk devices discovery</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>iostat[discovery]</key>
                    <delay>300</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/>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <filter>
                        <evaltype>0</evaltype>
                        <formula/>
                        <conditions>
                            <condition>
                                <macro>{#DEVICENAME}</macro>
                                <value>^(sd|hd|vd|xvd)[a-z]$</value>
                                <operator>8</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <lifetime>30</lifetime>
                    <description>Disk devices discovery and  IO Performance monitoring</description>
                    <item_prototypes>
                        <item_prototype>
                            <name>I/O Device /dev/$1 The average size (sector) of the disk each IO operation</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>iostat[{#DEVICENAME},avgrq-sz]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>sectors</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>The average size (in sectors) of the requests that were issued to the device.
向设备发出的请求的平均大小(扇区)。</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>DISK/IO</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>I/O Device/dev/$1 Disk averages average IO requests per wait</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>iostat[{#DEVICENAME},await]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>ms</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>await: 平均每次IO请求等待时间(包括等待时间和处理时间,毫秒为单位)</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>DISK/IO</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>I/O Device /dev/$1 The number of sectors that the disk successfully reads per second</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>iostat[{#DEVICENAME},r/r]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>Rps</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>The number (after merges) of read requests completed per second for the device.</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>DISK/IO</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>I/O Device /dev/$1 The size of the data that the disk is read per second</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>1</multiplier>
                            <snmp_oid/>
                            <key>iostat[{#DEVICENAME},rkb/s]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>Bps</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1024</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>The number of bytes read from the device per second
每秒从设备读取的字节数</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>DISK/IO</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>I/O Device /dev/$1 The number of read requests merged per second that were queued to the device</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>iostat[{#DEVICENAME},rrqm/s]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>rrqm/s</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>The number of read requests merged per second that were queued to the device
每秒排队到设备上的合并请求数</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>DISK/IO</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>I/O Device /dev/$1 Disk average time per IO read request</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>iostat[{#DEVICENAME},r_await]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>ms</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>The average time (in milliseconds) for read requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.
向设备发出的读取请求的平均时间(毫秒)。这包括队列中请求的时间和为它们服务的时间。</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>DISK/IO</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>I/O Device /dev/$1The disk handles the percentage of all IO requests in CPU per unit time</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>iostat[{#DEVICENAME},util]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>%</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>Percentage of elapsed time during which I/O requests were issued to the device (bandwidth utilization for the device). Device saturation occurs when this value is close to 100% for devices serving requests serially.  But for devices serving requests in parallel, such as RAID arrays and modern SSDs, this number does not reflect their performance limits.
对设备发出I/O请求的时间的百分比(设备带宽利用率)。设备饱和发生时,这个值是接近100%的设备服务请求连续。但在平行的服务请求的设备,如磁盘阵列和现代固态硬盘,这个数字并不反映其性能极限。</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>DISK/IO</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>I/O Device /dev/$1 The number of sectors per disk successfully written per second</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>iostat[{#DEVICENAME},w/r]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>Rps</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>The number (after merges) of write requests completed per second for the device
每秒为设备完成的写入请求的数目(合并后)</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>DISK/IO</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>I/O Device /dev/$1 The size of data written by disk per second</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>1</multiplier>
                            <snmp_oid/>
                            <key>iostat[{#DEVICENAME},wkb/s]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>Bps</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1024</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>The number of bytes written to the device per second.
每秒写入设备的字节数</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>DISK/IO</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>I/O Device /dev/$1 The number of times a disk writes per second</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>iostat[{#DEVICENAME},wrqm/s]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>wrqm/s</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>The number of write requests merged per second that were queued to the device.
每秒排队到设备的写入请求数。</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>DISK/IO</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>I/O Device /dev/$1Disk average time per IO write request</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>iostat[{#DEVICENAME},w_await]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>365</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>ms</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>The  average  time  (in  milliseconds) for write requests issued to the device to be served. This includes the time spent by the requests in queue and the time spentservicing them.
向设备发出的写入请求的平均时间(以毫秒为单位)。这包括时间,在队列中的请求和时间spentservicing他们度过。</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>DISK/IO</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                    </item_prototypes>
                    <trigger_prototypes>
                        <trigger_prototype>
                            <expression>{Template_Linux_DISK _IO _Discovery_Chinese:iostat[{#DEVICENAME},util].last(#5)}&gt;70</expression>
                            <name>{HOST.NAME}:  /dev/{#DEVICENAME}Disk occupancy CPU ratio is higher than 70%</name>
                            <url/>
                            <status>0</status>
                            <priority>3</priority>
                            <description>{HOST.NAME}: High I/O Utilization on /dev/{#DEVICENAME}</description>
                            <type>0</type>
                            <dependencies/>
                        </trigger_prototype>
                    </trigger_prototypes>
                    <graph_prototypes>
                        <graph_prototype>
                            <name>Disk I/O /dev/{#DEVICENAME} Disk read / write data size</name>
                            <width>1800</width>
                            <height>400</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>5</drawtype>
                                    <color>3333FF</color>
                                    <yaxisside>1</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template_Linux_DISK _IO _Discovery_Chinese</host>
                                        <key>iostat[{#DEVICENAME},util]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>1</sortorder>
                                    <drawtype>2</drawtype>
                                    <color>003300</color>
                                    <yaxisside>0</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template_Linux_DISK _IO _Discovery_Chinese</host>
                                        <key>iostat[{#DEVICENAME},rkb/s]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>2</sortorder>
                                    <drawtype>2</drawtype>
                                    <color>880000</color>
                                    <yaxisside>0</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template_Linux_DISK _IO _Discovery_Chinese</host>
                                        <key>iostat[{#DEVICENAME},wkb/s]</key>
                                    </item>
                                </graph_item>
                            </graph_items>
                        </graph_prototype>
                        <graph_prototype>
                            <name>Disk I/O /dev/{#DEVICENAME} IO request time status</name>
                            <width>1800</width>
                            <height>400</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>5</drawtype>
                                    <color>007700</color>
                                    <yaxisside>0</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template_Linux_DISK _IO _Discovery_Chinese</host>
                                        <key>iostat[{#DEVICENAME},await]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>1</sortorder>
                                    <drawtype>0</drawtype>
                                    <color>DD0000</color>
                                    <yaxisside>0</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template_Linux_DISK _IO _Discovery_Chinese</host>
                                        <key>iostat[{#DEVICENAME},w_await]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>2</sortorder>
                                    <drawtype>0</drawtype>
                                    <color>BB00BB</color>
                                    <yaxisside>0</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template_Linux_DISK _IO _Discovery_Chinese</host>
                                        <key>iostat[{#DEVICENAME},r_await]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>3</sortorder>
                                    <drawtype>2</drawtype>
                                    <color>666666</color>
                                    <yaxisside>1</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template_Linux_DISK _IO _Discovery_Chinese</host>
                                        <key>iostat[{#DEVICENAME},util]</key>
                                    </item>
                                </graph_item>
                            </graph_items>
                        </graph_prototype>
                        <graph_prototype>
                            <name>Disk I/O /dev/{#DEVICENAME} The number of sectors in which the disk has been successfully read / written</name>
                            <width>1800</width>
                            <height>400</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>5</drawtype>
                                    <color>3333FF</color>
                                    <yaxisside>1</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template_Linux_DISK _IO _Discovery_Chinese</host>
                                        <key>iostat[{#DEVICENAME},util]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>1</sortorder>
                                    <drawtype>2</drawtype>
                                    <color>009900</color>
                                    <yaxisside>0</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template_Linux_DISK _IO _Discovery_Chinese</host>
                                        <key>iostat[{#DEVICENAME},r/r]</key>
                                    </item>
                                </graph_item>
                                <graph_item>
                                    <sortorder>2</sortorder>
                                    <drawtype>2</drawtype>
                                    <color>880000</color>
                                    <yaxisside>0</yaxisside>
                                    <calc_fnc>2</calc_fnc>
                                    <type>0</type>
                                    <item>
                                        <host>Template_Linux_DISK _IO _Discovery_Chinese</host>
                                        <key>iostat[{#DEVICENAME},w/r]</key>
                                    </item>
                                </graph_item>
                            </graph_items>
                        </graph_prototype>
                    </graph_prototypes>
                    <host_prototypes/>
                </discovery_rule>
            </discovery_rules>
            <macros/>
            <templates/>
            <screens/>
        </template>
    </templates>
</zabbix_export>
时间: 2024-10-11 03:50:54

zabbix3.0.4利用iostat工具监控centos主机磁盘IO的相关文章

Zabbix-3.0.3使用默认模板监控MySQL

环境描述:zabbix server:192.168.1.1zabbix agent:192.168.1.12 一.安装agent客户端(1)添加用户群组groupadd zabbixuseradd -g zabbix -m zabbix (2)解压安装包,编译安装tar -zxvf zabbix-3.0.3.tar.gzcd zabbix-3.0.3./configure --prefix=/usr/local/zabbix --enable-agent make install (3)修改a

zabbix3.0.2 通过orabbix来监控oracle11g增强版的详细过程

-->Orabbix简介说明 orabbix是一个用来监控oracle数据库性能的zabbix插件工具,通过安装在被监控服务器上客户端上收集数据并传给zabbix服务器端,然后通过调用图形显示.具有以下功能: (1).数据库版本 (2).归档文件 (3).等待的事件(如文件的I/O,单块的读,多块的读,直接读,SQLNet消息,控制文件I/O,日志写等) (4).HitRatio(监控Hit Ratio的触发,表/存储过程,SQLArea,Body) (5).逻辑I/O(当前读操作,持续的读操作

(转)利用JConsole工具监控java程序内存和JVM

转自:http://www.cnblogs.com/luihengk/p/5446279.html 一.找到java应用程序对应的进程PI 性能测试应用程序访问地址:http://192.168.29.218:7070/training/ 部署的应用服务器为tomcat6.028 启动tomcat服务器后,任务管理器里可以看到多了java.exe进程,如图 PS:这里启动了多个其他程序 2.查询测试应用程序对应的进程PID号(根据端口号查找) 1)  Cmd命令:netstat  -aon|fi

zabbix3.0之agent端加入监控

zabbix客户端: [[email protected] ~]#rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/zabbix-release-3.0- 1.el6.noarch.rpm [[email protected] ~]#yum install -y zabbix-agent [[email protected] ~]#/etc/init.d/zabbix-agent start zabbix_agent配置 [[ema

使用监控宝监控CentOS主机

一 配置SNMP 1.安装net-snmp sudo yum -y install  net-snmp 2.备份snmpd.conf文件 sudo cp /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf20150625 3.清空并重新编辑snmpd.conf rocommunity  public   127.0.0.1 rocommunity  public   10.10.47.65 rocommunity  public   10.10.47.66 roc

zabbix3.0自动发现监控IIS

说明此处配置针对的是zabbix3.0版本 利用zabbix的自动发现(LLD)功能结合脚本可以实现上面的需求,实现对IIS站点的动态添加,动态监控. 效果图: 具体配置步骤: 1.  zabbix服务端配置 配置过滤正则表达式: 依次选择Administration->General->Regular expressions.创建新的正则表达式"IISSite for discovery",会在后面的模板中引用.正则表达式的名字不能有错,否则导入模板报错. 导入模块 将内

分布式监控系统Zabbix-3.0.3-完整安装记录 -添加apache监控

前面介绍了zabbix3.0.3环境及相关监控项的添加,下面介绍下针对apache的监控配置:1)在apache配置文件中打开server-status状态访问功能(自带的) [[email protected] ~]# /data/apache/bin/httpd -v Server version: Apache/2.4.25 (Unix) Server built: Jun 19 2017 19:18:00 [[email protected] ~]# cat /data/apache/c

zabbix3.0监控mysql配置

zabbix3.0 server已自带mysql的模板了,只需配置好agent客户端,然后在web端给主机增加模板就行了. 下面是公司线上的zabbix3.0环境下添加mysql监控操作记录 Zabbix_agent客户端操作 (1)首先在客户端的mysql里添加权限 mysql> grant all on *.* to [email protected]'localhost' identified by "123456”; mysql> flush privileges; (2)在

zabbix3.2使用自带模板监控MySql

一.zabbix自带MySql模板监控项 Zabbix3.0之后已经有MySql监控模板了,所以我们只要引用ZabbixServer自带的模板即可.zabbix默认有14个监控项 我们只需获取监控项需要的值就ok,而这些值大部分可以通过mysqladmin命令获取 二.编写脚本获取mysql性能指标数据 vim chk_mysql.sh vim chk_mysql.sh # 用户名 #MYSQL_USER='zabbix' # 密码 #MYSQL_PWD='zabbix' #在脚本中输入密码my