diff --git a/CHANGELIST b/CHANGELIST index 4e82f21..fbac880 100644 --- a/CHANGELIST +++ b/CHANGELIST @@ -1,3 +1,5 @@ +1.4.1 updated check_zpool() in sanoid to parse zpool list properly both pre- and post- ZoL v0.6.4 + 1.4.0 added findoid tool - find and list all versions of a given file in all available ZFS snapshots. use: findoid /path/to/file 1.3.1 whoops - prevent process_children_only from getting set from blank value in defaults diff --git a/VERSION b/VERSION index 88c5fb8..347f583 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.0 +1.4.1 diff --git a/findoid b/findoid index 701a597..04e2386 100755 --- a/findoid +++ b/findoid @@ -11,7 +11,7 @@ use warnings; my $zfs = '/sbin/zfs'; my %args = getargs(@ARGV); -my $progversion = '1.4.0'; +my $progversion = '1.4.1'; if ($args{'version'}) { print "$progversion\n"; exit 0; } diff --git a/sanoid b/sanoid index 0b92140..aac8996 100755 --- a/sanoid +++ b/sanoid @@ -4,7 +4,7 @@ # from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this # project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE. -my $version = '1.4.0'; +my $version = '1.4.1'; use strict; use Config::IniFiles; # read samba-style conf file @@ -741,23 +741,28 @@ sub check_zpool() { exit $ERRORS{$state}; } - my $statcommand="/sbin/zpool list $pool"; + my $statcommand="/sbin/zpool list -o name,size,cap,health,free $pool"; 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}; } - + + # chuck the header line + my $header = ; + + # find and parse the line with values for the pool while() { chomp; - next if (/^NAME\s+SIZE\s+USED\s+AVAIL\s+CAP\s+HEALTH\s+ALTROOT/); if (/^${pool}\s+/) { - ($size, $used, $avail, $cap, $dedup, $health) = /^${pool}\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)/; + my @row = split (/ +/); + my $name; + ($name, $size, $cap, $health, $avail) = @row; } } # Tony: Debuging - #print "Size: $size \t Used: $used \t Avai: $avail \t Cap: $cap \t Health: $health\n"; + # print "Size: $size \t Used: $used \t Avai: $avail \t Cap: $cap \t Health: $health\n"; close(STAT); @@ -869,7 +874,7 @@ sub check_zpool() { ## calling all goats! - $msg = sprintf "ZPOOL %s : %s {Size:%s Used:%s Avail:%s Cap:%s} %s\n", $pool, $health, $size, $used, $avail, $cap, $dmge; + $msg = sprintf "ZPOOL %s : %s {Size:%s Free:%s Cap:%s} %s\n", $pool, $health, $size, $avail, $cap, $dmge; $msg = "$state $msg"; return ($ERRORS{$state},$msg); } # end check_zpool() diff --git a/syncoid b/syncoid index c438bea..23b62e0 100755 --- a/syncoid +++ b/syncoid @@ -4,7 +4,7 @@ # from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this # project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE. -my $version = '1.4.0'; +my $version = '1.4.1'; use strict; use Data::Dumper;