Nagios plugins for monitoring ZFS?

GP123

Member
Dec 20, 2021
15
1
8
35
Hi!

Does anyone have any good Nagios plugins for monitoring ZFS? Most of the ones I'm finding on Nagios Exchange are outdated and I can't get them to work without a dependency issue somewhere.

I'm using Nagios Core Version 4.4.14

PS: Please don't recommend ZED, I need something that feeds into Nagios.
 
Yes, in the end if often cames down to write it yourself. The simplest that comes to mind is just to check for the pool health and alarm if it does not match. Querying the health status is simple:

zpool list -H -o health zpool

So just check if that is ONLINE, then everything is fine and if not alarm. A simple plugin could be like this:

Bash:
#!/bin/bash

POOL=${1:-zpool}

STATUS=$( zpool list -H -o health "$POOL" )

RETVAL=0
[ "$STATUS" != "ONLINE" ] && RETVAL=2

echo "$POOL: $STATUS"
exit "$RETVAL"
 
  • Like
Reactions: Johannes S