From 54ffe7c67c7697ce94d4a3b36baef007e0e2255a Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 19 Apr 2013 18:16:28 +0200 Subject: [PATCH] initialize an empty array in disco_block_devices --- zabbix_scripts/disco_block_devices | 1 + 1 file changed, 1 insertion(+) diff --git a/zabbix_scripts/disco_block_devices b/zabbix_scripts/disco_block_devices index f56a597..0db14b9 100644 --- a/zabbix_scripts/disco_block_devices +++ b/zabbix_scripts/disco_block_devices @@ -6,6 +6,7 @@ opendir(my $dh, "/sys/block") or die "Couldn't open /sys/block: $!"; my @blocks = grep { $_ !~ m/^\./ } readdir($dh); closedir($dh); my $json; +@{$json->{data}} = (); foreach my $block (@blocks){ my $removable = 0; my $size = 1;