Caveat : These are examples and must probably be adapted to your actual ZFS/ZPOOL names. They're in production use on Zabbix 1.8.6. and the agent runs on Opensolaris svn_134.
Step 1.
The following snippet must be added to /etc/zabbix/zabbix_agentd.conf to provide the UserParameter:
----------snip----------------
### ZFS related UserParameter
#
# takes just one parameter (a zpool name) and returns 0 or 1
UserParameter=zpool.status[*],zpool status -x $1 | grep "is healthy" | wc -l
# 1st parameter : zpool name
# 2nd parameter : size, free, allocated, capacity
# returns : integer point value (Bytes)
UserParameter=zpool.list[*],zpool list -H -o $2 $1 | /etc/zabbix/remove_SIunits.sh
# 1st parameter : zfs vol|fs|snapshot name
# 2nd parameter : basically all zfs properties (i.e.volsize, used, available)
# returns : integer point value (Bytes)
UserParameter=zfs.list[*],zfs list -H -o $2 $1 | /etc/zabbix/remove_SIunits.sh
----------snip----------------
Step 2.
Place the remove_SIunits.sh script in an apropriate place. Because the commands return values _only_ in human readable form (i.e. 24TB instead of 24 000 000 000 000) and opensolaris uses SI-units (1000 instead of 1024), this script was created to convert to something useful and consistent.
Step 3.
Import the templates. The templates are named :
* "Template_example_ZFS"
* "Template_example_ZPOOL"
Both Templates are in the group "Templates".
| Attachment | Size |
|---|---|
| 529 bytes | |
| 39.91 KB | |
| 34.23 KB |
Comments
Anonymous (not verified)
Fri, 12/02/2011 - 22:47
Permalink
remove_SIunits.sh returns 403 forbidden
Link broken
Anonymous (not verified)
Sat, 12/17/2011 - 17:12
Permalink
fxsli@rambler.ru
remove_SIunits.sh
Forbidden
You don't have permission to access /sites/default/files/remove_SIunits.sh on this server.
Apache/2.2.16 (Debian) Server at www.zabbixtemplates.com Port 80
nicolas
Sat, 02/04/2012 - 02:13
Permalink
Missing Files?
Hello
Can t download the remove_Slunit.sh file ?
Thnaks in advance
Anonymous (not verified)
Sat, 02/18/2012 - 23:27
Permalink
my version
I couldn't download that script either. So I wrote one:
#!/usr/bin/bash
x=`cat`
if [ -z "$x" ]; then
exit 0
elif [ "${x%T}" != "$x" ]; then
echo "${x%T}" | awk '{ print $1*1e12 }'
elif [ "${x%G}" != "$x" ]; then
echo "${x%G}" | awk '{ print $1*1e9 }'
elif [ "${x%M}" != "$x" ]; then
echo "${x%M}" | awk '{ print $1*1e6 }'
elif [ "${x%K}" != "$x" ]; then
echo "${x%K}" | awk '{ print $1*1e3 }'
elif [ "${x%x}" != "$x" ]; then
# deduplication suffix is 'x'
echo "${x%x}"
elif [ "${x%%%}" != "$x" ]; then
echo "${x%%%}" | awk '{ print $1/100 }'
else
echo "$x"
fi
exit 0
Here's how it modifies the results:
eon:113:/etc/zabbix#!423
zpool list -H -o size ocean
3.41T
eon:114:/etc/zabbix#zpool list -H -o size ocean | ./remove_SIunits.sh
3410000000000
Anonymous (not verified)
Mon, 03/19/2012 - 01:45
Permalink
bypLtZwMZGPbz
Hey thanks for the info.I had the same perblom as you: while writing to zpool reads would become impossible.I spent a whole week, going from zpool v6 running on FreeBSD 7.2, to OpenSolaris r127, upgraded pool to v13, added dedicated external log device, changed vdev_max_pending to 1, all to no avail although, vdev_max_pending=1 did help a lot.In the end, however, I discovered the perblom was not in vdev_max_pending (which on osol 127 was set to 10 by default for me, not 32, so they have probably fixed that now in the kernel to use 10 by default for SATA disks?).The real culprit was a bad hard disk I discovered using iostat -xn 1 that zfs freezes when it gets stuck to writing to only one of the drives in the pool, which would show as 100% blocking in iostat => one of the drives was a lot slower, even though it never reported any errors, and scrubbing the pool actually went through fine (although slower too).I noticed that in your example also it is just one drive that is blocking at 100%, so I thought I'd let you know, just in case this might be the perblom in your case too.
gregober
Wed, 04/04/2012 - 12:26
Permalink
Authorization problem on your server
Hi,
Thanks for your very usefull site !
There seems to have a problem with the file located in :
http://zabbixtemplates.com/sites/default/files/remove_SIunits.sh
Can you please check the authorization of your server so that we can access this file.
Thanks a lot.
G.B.
admin
Wed, 04/04/2012 - 18:05
Permalink
Sorry all for the slow response
I have just copied the file onto the server with a new extension: http://zabbixtemplates.com/sites/default/files/remove_SIunits.sh.txt
Hope that helps!
Add new comment