else { push @{$count->{'unknown'}}, $zone; };
delete $threads{$zone};
}
- sleep(1) unless scalar keys %threads == 0;
+ last if scalar keys %threads == 0;
+ print STDERR (scalar keys %threads), " threads left: ", join(" ", keys %threads), "\n" if $params->{'debug'};
+ sleep 1;
}
for my $zone (sort {$a cmp $b} keys %threads) {
push @{$count->{'warn'}}, $zone;
@{$count->{$k}} = sort {$a cmp $b} @{$count->{$k}};
}
-my $exit = 0;
+my $exit;
my %state_mapping = (
'unknown' => 255,
'critical' => 2,
printf "unsigned: %d", scalar @{$count->{'unsigned'}};
print "\n";
print $_ for (@details);
-exit $exit;
+exit ((defined $exit) ? $exit : 0);