Nagios Exchange Nagios Exchange
  • Home
  • Directory
  • Library
  • Support
  • About
  • Submit Feedback

Advanced Search

Build precise queries to find exactly what you need

Search Logic

Select compatible versions

Press ESC to close

Sign In Sign Up

Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More

  • Home
  • Directory
  • Library
  • Support
  • About
  • Submit Feedback
Plugins4410Themes and Skins13Add-ons763Graphics and Logos36View All Categories
LinuxSecuritySNMPFile SystemCloud
New Listings Recently Updated Listings Most Favored Listings Most Popular Listings Most Rated Listings Most Reviewed Listings
Random Project
2012 Nagios World Conference Presentations Nagios Conference 2012 – Mike Guthrie – Nagios Fusion 2012
0.0 (0)
48.6K
RSS Feed
Newest Listings Updated Listings
Top Contributors
John Shorey (4)deskwork_itunes142 (4)Chad Columbus (3)Marcin Bednarski (3)Davide Lemma (3)
See More
Newest Contributors
pawal (1)matthewducey (1)Linuxfabrik (1)signalgrid (1)Sanna Glue (2)
See More

Copyright © 2009-2026 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home > Mario Chamorro
MC

Mario Chamorro

@mchamorr

User Stats

Member Since: July 11, 2016

Favorites0

Views

Projects0

No Projects Found
check_zfs_linux

Good script with no dependencies

I like this little script because it does not 'use' things I don't already have installed. In fact, it only 'use strict'. The script is a few years old, so I've updated it for the latest 'zpool list' output from Ubuntu 16.04 0.6.5.6-0ubuntu10 / ZFS on Linux zfs-0.6.5.6 . The diff is below: $ diff -Nurp check_zfs.2 check_zfs.0 --- check_zfs.2 2016-07-11 17:10:43.981148057 -0400 +++ check_zfs.0 2016-07-11 16:11:33.460956749 -0400 @@ -61,14 +61,12 @@ if ($#ARGV+1 != 2) { my $pool=$ARGV[0]; my $verbose=$ARGV[1]; -my $size=""; # SIZE -my $used=""; # ALLOC -my $avail=""; # FREE -my $sizex=""; # EXPANDSZ -my $frag=""; # FRAG -my $cap=""; # CAP -my $dedup=""; # DEDUP -my $health=""; # HEALTH +my $size=""; +my $used=""; +my $avail=""; +my $cap=""; +my $dedup=""; +my $health=""; my $dmge=""; if ($verbose 3) { @@ -77,30 +75,19 @@ if ($verbose 3) { } my $statcommand="zpool list $pool"; -# my $statcommand="zpool list -o 'name,size,alloc,free,cap,dedup,health,altroot'"; if (! open STAT, "$statcommand|") { print ("$state '$statcommand' command returns no result! NOTE: This plugin needs OS support for ZFS, and execution with root privileges.n"); exit $ERRORS{$state}; } -# NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT -# rpool 9.94G 718M 9.24G - 6% 7% 1.00x ONLINE - - while() { chomp; - NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT - next if (/^NAMEs+SIZEs+ALLOCs+FREEs+EXPANDSZs+FRAGs+CAPs+DEDUPs+HEALTHs+ALTROOT/); + NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT + next if (/^NAMEs+SIZEs+ALLOCs+FREEs+CAPs+DEDUPs+HEALTHs+ALTROOT/); if (/^${pool}s+/) { - ($size, $used, $avail, $sizex, $frag, $cap, $dedup, $health) = - /^${pool}s+(S+)s+(S+)s+(S+)s+(S+)s+(S+)s+(S+)s+(S+)s+(S+)/; + ($size, $used, $avail, $cap, $dedup, $health) = /^${pool}s+(S+)s+(S+)s+(S+)s+(S+)s+(S+)s+(S+)/; } - -# NAME SIZE ALLOC FREE CAP DEDUP HEALTH ALTROOT -# next if (/^NAMEs+SIZEs+ALLOCs+FREEs+CAPs+DEDUPs+HEALTHs+ALTROOT/); -# if (/^${pool}s+/) { -# ($size, $used, $avail, $cap, $dedup, $health) = /^${pool}s+(S+)s+(S+)s+(S+)s+(S+)s+(S+)s+(S+)/; -# } } close(STAT); @@ -218,6 +205,6 @@ while() { ## calling all goats! -$msg = sprintf "ZPOOL %s : %s {Size:%s Used:%s Avail:%s Expand:%s Frag:%s Cap:%s Dedup:%s} %sn", $pool, $health, $size, $used, $avail, $sizex, $frag, $cap, $dedup, $dmge; +$msg = sprintf "ZPOOL %s : %s {Size:%s Used:%s Avail:%s Cap:%s} %sn", $pool, $health, $size, $used, $avail, $cap, $dmge; print $state, " ", $msg; exit ($ERRORS{$state});

Reviewed 10 years ago

No Favorites Found

Copyright © 2009-2026 Nagios Enterprises, LLC. All rights reserved.

Privacy PolicyTerms of UseTrademarks
Home Browse Submit Profile