initialize an empty array in disco_sensors

tags/zabbix-agent-addons-0.2.20-1
Daniel Berteaud 12 years ago
parent 828a502ea2
commit 523b45b406
  1. 3
      zabbix_scripts/disco_sensors

@ -2,6 +2,7 @@
use JSON; use JSON;
my $json; my $json;
@{$json->{data}} = ();
open SENSORS, ('</etc/zabbix/sensors.conf') || open SENSORS, ('</etc/zabbix/sensors.conf') ||
die "Couldn't open /etc/zabbix/sensors.conf: $!\n"; die "Couldn't open /etc/zabbix/sensors.conf: $!\n";
@ -17,5 +18,5 @@ foreach (<SENSORS>){
}; };
} }
close SENSORS; close SENSORS;
print to_json($json) if (defined $json->{data}); print to_json($json);
exit(0); exit(0);

Loading…
Cancel
Save