Skip to content
This repository was archived by the owner on Jun 17, 2020. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions check_puppetdb_nodes
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ foreach my $node (@$data) {

next if grep { $certname eq $_ } @ignore_list;

if ( !defined $deactivated and ( !length $catalog_timestamp or !length $report_hash )) {
if ( !defined $deactivated and !length $catalog_timestamp ) {
$np->add_message( CRITICAL,
"$certname last run UNAVAILABLE\n" );
}
if ( !defined $deactivated and length $catalog_timestamp and $report_hash) {
if ( !defined $deactivated and length $catalog_timestamp ) {
my $delta = ( $now - $ts );
if ( $delta > ( $np->opts->critical * 60 ) ) {
$np->add_message( CRITICAL,
Expand Down Expand Up @@ -223,7 +223,7 @@ foreach my $node (@$data) {
$np->add_message( WARNING,
"$certname had $failures failures in the last run\n" );
}
elsif ( exists $apiurls{$np->opts->apiversion}{'logs'} ) {
elsif ( exists $apiurls{$np->opts->apiversion}{'logs'} and $report_hash) {
my $apiurl = $apiurls{$np->opts->apiversion}{'logs'};
$apiurl =~ s/{hash}/$report_hash/;
$uri = URI->new( $url . $apiurl );
Expand Down