зеркало из https://github.com/mozilla/mig.git
75 строки
5.4 KiB
HTML
75 строки
5.4 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8" />
|
||
<link href="docstyle.css" rel="stylesheet" />
|
||
<title>Mozilla InvestiGator: TimeDrift module</title>
|
||
<meta content="Julien Vehent <jvehent@mozilla.com>" name="author" />
|
||
</head>
|
||
<body>
|
||
<h1>Mozilla InvestiGator: TimeDrift module</h1>
|
||
<aside class="topic contents" id="table-of-contents">
|
||
<h1>Table of Contents</h1>
|
||
<ul class="auto-toc">
|
||
<li><a href="#usage">1 Usage</a></li>
|
||
<li>
|
||
<p><a href="#examples">2 Examples</a></p>
|
||
<ul class="auto-toc">
|
||
<li><a href="#endpoint-non-compliant-with-a-10-millisecond-drift">2.1 Endpoint non-compliant with a 10 millisecond drift</a></li>
|
||
<li><a href="#endpoint-compliant-with-a-5-seconds-drift">2.2 Endpoint compliant with a 5 seconds drift</a></li>
|
||
<li><a href="#get-localtime-from-endpoint">2.3 Get localtime from endpoint</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</aside>
|
||
<p>The timedrift module evaluates the current time on a given endpoint against the time retrieved from a list of NTP servers. If the -drift parameter is passed, the module checks that the endpoint's time is within or without the drift window.</p>
|
||
<p>When evaluating drift, the module returns FoundAnything=true for endpoints that have drifted beyond the accepted value, and for which the local time is out of sync compared with NTP servers.</p>
|
||
<section id="usage">
|
||
<h2>1 Usage</h2>
|
||
<p>timedrift can be called with empty parameters, and then only returns the local time of the target endpoint. When called with a drift parameter, NTP connections are established to evaluated the local time against network time.</p>
|
||
<pre><code class="json"><span class="p">{</span>
|
||
<span class="nt">"module"</span><span class="p">:</span> <span class="s2">"timedrift"</span><span class="p">,</span>
|
||
<span class="nt">"parameters"</span><span class="p">:</span> <span class="p">{</span>
|
||
<span class="nt">"drift"</span><span class="p">:</span> <span class="s2">"5s"</span>
|
||
<span class="p">}</span>
|
||
<span class="p">}</span></code></pre>
|
||
</section>
|
||
<section id="examples">
|
||
<h2>2 Examples</h2>
|
||
<section id="endpoint-non-compliant-with-a-10-millisecond-drift">
|
||
<h3>2.1 Endpoint non-compliant with a 10 millisecond drift</h3>
|
||
<p>Evaluating a 10ms drift is not useful, because the latency between the endpoint and the NTP servers is most likely greater than 10ms, and endpoint would always fail that test. But it illustrates the output from an endpoint that has drifted beyond the acceptable value.</p>
|
||
<pre><code class="">$ mig timedrift -t "name='somehost.example.net'" -show all -drift 10ms 2>/dev/null
|
||
stat: execution time 252.902127ms
|
||
somehost.example.net local time is 2015-03-14T13:26:27.441740604-04:00
|
||
somehost.example.net local time is out of sync from NTP servers
|
||
somehost.example.net Local time is ahead of ntp host 0.pool.ntp.org by 17.731324ms
|
||
somehost.example.net Local time is ahead of ntp host 1.pool.ntp.org by 16.542859ms
|
||
somehost.example.net Local time is ahead of ntp host 2.pool.ntp.org by 20.853337ms
|
||
somehost.example.net Local time is ahead of ntp host 3.pool.ntp.org by 33.743419ms
|
||
somehost.example.net stat: 0.pool.ntp.org responded in 44.26132ms with time 2015-03-14 17:26:27.473289999 +0000 UTC. local time drifts by 17.731324ms
|
||
somehost.example.net stat: 1.pool.ntp.org responded in 38.263502ms with time 2015-03-14 17:26:27.520487097 +0000 UTC. local time drifts by 16.542859ms
|
||
somehost.example.net stat: 2.pool.ntp.org responded in 46.682002ms with time 2015-03-14 17:26:27.576307275 +0000 UTC. local time drifts by 20.853337ms
|
||
somehost.example.net stat: 3.pool.ntp.org responded in 83.492232ms with time 2015-03-14 17:26:27.660943187 +0000 UTC. local time drifts by 33.743419ms
|
||
somehost.example.net command success</code></pre>
|
||
</section>
|
||
<section id="endpoint-compliant-with-a-5-seconds-drift">
|
||
<h3>2.2 Endpoint compliant with a 5 seconds drift</h3>
|
||
<pre><code class="">$ mig timedrift -t "name='somehost.example.net'" -show all -drift 5s 2>/dev/null
|
||
stat: execution time 1.76047894s
|
||
somehost.example.net local time is 2015-03-14T13:26:10.764244879-04:00
|
||
somehost.example.net local time is within acceptable drift from NTP servers
|
||
somehost.example.net stat: 0.pool.ntp.org responded in 44.574857ms with time 2015-03-14 17:26:10.996919999 +0000 UTC. local time drifts by 17.557879ms
|
||
somehost.example.net stat: 1.pool.ntp.org responded in 38.52106ms with time 2015-03-14 17:26:12.139883892 +0000 UTC. local time drifts by 16.917595ms
|
||
somehost.example.net stat: 2.pool.ntp.org responded in 46.79544ms with time 2015-03-14 17:26:12.38555022 +0000 UTC. local time drifts by 20.839501ms
|
||
somehost.example.net stat: 3.pool.ntp.org responded in 82.798078ms with time 2015-03-14 17:26:12.490975185 +0000 UTC. local time drifts by 33.808416ms
|
||
somehost.example.net command success</code></pre>
|
||
</section>
|
||
<section id="get-localtime-from-endpoint">
|
||
<h3>2.3 Get localtime from endpoint</h3>
|
||
<pre><code class="">$ mig timedrift -t "name='somehost.example.net'" 2>/dev/null
|
||
somehost.example.net local time is 2015-03-14T13:32:24.226318523-04:00</code></pre>
|
||
</section>
|
||
</section>
|
||
</body>
|
||
</html> |