Skip to content
Snippets Groups Projects
Commit e18335bc authored by Sergey Joseph Ivanov's avatar Sergey Joseph Ivanov
Browse files

check hardware clock

parent ea52a961
No related branches found
No related tags found
No related merge requests found
package Site::HWClock;
use strict;
use warnings;
use base 'Resmon::Module';
use Time::HiRes;
use Resmon::ExtComm qw(run_command);
=pod
=head1 NAME
Site::HWClock - check HWClock status
=head1 SYNOPSIS
Site::HWClock {
local : noop
}
=head1 DESCRIPTION
This module retrieves HWClock value and compares to System clock statistics.
=head1 CONFIGURATION
=over
=item check_name
Arbitrary name of the check.
=head1 METRICS
=over
=item hwclock (time)
=item system (time)
=item diff (time)
=back
=cut
sub handler {
my $self = shift;
my $config = $self->{'config'};
my $now = Time::HiRes::time();
my $rtc = qx(date +%s.%N -d "`hwclock -r`");
chomp $rtc;
return {
"hwclock" => [$rtc, "%F"],
"system" => [$now, "%F"],
"diff" => [$now - $rtc, "%F"]
};
};
1;
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