You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
272 B
19 lines
272 B
7 years ago
|
#!/usr/bin/perl -w
|
||
|
|
||
|
use strict;
|
||
|
use warnings;
|
||
|
use JSON;
|
||
|
use File::Which;
|
||
|
|
||
|
my $json;
|
||
|
@{$json->{data}} = ();
|
||
|
my $zpool = which('zpool');
|
||
|
|
||
|
if ($zpool){
|
||
|
foreach (qx($zpool list -H -o name)){
|
||
|
chomp;
|
||
|
push @{$json->{data}}, { ZPOOL => $_ };
|
||
|
}
|
||
|
}
|
||
|
print to_json($json);
|