标签:bsp nsa 9.png div roc agentd 文件 init user
Zabbix监控磁盘io
监控磁盘IO的基本原理:通过分析/proc/diskstats文件,来对IO的性能进行监控。
++++++++++++++++++++++++对/proc/diskstats的解释++++++++++++++++++++++++++++++
# cat /proc/diskstats |grep sda |head -1
8 0 sda 2280 1445 76478 11956 249 188 3490 932 0 9913 12805
vim /etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf UnsafeUserParameters=1 UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk ‘{print $$4}‘ //磁盘读的次数 UserParameter=custom.vfs.dev.read.ms[*],cat /proc/diskstats | grep $1 | head -1 | awk ‘{print $$7}‘ //磁盘读的毫秒数 UserParameter=custom.vfs.dev.write.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk ‘{print $$8}‘ //磁盘写的次数 UserParameter=custom.vfs.dev.write.ms[*],cat /proc/diskstats | grep $1 | head -1 | awk ‘{print $$11}‘ //磁盘写的毫秒数 UserParameter=custom.vfs.dev.io.active[*],cat /proc/diskstats | grep $1 | head -1 | awk ‘{print $$12}‘ UserParameter=custom.vfs.dev.io.ms[*],cat /proc/diskstats | grep $1 | head -1 | awk ‘{print $$13}‘ //花费在IO操作上的毫秒数 UserParameter=custom.vfs.dev.read.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk ‘{print $$6}‘ //读扇区的次数(一个扇区的等于512B) UserParameter=custom.vfs.dev.write.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk ‘{print $$10}‘ //写扇区的次数(一个扇区的等于512B) /etc/init.d/zabbix-agent restart
[root@kvm2 ~]# /application/zabbix/bin/zabbix_get -s 192.168.1.76 -p 10050 -k ‘custom.vfs.dev.read.ops[sda]‘ 37231 [root@kvm2 ~]# /application/zabbix/bin/zabbix_get -s 192.168.1.76 -p 10050 -k ‘custom.vfs.dev.write.ms[sda]‘ 17553012 [root@kvm2 ~]# /application/zabbix/bin/zabbix_get -s 192.168.1.76 -p 10050 -k ‘custom.vfs.dev.write.ops[sda]‘ 439045 [root@kvm2 ~]# /application/zabbix/bin/zabbix_get -s 192.168.1.76 -p 10050 -k ‘custom.vfs.dev.read.ops[sda]‘ 37231 [root@kvm2 ~]# /application/zabbix/bin/zabbix_get -s 192.168.1.76 -p 10050 -k ‘custom.vfs.dev.read.sectors[sda]‘ 1444430 [root@kvm2 ~]# /application/zabbix/bin/zabbix_get -s 192.168.1.76 -p 10050 -k ‘custom.vfs.dev.write.sectors[sda]‘ 20215608 [root@kvm2 ~]#
标签:bsp nsa 9.png div roc agentd 文件 init user
原文地址:http://www.cnblogs.com/Carr/p/7395718.html