I like zabbix… but it annoys me that it’s ops per second, and bytes per second data is broken for hard drives in the linux 2.6 kernel. So I created a work around
Add the following code to your zabbix_agentd.conf file (/etc/zabbix/zabbix_agentd.conf by default), and restart the zabbix agent:
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}’
The names are pretty descriptive, but you can find more information on how to decipher /proc/diskstats here: http://www.kernel.org/pub/linux/kernel/people/landley/kdocs/Documentation/iostats.txt
After you add the UserParameter’s to your config file, you can check that they work by using zabbix_get from your zabbix server:
zabbix_get -s HostName -p 10050 -k custom.vfs.dev.write.ops[sdb]
It should return a large number, and not something like: ZBX_NOTSUPPORTED. If it comes back not supported, make sure you restarted the agent after adding the userparameters. Then try running the commands outside of zabbix. Note that if you run the commands outsie of zabbix, you’ll need to replace the first $1 with a disk name, and remove one of the $ characters from the awk command.
Once you’ve verfied everything is in working order, you can add it as an item to your zabbix installation:
You can download my exported Template here , which will create a template called Template_app_FileServer. It will give you:
Disk Read/Write: Bytes/sec (or KB, MB per second)
Disk Read/Write: Ops/second
Disk Read/Write: Milliseconds spent reading or writing
Disk:IO currently executing
Disk:IO ms: time spent performing IO
If you’d rather just create your own items, and not bother loading mine, I have attached some screenshots of the config screens, so you can re create it with the right settings:
As always, if you find this page helpful or have any questions, please let me know!

trentster says:
Thanks for this, its very helpful, and I will use it on many agents. I also enjoyed the Centos 5 article. Keep up the great work, looking forward to many new excellent Zabbix articles.
12 October 2007, 3:45 pmcolin says:
Agreed, this article was very helpful. Thanks for documenting this !
12 November 2007, 1:28 pmPeter says:
Hey,
realy nice howto/workarround!
For those who get
awk: 1: unexpected character 0xe2
awk: line 2: missing } near end of file
awk: 1: unexpected character 0xe2
awk: line 2: missing } near end of file
in /var/log/zabbix-agent/zabbix_agentd.log
Use
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}’
With ‘ instead of ’.
greets from Germany,
Peter
6 January 2008, 2:23 pmSteve Ley says:
Fantastic information and template. Thanks for sharing!
19 March 2008, 9:34 amMatthias says:
Nice workaround! Any Ideas for FreeBSD Users??
7 May 2008, 7:55 amStelios says:
I’m always getting a ZBX_NOTSUPPORTED even though I’ve double checked everything. Any ideas?
5 June 2008, 8:44 amMark says:
Stelios, make sure your shell script returns some text instead of just a return code.
You can test with something like zabbix_agentd -t vm.memory.size[free]
Substitute with your custom test name, of course.
9 June 2008, 7:24 amDanie says:
This will be fantastic is I can get it to work though.
3 September 2008, 4:01 amThe error I get when creating the templates is:
Type of received value [8 17 sdb1 654553 24426018 1870561 14964480] is not sutable for [custom.vfs.dev.read.ops[sdb1]@
Can anyone perhaps help me with this?
The templates are 100% created as above.
Koos says:
Danie, I ran into the same problem.
Just make sure that you have 2 x dollar signs in your awk statements.
Otherwise the agent thinks the Zabbix server sent the variables.
Thanks for the article, saved me loads of time.
7 November 2008, 12:07 pmpsd says:
Hi,
I am using your system above, when I fill up a filesystem on sda, using dd, the graph does not seem to move to show that the number of writes has increased on the system? any ideas pls
3 December 2008, 6:24 amкатринна says:
Привет всем!!!
2 February 2009, 4:44 amЗря ты так
Monitoring PostgreSQL TPS with Zabbix | gtuhl: startup technology says:
[...] a ton of stuff including tracking CPU utilization and disk IO (awesome IO monitoring thanks to this page) on all servers, detecting outtages and automatically fixing them, monitoring and charting the [...]
21 February 2009, 6:20 amКирилл Александров says:
Даа… Какой кошмар!
9 April 2009, 9:07 pmldunston says:
Awesome contribution. I had to change the single quotes around the awk print statements to get it to work.
Also take a peek at /proc/diskstats to make sure you’re looking at the right disk. I’m using lvm on vmware so dm-0 and dm-1 were my target disks.
23 April 2009, 1:15 pmbrian says:
Was digging around for info on IO stats on Linux using Zabbix and stumbled across this entry. Even though I’m late to the game (this post is kind of old
), this worked great for me. Thanks for taking the time to blog on this.
24 September 2009, 7:32 amkazul says:
Я сомневаюсь в этом.
25 January 2010, 4:17 amAndrea says:
great post!
I currently use zabbix to monitor a really large environment (more than 320 servers)
I’ve founded a wonderful plugin that is more than a plugin and the others monitoring systems don’t have nothing of similar, and nothing that go inside oracle so deeply.
In the hope that someone found useful my comment
http://www.smartmarmot.com
here you are going to find Orabbix opensource and released under GPL3
2 June 2010, 5:54 am