Build precise queries to find exactly what you need
Press ESC to close
Nagios World Conference 2026: Sept. 14-17 in St. Paul, MN | Learn More
Script errored due to empty $minutessincestart:
sub nagios { my $self = shift; my %params = @_; if (! $self->{nagios_level}) { if ($params{mode} =~ /server::jobs::failed/) { if ($self->{lastrunstatus} ne “succeeded”) { if ($self->{lastrunstatus} eq “failed”) { $self->add_nagios_critical( sprintf “%s failed: %s”, $self->{name}, $self->{lastrunstatusmessage}); } elsif ($self->{lastrunstatus} eq “retry” || $self->{lastrunstatus} eq “canceled”) { $self->add_nagios_warning( sprintf “%s %s: %s”, $self->{name}, $self->{lastrunstatus}, $self->{lastrunstatusmessage}); } else { if ($self->{lastrunstatus}) { print “else: $params{mode} $self->{name} $self->{lastrunstatus} “; $self->add_nagios( $self->check_thresholds($self->{lastrundurationseconds}, 60, 300), #sprintf(“job %s ran for %d seconds (started %s) “, $self->{name}, sprintf(“job %s ran for %d seconds (started %s)”, $self->{name}, $self->{lastrundurationseconds}, $self->{lastrundatetime})); } } } else { print “OK – $self->{name}, $self->{lastrundurationseconds}, $self->{lastrundatetime} “; } } } }
Script alerted if lastrunstatus was not set: