Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c489348 + 12c43d6 commit 52ccae2Copy full SHA for 52ccae2
fabfile.py
@@ -15,6 +15,7 @@
15
import licensify
16
import mongo
17
import nginx
18
+import ntp
19
import puppet
20
import rkhunter
21
import search
ntp.py
@@ -0,0 +1,17 @@
1
+from fabric.api import *
2
+
3
+@task
4
+def status():
5
+ """Report the VM's NTP status."""
6
+ run("/usr/lib/nagios/plugins/check_ntp_time -q -H ntp.ubuntu.com -w 2 -c 3")
7
8
9
+def resync():
10
+ """Forcibly resynchronise the VM's NTP clock.
11
12
+ If a VM's clock manages to get sufficiently out of sync, ntp will give up,
13
+ forcing a manual intervention.
14
+ """
+ sudo("service ntp stop")
+ sudo("ntpdate ntp.ubuntu.com")
+ sudo("service ntp start")
0 commit comments