zabbix-agent-addons/zabbix_scripts/disco_zfs
2018-05-28 17:26:57 +02:00

19 lines
272 B
Perl

#!/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);