Opensolaris ZFS & ZPOOL

Description: 

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".

Quality: 
Average: 4.8 (11 votes)

Comments

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

Hello
Can t download the remove_Slunit.sh file ?
Thnaks in advance

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

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.

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.

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

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.