Monitor zfs pools - which Nagios plugin should be used?

Written by - 2 comments

Published on May 7th 2013 - Listed in Nagios BSD Hardware Unix Monitoring ZFS

At my work there are several machines running with zfs file systems. Some of them also use zfs pools, which can define a raid out of a system without raid controller (a bit like mdraid simply explained - please don't hit me Solaris guys!). To be able to monitor the status of such zfs pools, there are many Nagios plugins around. Alone on  I found seven plugins which check zfs file systems and/or pools. But which one should I take, given that we run different operating systems with zfs?

To answer this question I compared all seven plugins if they work, how they're working and what they can do on the following operating systems on physical machines:
- Solaris 10
- OpenSolaris 11
- SmartOS 2012Q2
- FreeBSD 8.3

The following plugins were compared:

  1. Check ZFS file systems and data pools (
    Author: Michael Simoni

  2. check_zfs
    Author: Nathan Butcher

  3. Check Solaris ZFS Pools (check_zpools)

  4. Solaris Zpools checker (check_zpools)
    Author: Aldo Fabi

  5. check_zpool_fs
    Author: Suraj K Abraham

    Author: ?

  7. check_zpool (
    Author: Søren Klintrup


Plugins output (examples):

1. on a Solaris 10:

# Check all pools
./ -p
OK: ZFS on solaris-server - No zfs failures detected

# Check single pool:
./ -p -z rpool
OK: ZFS on solaris-server - No zfs failures detected

2. check_zfs on an OpenSolaris 11:

# Check with verbose level 2
./ datapool1 2
OK ZPOOL datapool1 : ONLINE {Size:13.6T Used:13.2T Avail:449G Cap:96%}

# Check with verbose level 3 (shows all disks)
./ datapool1 3
OK ZPOOL datapool1 : ONLINE {Size:13.6T Used:13.2T Avail:449G Cap:96%} c9t2d0:ONLINE c10t1d0:ONLINE c9t3d0:ONLINE c10t2d0:ONLINE c9t4d0:ONLINE c10t3d0:ONLINE c9t5d0:ONLINE c10t4d0:ONLINE c9t6d0:ONLINE c10t5d0:ONLINE c9t7d0:ONLINE c10t6d0:ONLINE c9t1d0:ONLINE c10t7d0:ONLINE c9t8d0:ONLINE c10t8d0:ONLINE c9t9d0:ONLINE c10t9d0:ONLINE c9t10d0:ONLINE c10t10d0:ONLINE c9t11d0:ONLINE c10t11d0:ONLINE c9t12d0:ONLINE c10t12d0:ONLINE c9t13d0:ONLINE c10t13d0:ONLINE c9t14d0:ONLINE c10t14d0:ONLINE c9t15d0:ONLINE c10t15d0:ONLINE [SPARES]:-

3. check_zpools on FreeBSD 8.3 and on OpenSolaris 11:

# FreeBSD 8.3:
OK:datapool:23%:ONLINE OK:dbpool:4%:ONLINE

# OpenSolaris 11:
WARNING:datapool1:96%:ONLINE OK:rpool:25%:ONLINE

4. check_zpools on Solaris 10:


5. check_zpool_fs on Solaris 10 and OpenSolaris 11:

# Solaris 10
./check_zpool_fs rpool 90 95
/rpool: 5%used - (Used: 8.12G/Total: 136G) (90%): OK

# OpenSolaris 11
./check_zpool_fs datapool1 90 95
/datapool1: 96%used - (Used: 13.2T/Total: 13.6T) (95%): CRITICAL

6. on FreeBSD 8.3:

Can't locate Nagios/ in @INC (@INC contains: ....

7. on FreeBSD 8.3, SmartOS and Solaris 10:

  / datapool: online / dbpool: online

  / zones: online

sed: illegal option -- E
Bad string
 / rpool: unknown state


Comparison table:

 Plugin  Help  Verbose  Solaris10
 OpenSolaris11  SmartOS
 FreeBSD 8.3
 1  y  y  y  y  n (*4)  n (*6)
 2  y (*1)
 y  y  y  n (*4)  y (*7)
 3  n  n  y  y  y  y (*8)
 4  n  n  y  y  y  y (*8)  n
 5  y (*1)  n  y  y  n (*5)
 n (*5)  ?
 6  y  y  n (*2)
 n (*2)  n (*4)  n (*2)  ?
 7  n  n  n (*3)
 n (*3)  y  y  ?

Plugin: The plugin number tested (see above for list)
Help: Is there a help function of the plugin available? (--help, or -h, etc)
Verbose: Is there a verbose function for additional information?
Solaris10: Does the plugin work on Solaris 10?
OpenSolaris11: Does the plugin work on Open Solaris 11?
SmartOS: Does the plugin work on SmartOS (2012Q2)?
FreeBSD 8.3: Does the plugin work on FreeBSD 8.3?
Active: Is this plugin in active development?

*1: No real help available but shows usage as help
*2: Additional perl modules are required
*3: sed -E is used, which is not recognized by the sed installed on the OS
*4: Perl is required
*5: Invalid option error
*6: Plugin outputs that it only works on Solaris 10 when launched on FreeBSD
*7: Works, but always returns CRITICAL output
*8: Works after paths of commands were adapted to FreeBSD

8+: As requested in the comments, I added my own check_zpools plugin.


Additional comments:

Plugin 2) I really like the output of this plugin! A real bummer that it doesn't work on SmartOS due to perl usage :-(
Plugin 3+4) This is actually very much the same plugin, 3) is a fork of 4) with some minor changes
Plguin 6) requires additional perl modules to work (Nagios::Plugin and Switch at least)

I am aware that the "n" could easily become a "y" when perl is installed, but my requirement for the plugin is that it works out of the box, without having to install anything.
Unfortunately, a physical SmartOS doesn't come with a lot of software, so minimum compatibility is important in my case.


And the lovely winner is...:

If I could choose, I'd prefer candidate 2's output mixed with the compatibility of candidate 4 (because its a shell script).
So at the end I decided for plugin 3 (Check Solaris ZFS Pools) but I'll have to adapt the source code anyway so it also works on FreeBSD systems. 

I hope this comparison was helpful to you.

Update May 9th 2013: As mentioned, I decided for check_zpools. But for compatibility reasons (SmartOS, FreeBSD, Solaris) I made a lot of changes. Take a look at the next article "Presenting check_zpools - a Nagios plugin to monitor zfs pools".

Add a comment

Show form to leave a comment

Comments (newest first)

ck from St. Gallen, Switzerland wrote on Aug 12th, 2015:

Hi Logan. Good idea. I added my own check_zpools into the comparison table.

Logan M from US wrote on Aug 12th, 2015:

Hey nice plugin you have here, would it be possible to update to get the results of zpool status? I have started using the script outlined here to monitor zpool status which seems to work but would be good to have all ZFS checks in one nice neat package no ? :)