<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Cain Manor &#187; time</title> <atom:link href="http://cainmanor.com/tag/time/feed/" rel="self" type="application/rss+xml" /><link>http://cainmanor.com</link> <description>Your Guide To All Things Cain™</description> <lastBuildDate>Thu, 17 May 2012 19:43:34 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>Various Time Scripts</title><link>http://cainmanor.com/tech/unix/various-time-scripts/</link> <comments>http://cainmanor.com/tech/unix/various-time-scripts/#comments</comments> <pubDate>Wed, 01 Apr 2009 22:40:40 +0000</pubDate> <dc:creator>Greg Cain</dc:creator> <category><![CDATA[UNIX]]></category> <category><![CDATA[CentOS]]></category> <category><![CDATA[NTP]]></category> <category><![CDATA[time]]></category><guid
isPermaLink="false">http://cainmanor.com/tech/unix/various-time-scripts</guid> <description><![CDATA[To see the offset for a range of system for X in `cat YourList.txt` do Y=`ssh $X -l root 'ntpdate -q 10.168.XX.XX' &#124; awk -F, '{print $3}'` echo $X $Y done Your output HOST1 offset 0.007304 HOST2 offset 0.044396 HOST3 offset 0.038323 HOST4 offset 274.636170 HOST5 offset 189.366374 To see how far your servers are [...]]]></description> <content:encoded><![CDATA[<p>To see the offset for a range of system</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> X <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> YourList.txt<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #007800;">Y</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$X</span> <span style="color: #660033;">-l</span> root <span style="color: #ff0000;">'ntpdate -q 10.168.XX.XX'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> -F, <span style="color: #ff0000;">'{print $3}'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$X</span> <span style="color: #007800;">$Y</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div><p><span
id="more-539"></span><br
/> Your output</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">HOST1 offset <span style="color: #000000;">0.007304</span>
HOST2 offset <span style="color: #000000;">0.044396</span>
HOST3 offset <span style="color: #000000;">0.038323</span>
HOST4 offset <span style="color: #000000;">274.636170</span>
HOST5 offset <span style="color: #000000;">189.366374</span></pre></div></div><p>To see how far your servers are from the NTP source</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> X <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> YourList.txt<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #007800;">Y</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$X</span> <span style="color: #660033;">-l</span> root <span style="color: #ff0000;">'ntpdc -c loopinfo'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> offset<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$X</span> <span style="color: #007800;">$Y</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></div></div><p>Output</p><div
class="wp_syntax"><div
class="code"><pre class="bash" style="font-family:monospace;">HOST1 offset: <span style="color: #000000;">0.009959</span> s
HOST2 offset: <span style="color: #000000;">0.042295</span> s
HOST3 offset: <span style="color: #000000;">0.038320</span> s
HOST4 offset: <span style="color: #000000;">0.000000</span> s
HOST5 offset: <span style="color: #000000;">0.000000</span> s</pre></div></div><p>0.000000 s means you haven&#8217;t picked up an authoritative time source yet.</p> ]]></content:encoded> <wfw:commentRss>http://cainmanor.com/tech/unix/various-time-scripts/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 3/5 queries in 0.002 seconds using disk: basic
Object Caching 221/221 objects using disk: basic

Served from: cainmanor.com @ 2012-05-21 20:05:08 -->
