summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/defaults/periodic.conf3
-rw-r--r--etc/periodic/daily/480.status-ntpd28
-rw-r--r--share/man/man5/periodic.conf.57
3 files changed, 37 insertions, 1 deletions
diff --git a/etc/defaults/periodic.conf b/etc/defaults/periodic.conf
index 9b10ca6..041b169 100644
--- a/etc/defaults/periodic.conf
+++ b/etc/defaults/periodic.conf
@@ -130,6 +130,9 @@ daily_status_mail_rejects_logs=3 # How many logs to check
daily_status_named_enable="YES"
daily_status_named_usedns="YES" # DNS lookups are ok
+# 480.status-ntpd
+daily_status_ntpd_enable="NO" # Check NTP status
+
# 500.queuerun
daily_queuerun_enable="YES" # Run mail queue
daily_submit_queuerun="YES" # Also submit queue
diff --git a/etc/periodic/daily/480.status-ntpd b/etc/periodic/daily/480.status-ntpd
new file mode 100644
index 0000000..1eb8011
--- /dev/null
+++ b/etc/periodic/daily/480.status-ntpd
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+ . /etc/defaults/periodic.conf
+ source_periodic_confs
+fi
+
+rc=0
+
+case "$daily_status_ntpd_enable" in
+ [Yy][Ee][Ss])
+ echo ""
+ echo "NTP status:"
+
+ synchronized=$(ntpq -p | tee /dev/stderr | grep '^\*')
+ if [ -z "$synchronized" ]; then
+ rc=1
+ fi
+ ;;
+esac
+
+exit $rc
diff --git a/share/man/man5/periodic.conf.5 b/share/man/man5/periodic.conf.5
index bc07c57..2052a1b 100644
--- a/share/man/man5/periodic.conf.5
+++ b/share/man/man5/periodic.conf.5
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 3, 2006
+.Dd May 12, 2007
.Dt PERIODIC.CONF 5
.Os
.Sh NAME
@@ -592,6 +592,11 @@ for the previous day.
Set to
.Dq Li YES
if you want to enable reverse DNS lookups.
+.It Va daily_status_ntpd
+.Pq Vt bool
+Set to
+.Dq Li YES
+if you want to enable NTP status check.
.It Va daily_queuerun_enable
.Pq Vt bool
Set to
OpenPOWER on IntegriCloud