chiark
/
gitweb
/
~mdw
/
rcheck
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f5f6d9a
)
ntp: New check for NTP clock condition.
author
Mark Wooding
<mdw@distorted.org.uk>
Wed, 22 Jun 2011 08:13:01 +0000
(09:13 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Wed, 22 Jun 2011 08:13:01 +0000
(09:13 +0100)
check.d/ntp
[new file with mode: 0755]
patch
|
blob
diff --git a/check.d/ntp
b/check.d/ntp
new file mode 100755
(executable)
index 0000000..
68e8ac2
--- /dev/null
+++ b/
check.d/ntp
@@ -0,0
+1,20
@@
+#! /bin/sh -e
+
+ntpdc -c peers | {
+ any=nil
+ while read remote local st poll reach delay offset disp; do
+ case "$remote" in
+ \**) ;;
+ *) continue ;;
+ esac
+ awk -v off="$offset" 'BEGIN {
+ if (off < 0) off = -off;
+ if (off >= 0.1) printf "W: absolute time offset %gs worrying\n", off;
+ else if (off >= 0.01) printf "I: absolute time offset %gs concerning\n", off;
+ }'
+ any=t
+ done
+ case $any in
+ nil) echo "W: not sychronized to any peer" ;;
+ esac
+}