1
0
mirror of https://github.com/librenms/librenms-agent.git synced 2024-05-09 09:54:52 +00:00

Fix: zpool list output changed, incorrect values (#219)

* fix zpool data, output of zpool list -pH changed in freebsd 11

* fix zpool data, output of zpool list -pH changed in freebsd 11

* bump version

* version dump to 2
This commit is contained in:
Felicián Hoppál
2019-02-11 23:06:57 +01:00
committed by Tony Murray
parent 3a407e3f72
commit c9a0d2893e

View File

@ -51,7 +51,7 @@ use Getopt::Std;
$Getopt::Std::STANDARD_HELP_VERSION = 1;
sub main::VERSION_MESSAGE {
print "FreeBSD ZFS stats extend 0.1.0\n";
print "FreeBSD ZFS stats extend 0.2.0\n";
}
sub main::HELP_MESSAGE {
@ -239,11 +239,11 @@ while ( defined( $pools[$pools_int] ) ) {
my $pool=$pools[$pools_int];
$pool =~ s/\t/,/g;
$pool =~ s/\,\-\,/\,0\,/g;
$pool =~ s/\,\-\,\-\,/\,0\,0\,/g;
$pool =~ s/\%//g;
$pool =~ s/\,([0-1\.]*)x\,/,$1,/;
( $newPool{name}, $newPool{size}, $newPool{alloc}, $newPool{free}, $newPool{expandsz}, $newPool{frag}, $newPool{cap}, $newPool{dedup} )=split(/\,/, $pool);
( $newPool{name}, $newPool{size}, $newPool{alloc}, $newPool{free}, $newPool{ckpoint}, $newPool{expandsz}, $newPool{frag}, $newPool{cap}, $newPool{dedup} )=split(/\,/, $pool);
push(@toShoveIntoJSON, \%newPool);
@ -253,7 +253,7 @@ $tojson{pools}=\@toShoveIntoJSON;
my %head_hash;
$head_hash{'data'}=\%tojson;
$head_hash{'version'}=1;
$head_hash{'version'}=2;
$head_hash{'error'}=0;
$head_hash{'errorString'}='';