From 674777aca6f4cd6b71327fa3a4369360a49fbbf6 Mon Sep 17 00:00:00 2001 From: eimamagi Date: Tue, 12 Jun 2018 07:36:09 +0200 Subject: [PATCH] ARGO-985 Refine last_update logic of check_nagios sensor --- src/check_nagios | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/check_nagios b/src/check_nagios index bd8f2a6..d964ef0 100755 --- a/src/check_nagios +++ b/src/check_nagios @@ -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;