Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resmon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrors
resmon
Commits
e18335bc
Commit
e18335bc
authored
5 years ago
by
Sergey Joseph Ivanov
Browse files
Options
Downloads
Patches
Plain Diff
check hardware clock
parent
ea52a961
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/Site/HWClock.pm
+64
-0
64 additions, 0 deletions
lib/Site/HWClock.pm
with
64 additions
and
0 deletions
lib/Site/HWClock.pm
0 → 100644
+
64
−
0
View file @
e18335bc
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
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment