Fix using keys on hash

tags/zabbix-agent-addons-0.2.20-1
Daniel Berteaud 10 years ago
parent 8e90619012
commit c3ee93d817
  1. 2
      zabbix_scripts/disco_sensors

@ -18,7 +18,7 @@ my $json;
my $cfg = new Config::Simple; my $cfg = new Config::Simple;
$cfg->read('/etc/zabbix/sensors.ini'); $cfg->read('/etc/zabbix/sensors.ini');
my %sensors = (); my %sensors = ();
foreach my $k (keys $cfg->vars){ foreach my $k (keys %{$cfg->vars}){
$k =~ s/\..*$//; $k =~ s/\..*$//;
$sensors{$k} = 1 unless $sensors{$k}; $sensors{$k} = 1 unless $sensors{$k};
} }

Loading…
Cancel
Save