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

Commit

Permalink
ARGO-985 Refine last_update logic of check_nagios sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
eimamagi committed Jun 12, 2018
1 parent f3c510d commit 674777a
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 674777a

Please sign in to comment.