Skip to content
Snippets Groups Projects
Commit 84b2ad9b authored by Sergey Joseph Ivanov's avatar Sergey Joseph Ivanov Committed by root
Browse files

Increase precision

parent d9b99049
No related branches found
No related tags found
No related merge requests found
......@@ -320,6 +320,7 @@ eval {
my $ref;
# Make the HTTP request
my $res = $ua->request($t);
my $now_after = Time::HiRes::time();
die "could not fetch http://$host:$port$url - " . $res->status_line ."\n"
unless($res && $res->is_success);
# Parse the xml
......@@ -340,9 +341,9 @@ eval {
if($age) {
my $last_update;
if ($module eq 'System::Time' && $check eq 'now') {
$last_update = Time::HiRes::time() - $ref->{ResmonResult}->[$idx]->{metric}->{now}->{content};
$last_update = $now_after - $ref->{ResmonResult}->[$idx]->{metric}->{now}->{content};
} else {
$last_update = Time::HiRes::time() - $ref->{ResmonResult}->[$idx]->{last_update}->[0];
$last_update = $now_after - $ref->{ResmonResult}->[$idx]->{last_update}->[0];
}
if ($age < abs($last_update)){
$state = "CRITICAL";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment