天天看點

zabbix監控磁盤性能

1.在zabbix_agentd.conf增加以下的代碼:

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}'

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}'

[root@localhost ~]# /etc/init.d/zabbix_agentd restart

3.在 zabbix server 中測試是否有能擷取資料,使用以下指令進行測試,其中AgentServerIP為被監控主機的IP;如果出現ZBX_NOTSUPPORTED,請确認你已增加了以上代碼并重新開機了服務再檢查防火牆的情況.

zabbix_get -s AgentServerIP -p 10050 -k custom.vfs.dev.write.ops[sda]

例:

[root@zabbix-server ~]# zabbix_get -s 192.168.209.251 -p 10050 -k custom.vfs.dev.write.ops[sda]

50184

4.導入下載下傳的模闆,下載下傳位址:http://www.muck.net/pub/zabbix_FileServer_template.xml

繼續閱讀