diff --git a/check_jenkins_nodes.pl b/check_jenkins_nodes.pl index 7af1ae3..341a375 100644 --- a/check_jenkins_nodes.pl +++ b/check_jenkins_nodes.pl @@ -60,13 +60,18 @@ sub main { for my $computer (@{$obj->{'computer'} or []}) { ++$totalNodes; - if($computer->{'offline'} eq 'true') + if(($computer->{'offline'} eq 'true') || ($computer->{'offline'} eq '1')) { push(@offline, { 'displayName' => $computer->{'displayName'}, 'offlineCauseReason' => $computer->{'offlineCauseReason'} }); } + # all nodes online + else { + $retStr = "All nodes online.\n"; + $exitCode = $ERRORS{'OK'}; + } } if (my $offlineNodes = scalar(@offline))