Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
configuration
Commits
e67c05b2
Commit
e67c05b2
authored
Aug 11, 2016
by
Bilal Ahmad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addressing comments
parent
bb50bb7a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
playbooks/roles/common/templates/log-ntp-alerts.sh.j2
+2
-2
No files found.
playbooks/roles/common/templates/log-ntp-alerts.sh.j2
View file @
e67c05b2
...
@@ -3,14 +3,14 @@
...
@@ -3,14 +3,14 @@
log_directory
={{
COMMON_LOG_DIR
}}
log_directory
={{
COMMON_LOG_DIR
}}
reach
=
$(
ntpq
-c
associations | awk
'{print $5}'
|
grep
yes
)
reach
=
$(
ntpq
-c
associations | awk
'{print $5}'
|
grep
yes
)
if
[[
${
reach
}
==
*
"no"
*
]]
;
then
if
[[
${
reach
}
==
*
"no"
*
]]
;
then
echo
$(
date
-u
)
"NTPD not synchronized - Please investigate"
>>
${
log_directory
}
/ntp.log
echo
$(
date
-u
)
$(
hostname
)
"NTPD not synchronized - Please investigate"
>>
${
log_directory
}
/ntp.log
fi
fi
limit
=
100
# limit in milliseconds
limit
=
100
# limit in milliseconds
offsets
=
$(
ntpq
-nc
peers | tail
-n
+3 | cut
-c
62-66 | tr
-d
'-'
)
offsets
=
$(
ntpq
-nc
peers | tail
-n
+3 | cut
-c
62-66 | tr
-d
'-'
)
for
offset
in
${
offsets
}
;
do
for
offset
in
${
offsets
}
;
do
if
[
${
offset
:-
0
}
-ge
${
limit
:-
100
}
]
;
then
if
[
${
offset
:-
0
}
-ge
${
limit
:-
100
}
]
;
then
echo
$(
date
-u
)
"An NTPD
offset is excessive - Please investigate"
>>
${
log_directory
}
/ntp.log
echo
$(
date
-u
)
$(
hostname
)
"An NTPD offset with value
$
offset
is excessive - Please investigate"
>>
${
log_directory
}
/ntp.log
exit
1
exit
1
fi
fi
done
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment