mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
jenkins_: Fix uninitialized values warning with unmapped states
This commit is contained in:
parent
cf88bc6c41
commit
b2080e1178
1 changed files with 5 additions and 1 deletions
|
@ -134,7 +134,11 @@ if ( exists $ARGV[0] and $ARGV[0] eq "config" ) {
|
|||
my $result = `$cmd/api/json`;
|
||||
my $parsed = decode_json($result);
|
||||
foreach my $cur(@{$parsed->{'jobs'}}) {
|
||||
$counts{$cur->{'color'}} += 1;
|
||||
if (defined $states{$cur->{'color'}}) {
|
||||
$counts{$cur->{'color'}} += 1;
|
||||
} else {
|
||||
warn "Ignoring unknown color " . $cur->{'color'} . "\n"
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $status (keys %counts) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue