阿斯顿阿斯顿 发表于 2017-12-31 22:57:21

Zabbix监控磁盘io

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
  
页: [1]
查看完整版本: Zabbix监控磁盘io