Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Commit

Permalink
Merge pull request #52 from eimamagi/devel
Browse files Browse the repository at this point in the history
ARGO-985 Refine last_update logic of check_nagios sensor
  • Loading branch information
eimamagi authored Jun 12, 2018
2 parents f3c510d + 674777a commit 409b916
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/check_nagios
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ foreach my $service (@services) {
$state = CRITICAL;
last;
} else {
my $diff = ($service->{last_update} - $service->{last_check})/1000;
my $diff = time() - $service->{last_check}/1000;
if ($diff > $plugin->opts->age) {
$answer .= "Service $host/".$service->{description}." on Nagios $nagios is older than ".$plugin->opts->age." seconds, last check was $diff seconds ago.";
$state = CRITICAL;
Expand Down

0 comments on commit 409b916

Please sign in to comment.