From 99ad80740cb2fcea1c33e59caf1c05af5a53a14f Mon Sep 17 00:00:00 2001 From: VVelox Date: Sun, 19 Aug 2018 17:47:07 -0500 Subject: [PATCH] update for the new json_app_get stuff (#179) --- snmp/zfs-freebsd | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/snmp/zfs-freebsd b/snmp/zfs-freebsd index cea6e1e..d78658c 100755 --- a/snmp/zfs-freebsd +++ b/snmp/zfs-freebsd @@ -51,7 +51,7 @@ use Getopt::Std; $Getopt::Std::STANDARD_HELP_VERSION = 1; sub main::VERSION_MESSAGE { - print "FreeBSD ZFS stats extend 0.0.0\n"; + print "FreeBSD ZFS stats extend 0.1.0\n"; } sub main::HELP_MESSAGE { @@ -251,13 +251,19 @@ while ( defined( $pools[$pools_int] ) ) { } $tojson{pools}=\@toShoveIntoJSON; +my %head_hash; +$head_hash{'data'}=\%tojson; +$head_hash{'version'}=1; +$head_hash{'error'}=0; +$head_hash{'errorString'}=''; + my $j=JSON->new; if ( $opts{p} ){ $j->pretty(1); } -print $j->encode( \%tojson ); +print $j->encode( \%head_hash ); if (! $opts{p} ){ print "\n";