<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic NTP Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897515#M820309</link>
    <description>I am trying to write a script that will check all of the hosts in my environment to see if any of them have the time out of sync with our NTP time server. In addition, if any hosts are out of sync, I want to generate a message for ITO. Has anyone done (any part of) this sort of thing? &lt;BR /&gt;&lt;BR /&gt;thanks, &lt;BR /&gt;sam</description>
    <pubDate>Wed, 05 Feb 2003 15:45:07 GMT</pubDate>
    <dc:creator>Sam  Lalonde</dc:creator>
    <dc:date>2003-02-05T15:45:07Z</dc:date>
    <item>
      <title>NTP Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897515#M820309</link>
      <description>I am trying to write a script that will check all of the hosts in my environment to see if any of them have the time out of sync with our NTP time server. In addition, if any hosts are out of sync, I want to generate a message for ITO. Has anyone done (any part of) this sort of thing? &lt;BR /&gt;&lt;BR /&gt;thanks, &lt;BR /&gt;sam</description>
      <pubDate>Wed, 05 Feb 2003 15:45:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897515#M820309</guid>
      <dc:creator>Sam  Lalonde</dc:creator>
      <dc:date>2003-02-05T15:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: NTP Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897516#M820310</link>
      <description>If you have set up NTP correctly than any slight differences would be corrected  using the driftfile, thus keeping time in sync.&lt;BR /&gt;&lt;BR /&gt;Rgrds,&lt;BR /&gt;Rita&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Feb 2003 16:01:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897516#M820310</guid>
      <dc:creator>Rita C Workman</dc:creator>
      <dc:date>2003-02-05T16:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: NTP Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897517#M820311</link>
      <description>Kind of along the lines Rita mentioned, why the redundancy?  NTP is supposed to keep time balanced, but with some tolerance for drift.  &lt;BR /&gt;&lt;BR /&gt;I would think it more pertinant to have local scripts to ensure that ntp client services are running and restart if necessary.&lt;BR /&gt;&lt;BR /&gt;Just my 2 cents though.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Shannon</description>
      <pubDate>Wed, 05 Feb 2003 16:07:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897517#M820311</guid>
      <dc:creator>Shannon Petry</dc:creator>
      <dc:date>2003-02-05T16:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: NTP Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897518#M820312</link>
      <description>As Rita mentionned, any time difference should be corrected if you have set up your NTP with a driftfile.  You can look in /etc/rc.config.d/netdaemons to set up your NTP time sync and in /etc/ntp.conf to set up your drift file. &lt;BR /&gt;&lt;BR /&gt;As far as ITO is concerned, I am not exactly sure how our ITO is set up exactly, but it does pick up NTP problems automatically.  So if it ever loses connection with our main time server, it reports a message.  And I know that I didn't set up anything within NTP to do that, so it must be ITO.</description>
      <pubDate>Wed, 05 Feb 2003 16:10:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897518#M820312</guid>
      <dc:creator>Marco Santerre</dc:creator>
      <dc:date>2003-02-05T16:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: NTP Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897519#M820313</link>
      <description>fairly easy&lt;BR /&gt;&lt;BR /&gt;either have a list of machines in a loop on the ntp server or on each machine&lt;BR /&gt;&lt;BR /&gt;telnet ntp-server daytime;date&lt;BR /&gt;&lt;BR /&gt;and compare the results</description>
      <pubDate>Wed, 05 Feb 2003 16:26:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897519#M820313</guid>
      <dc:creator>John Bolene</dc:creator>
      <dc:date>2003-02-05T16:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: NTP Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897520#M820314</link>
      <description>Either:&lt;BR /&gt; . schedule on each system&lt;BR /&gt;or&lt;BR /&gt; . have a list of machines and do remotely&lt;BR /&gt;&lt;BR /&gt;the following:&lt;BR /&gt;&lt;BR /&gt;/usr/sbin/ntpq -p&lt;BR /&gt;&lt;BR /&gt;This shows whether the system is in sync with its servers and/or peers.&lt;BR /&gt;&lt;BR /&gt;An '*' in the state column (1st character) says "synced".&lt;BR /&gt;&lt;BR /&gt;bv</description>
      <pubDate>Thu, 06 Feb 2003 13:11:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897520#M820314</guid>
      <dc:creator>Bob_Vance</dc:creator>
      <dc:date>2003-02-06T13:11:34Z</dc:date>
    </item>
    <item>
      <title>Re: NTP Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897521#M820315</link>
      <description>BTW, another little trick that I often use is:&lt;BR /&gt;&lt;BR /&gt;(on one command line)&lt;BR /&gt;&lt;BR /&gt;  golf ## remsh ntp-server -l rb date ; date                &lt;BR /&gt; Thu Feb  6 08:22:52 EST 2003&lt;BR /&gt; Thu Feb  6 08:22:52 EST 2003&lt;BR /&gt;&lt;BR /&gt;If the two times come back the same or within one second, then you're fairly (but only fairly ;&amp;gt;) sure that things are working, at least to within the network delay.&lt;BR /&gt;&lt;BR /&gt;bv&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Feb 2003 13:36:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897521#M820315</guid>
      <dc:creator>Bob_Vance</dc:creator>
      <dc:date>2003-02-06T13:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: NTP Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897522#M820316</link>
      <description>I am writing one in Perl myself - but it is not completed.  I will post it when it is complete.&lt;BR /&gt;&lt;BR /&gt;I am using the remote capabilities of ntp to provide me the answers.&lt;BR /&gt;&lt;BR /&gt;ntpq -p &lt;REMOTE server="" name=""&gt;&lt;BR /&gt;&lt;BR /&gt;The big bonus is that you don't need rsh, ssh or other rights to run your test&lt;G&gt;!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;You'll either get back:&lt;BR /&gt;no answer,&lt;BR /&gt;&lt;BR /&gt;Permission denied&lt;BR /&gt;&lt;BR /&gt;or NTP data and stats.&lt;BR /&gt;&lt;BR /&gt;If you get correct data, then parse for an entry starting with an asterisk.  If there is one, you are synchronized to some NTP host somewhere.  Of course, you could filter to known hosts, confirming you are properly synchronizing to the right places.&lt;BR /&gt;&lt;BR /&gt;Since I am a Perl newbie, this could take a bit of time. (I opted to use perl to force myself to learn it.)&lt;BR /&gt;&lt;BR /&gt;kinney@crd.ge.com&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/G&gt;&lt;/REMOTE&gt;</description>
      <pubDate>Thu, 06 Feb 2003 13:50:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897522#M820316</guid>
      <dc:creator>Brian Kinney</dc:creator>
      <dc:date>2003-02-06T13:50:57Z</dc:date>
    </item>
    <item>
      <title>Re: NTP Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897523#M820317</link>
      <description>NTP on each client will log problems in syslog.log, so I would setup a rule for ITO to look at syslog.log rather than creating a separate process. NTP is extremely sophisticated (much more so than remsh/date and will keep clients within 128ms accuracy or better. Adjustments are very slow and never miss a second, and the only problem with NTP is a naive sysadmin that runs the date command to set the timne-of-day to some wall clock. I would wrapper the date command for root so any attempt to change the date creates a warning and logs (emails) the attempt. Database corruption, especially between different machines, is a consequence of changing the time manually.</description>
      <pubDate>Thu, 06 Feb 2003 13:57:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897523#M820317</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-02-06T13:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: NTP Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897524#M820318</link>
      <description>this is what i use&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;### Date check script, run only in cron&lt;BR /&gt;SHOUR=`/usr/bin/date +%H`&lt;BR /&gt;SMIN=`/usr/bin/date +%M`&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;for x in `cat /fileofservers`&lt;BR /&gt;do&lt;BR /&gt;CHOUR=`remsh $x "/usr/bin/date +%H"`&lt;BR /&gt;CMIN=`remsh $x "/usr/bin/date +%M"`&lt;BR /&gt;&lt;BR /&gt;if [[ $SHOUR -ne $CHOUR  ]]&lt;BR /&gt;then&lt;BR /&gt;opcmsg severity=major application=time object=hours msg_t="The time value in hours is incorrect" node=$x&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;if [[ $SMIN -ne $CMIN ]]&lt;BR /&gt;then&lt;BR /&gt;opcmsg severity=minor application=time object=hours msg_t="The time value in minutes is incorrect" node=$x&lt;BR /&gt;&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;set this to run in your cron so it begins at the turn of a new min, as long as you do not have 30 or more servers it should never run more then a minute ... (not withstanding over utilization of the processors)&lt;BR /&gt;&lt;BR /&gt;configure ITO/OPO to handle this acrodingly&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Feb 2003 16:30:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ntp-script/m-p/2897524#M820318</guid>
      <dc:creator>James Odak</dc:creator>
      <dc:date>2003-02-06T16:30:52Z</dc:date>
    </item>
  </channel>
</rss>

