1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

jenkins_: Fix uninitialized values warning with unmapped states

This commit is contained in:
Dominic Hargreaves 2015-09-10 14:25:26 +01:00
parent cf88bc6c41
commit b2080e1178

View file

@ -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) {