1.在zabbix_agentd.conf增長如下的代碼:app
UserParameter=custom.vfs.dev.read.ops[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$4}'ide
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}'spa
UserParameter=custom.vfs.dev.write.ms[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$11}'.net
UserParameter=custom.vfs.dev.io.active[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$12}'rest
UserParameter=custom.vfs.dev.io.ms[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$13}'server
UserParameter=custom.vfs.dev.read.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$6}'xml
UserParameter=custom.vfs.dev.write.sectors[*],cat /proc/diskstats | grep $1 | head -1 | awk '{print $$10}'blog
[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
方法:Configuration--Templates--Import,導入後將看到一個「Template_app_FileServer」模板,再把這個模板應用到主機。