(F) to monitor disk IO

(1) is arranged to monitor the end

#vi /etc/zabbix/zabbix_agentd.conf
UnsafeUserParameters=1
UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'
UserParameter=custom.vfs.dev.write.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$8}'
UserParameter=custom.vfs.dev.read.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$6}'  
UserParameter=custom.vfs.dev.write.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$10}'  
#systemctl restart zabbix-agent.service

Explanation

custom.vfs.dev.read.ops [*]                    // disk read times 
custom.vfs.dev.write.ops [*]                    // disk write times 
custom.vfs.dev.read.sectors [*]                   // read rate 
custom.vfs.dev.write.sectors [*]              // write rate

(2) server side configuration

1) test whether you can get to a normal value

yum install zabbix-get -y
zabbix_get -s 192.168.1.32 -k 'custom.vfs.dev.read.ops[sda]'
zabbix_get -s 192.168.1.32 -k 'custom.vfs.dev.write.ops[sda]'
zabbix_get -s 192.168.1.32 -k 'custom.vfs.dev.read.sectors[sda]'
zabbix_get -s 192.168.1.32 -k 'custom.vfs.dev.write.sectors[sda]'

2) zabbix web side configuration read cycles

Name: Disk: $ 1 : the Read: OPS per SECOND, 
key: custom.vfs.dev.read.ops [sda] 
Unit: OPS / SECOND, 
processes: changes per second


3) zabbix web side configuration write cycles

Name: Disk: $ 1 : the Write: OPS per SECOND, 
key: custom.vfs.dev.write.ops [sda] 
Unit: OPS / SECOND, 
processes: changes per second


4) zabbix web side configuration read rate

Title: Disk: $ . 1 : the Read: Bytes / sec 
key: custom.vfs.dev.read.sectors [sda] 
Unit: B / sec 
Process: multiple changes per second and Custom 512 (a 512-byte sectors)


5) zabbix web side configuration write rate

Title: Disk: $ . 1 : the Write: Bytes / sec 
key: custom.vfs.dev.write.sectors [sda] 
Unit: B / sec 
Process: multiple changes per second and Custom 512 (a 512-byte sectors)


6) Creating Graphics


7) testing and certification

dd if=/dev/zero of=1.log bs=1M count=100000


(1)被监控端配置

#vi /etc/zabbix/zabbix_agentd.conf
UnsafeUserParameters=1
UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'
UserParameter=custom.vfs.dev.write.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$8}'
UserParameter=custom.vfs.dev.read.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$6}'  
UserParameter=custom.vfs.dev.write.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$10}'  
#systemctl restart zabbix-agent.service

说明

custom.vfs.dev.read.ops[*]                   //磁盘读的次数
custom.vfs.dev.write.ops[*]                   //磁盘写的次数
custom.vfs.dev.read.sectors[*]                  //读速率
custom.vfs.dev.write.sectors[*]             //写速率

(2)server端配置

1) 测试是否能够获取到正常的值

yum install zabbix-get -y
zabbix_get -s 192.168.1.32 -k 'custom.vfs.dev.read.ops[sda]'
zabbix_get -s 192.168.1.32 -k 'custom.vfs.dev.write.ops[sda]'
zabbix_get -s 192.168.1.32 -k 'custom.vfs.dev.read.sectors[sda]'
zabbix_get -s 192.168.1.32 -k 'custom.vfs.dev.write.sectors[sda]'

2) zabbix web端配置读次数

名称:Disk:$1:Read:ops per second
键值:custom.vfs.dev.read.ops[sda]
单位:ops/second
进程:每秒更改


3) zabbix web端配置写次数

名称:Disk:$1:Write:ops per second
键值:custom.vfs.dev.write.ops[sda]
单位:ops/second
进程:每秒更改


4) zabbix web端配置读速率

名称:Disk:$1:Read:Bytes/sec
键值:custom.vfs.dev.read.sectors[sda]
单位:B/sec
进程:每秒更改和自定义倍数512(一个扇区512字节)


5) zabbix web端配置写速率

名称:Disk:$1:Write:Bytes/sec
键值:custom.vfs.dev.write.sectors[sda]
单位:B/sec
进程:每秒更改和自定义倍数512(一个扇区512字节)


6)创建图形


7)测试验证

dd if=/dev/zero of=1.log bs=1M count=100000


Guess you like

Origin www.cnblogs.com/shaonli/p/12089597.html