Hi, Using the command of 'watch -n 1 tail -10 /var/log/ntp' I see that the ntp daemon only checks at certain intervals for a time server. Which ntp configuration file could I edit to shorten/lengthen the time between the ntp checks? The last check was at 07h29 and the time now is 08h24 and it hasn't checked inbetween. If this configuration is not available, what command could I issue to initiate an ntp time check against the internet ntp servers ie after I have enabled the net connection? I have tried to look at 'man ntp' but was pointed onto '/usr/share/doc/packages/xntp-doc' which doesn't exist on my system, I do however have a '/usr/share/packages/xntp/' folder. Entering this folder also did not provide me with the required 'xntp-doc' file. I figured no problem and searched Yast for both ntp and xntp-doc with both NOT returning the ntp-doc package I am looking for. Besides the web, which is unavailable at the moment courtesy of my ISP ADSL link, where can I find this document? If only available on the web, I guess tldp.org would have it but perhaps there is a more SUSE relevant link you can give me? Tnx -- #!/bin/bash echo "=================================================================" echo "Using unpatched SuSE 9.2 Professional with KDE and Mozilla 1.7.2" echo "Linux user # 229959 at http://counter.li.org" uptime echo "================================================================="
On Tue, 2006-10-31 at 08:25 +0200, Hylton Conacher(ZR1HPC) wrote:
Hi,
Using the command of 'watch -n 1 tail -10 /var/log/ntp' I see that the
Just an aside, you can also run: tail -f /var/log/ntp to see as stuff gets added to the file. Too bad I cannot answer the real question. -- Roger Oberholtzer OPQ Systems AB Ramböll Sverige AB Kapellgränd 7 P.O. Box 4205 SE-102 65 Stockholm, Sweden Tel: Int +46 8-615 60 20 Fax: Int +46 8-31 42 23
Roger Oberholtzer wrote:
On Tue, 2006-10-31 at 08:25 +0200, Hylton Conacher(ZR1HPC) wrote:
Hi,
Using the command of 'watch -n 1 tail -10 /var/log/ntp' I see that the
Just an aside, you can also run:
tail -f /var/log/ntp
to see as stuff gets added to the file. Too bad I cannot answer the real question.
42 ;-)
Hylton Conacher(ZR1HPC) wrote:
Hi,
Using the command of 'watch -n 1 tail -10 /var/log/ntp' I see that the ntp daemon only checks at certain intervals for a time server. Which ntp configuration file could I edit to shorten/lengthen the time between the ntp checks? The last check was at 07h29 and the time now is 08h24 and it hasn't checked inbetween.
If this configuration is not available, what command could I issue to initiate an ntp time check against the internet ntp servers ie after I have enabled the net connection?
I have tried to look at 'man ntp' but was pointed onto '/usr/share/doc/packages/xntp-doc' which doesn't exist on my system, I do however have a '/usr/share/packages/xntp/' folder. Entering this folder also did not provide me with the required 'xntp-doc' file. I figured no problem and searched Yast for both ntp and xntp-doc with both NOT returning the ntp-doc package I am looking for.
Besides the web, which is unavailable at the moment courtesy of my ISP ADSL link, where can I find this document? If only available on the web, I guess tldp.org would have it but perhaps there is a more SUSE relevant link you can give me?
Sorry, cannot answer the other questions but to check and correct the time, as root issue the following command in a terminal: ntpdate -u <IP-address-of-time-server> For example, in my case, I issue the command ntpdate -u 203.12.160.2 when I want to check for time accuracy. Cheers. -- I'm dangerous when I know what I'm doing.
Basil Chupin wrote:
Hylton Conacher(ZR1HPC) wrote:
Hi,
Using the command of 'watch -n 1 tail -10 /var/log/ntp' I see that the ntp daemon only checks at certain intervals for a time server. Which ntp configuration file could I edit to shorten/lengthen the time between the ntp checks? The last check was at 07h29 and the time now is 08h24 and it hasn't checked inbetween.
If this configuration is not available, what command could I issue to initiate an ntp time check against the internet ntp servers ie after I have enabled the net connection?
I have tried to look at 'man ntp' but was pointed onto '/usr/share/doc/packages/xntp-doc' which doesn't exist on my system, I do however have a '/usr/share/packages/xntp/' folder. Entering this folder also did not provide me with the required 'xntp-doc' file. I figured no problem and searched Yast for both ntp and xntp-doc with both NOT returning the ntp-doc package I am looking for.
Besides the web, which is unavailable at the moment courtesy of my ISP ADSL link, where can I find this document? If only available on the web, I guess tldp.org would have it but perhaps there is a more SUSE relevant link you can give me?
Sorry, cannot answer the other questions but to check and correct the time, as root issue the following command in a terminal:
ntpdate -u <IP-address-of-time-server>
For example, in my case, I issue the command ntpdate -u 203.12.160.2 when I want to check for time accuracy. Tnx Basil
On Monday 30 October 2006 21:25, Hylton Conacher(ZR1HPC) wrote:
Hi,
Using the command of 'watch -n 1 tail -10 /var/log/ntp' I see that the ntp daemon only checks at certain intervals for a time server. Which ntp configuration file could I edit to shorten/lengthen the time between the ntp checks? The last check was at 07h29 and the time now is 08h24 and it hasn't checked inbetween.
Why not just run the daemon and forget about it. It checks as often as it needs to keep the machine in sync. Put some (more than one) server in your /etc/ntp.conf such as server bigben.cac.washington.edu server ntp.alaska.edu server ntp.yourisp.com Then run insserv ntp rcntp start and forget about it. Its almost bullet proof. -- _____________________________________ John Andersen
On Monday 30 October 2006 21:25, Hylton Conacher(ZR1HPC) wrote:
Hi,
Using the command of 'watch -n 1 tail -10 /var/log/ntp' I see that the ntp daemon only checks at certain intervals for a time server. Which ntp configuration file could I edit to shorten/lengthen the time between the ntp checks? The last check was at 07h29 and the time now is 08h24 and it hasn't checked inbetween.
Why not just run the daemon and forget about it. It checks as often as it needs to keep the machine in sync. Umm, John... if /var/log/ntp exists on his system, then the daemon
On 31/10/06 00:55, John Andersen wrote: probably *is* already running :-)
On Monday 30 October 2006 23:29, Darryl Gregorash wrote:
Umm, John... if /var/log/ntp exists on his system, then the daemon probably *is* already running :-)
Maybe, but does it not also log there when run via cron and at boot up? -- _____________________________________ John Andersen
On 31/10/06 02:32, John Andersen wrote:
On Monday 30 October 2006 23:29, Darryl Gregorash wrote:
Umm, John... if /var/log/ntp exists on his system, then the daemon probably *is* already running :-)
Maybe, but does it not also log there when run via cron and at boot up?
I doubt if too many run the ntp daemon in a cron, unless it's run with the -q option; once it starts, it requires at least a kill -TERM to stop it. With the -q option, the daemon sets the time once, then exits (in which case, it makes far more sense to use ntpdate -- I doubt if that will ever be retired, no matter what the ntp documentation says). When the daemon is started from the boot script /etc/init.d/xntp, the initial output goes to syslog, as follows: Oct 19 15:23:06 static24-89-67-198 ntpdate[6770]: step time server 142.3.100.15 offset -0.491011 sec Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: ntpd 4.2.0a@1.1190-r Sat Mar 19 19:20:10 UTC 2005 (1) Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: precision = 3.000 usec Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: Listening on interface wildcard, 0.0.0.0#123 Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: Listening on interface wildcard, ::#123 Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: Listening on interface lo, 127.0.0.1#123 Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: Listening on interface eth0, 192.168.1.1#123 Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: Listening on interface eth1, 24.89.67.198#123 Oct 19 15:23:06 static24-89-67-198 ntpd[6775]: kernel time sync status 0040 Oct 19 15:23:07 static24-89-67-198 ntpd[6775]: frequency initialized 81.206 PPM from /var/lib/ntp/drift/ntp.drift The very first line logged to /var/log/ntp is an "event_restart", as follows: 19 Oct 15:23:07 ntpd[6775]: system event 'event_restart' (0x01) status 'sync_alarm, sync_unspec, 1 event, event_unspec' (0xc010) after which everything goes to /var/log/ntp (well, this assumes use of the "logfile" directive; otherwise, the syslog facility is used). Still, the way Hylton phrased his query strongly suggests a running daemon: "... I see that the ntp daemon only checks at certain intervals..."
On 31/10/06 00:25, Hylton Conacher(ZR1HPC) wrote:
... time between the ntp checks? The last check was at 07h29 and the time now is 08h24 and it hasn't checked inbetween.
I have tried to look at 'man ntp' but was pointed onto '/usr/share/doc/packages/xntp-doc' which doesn't exist on my system, I do however have a '/usr/share/packages/xntp/' folder. Entering this folder also did not provide me with the required 'xntp-doc' file. I figured no problem and searched Yast for both ntp and xntp-doc with both NOT returning the ntp-doc package I am looking for. /usr/share/doc/packages/xntp-doc/* in the xntp-doc package.
The out-of-the-box ntp config file *should* by default log all the information I mention here. If not, you'll need to edit the "logconfig" line in the ntp.conf file (see below), restart the daemon, and wait for sufficient data to be logged to be of any help. If you are only seeing lines in the ntp log file looking like this: 30 Oct 11:37:38 ntpd[6775]: offset 0.000365 sec freq 80.810 ppm error 0.003527 then you are only seeing the hourly log of the current clock stats. This information is logged irrespective of the actual poll events to the servers. Any lines indicating a problem reaching a particular server will look like this: 22 Oct 09:02:20 ntpd[6775]: peer 128.233.154.245 event 'event_unreach' (0x83) status 'unreach, conf, 2 events, event_unreach' (0x8023) The next time a valid poll does come in from the same server, you'll get this: 22 Oct 18:00:49 ntpd[6775]: peer 128.233.154.245 event 'event_reach' (0x84) status 'unreach, conf, 3 events, event_reach' (0x8034) Every time the daemon synchronizes to a different server, you get a line like this: 22 Oct 18:27:55 ntpd[6775]: synchronized to 128.233.154.245, stratum 1 If your system has an uptime of a few days or more, check for the most recent "synchronized to" line in the ntp log; that's probably the quickest way to tell if you're having a general problem polling your servers. You can also grep the ntp log for "event_unreach"; a lot of those really indicates a major problem. To get an idea of what is happening, as root, enter "ntpdc" at a command prompt to get to the ntpd console, then enter "peers" (without quotes) to get a listing of the current status. You'll see something like this: remote refid st t when poll reach delay offset jitter ============================================================================== LOCAL(0) LOCAL(0) 10 l 53 64 377 0.000 0.000 0.004 +sue.cc.uregina. 164.67.62.194 2 u 134 512 377 34.730 -9.169 23.238 -time4.cpsc.ucal 10.10.0.22 2 u 144 512 377 33.474 -6.741 1.068 *tick.usask.ca .GPS. 1 u 568 512 376 68.157 -0.509 0.411 -nss.nts.umn.edu 160.94.54.248 2 u 103 512 377 60.246 6.912 5.824 +br1.umtnet.umt. 204.123.2.5 2 u 27 512 377 62.520 -0.316 29.070 This says I am synchronized to tick.usask.ca, which is running at stratum 1, which was last successfully polled 568 seconds ago (with a maxpoll 9, it's somewhat overdue.. a successful poll actually occurred about 200 seconds later). The "poll" column indicates the current poll interval (which xntpd will adjust depending on how reliably a server can be reached), while the "reach" column gives a rough indication of the overall reliability of that server. Here, tick.usask.ca has a slightly reduced reliability, on account of the minor problem in reaching it. If you really are having problems with your server(s), then you'll need to edit the config file, /etc/ntp.conf. For the most part, you'll have to edit it manually, as Yast can only do very basic configuration of the server directives, and then only if you already know the options and how to use them. The basic server directive looks like this: server <server_name> [possible other stuff] maxpoll <integer> You should have a minimum of 3 servers in use, and these shouldn't be local to each other. If you need to find a server or two, you'll find plenty at http://ntp.isc.org/bin/view/Servers/WebHome (paragraph "Finding a Time Server"). Without the maxpoll option, <integer> defaults to 10, which is a power of 2, giving a maxpoll interval of 1024 seconds. With the maxpoll option, this can be set as high as 17, which is just over 36 hours. If your poll interval is controlled by a maxpoll directive, check for "maxpoll 12" or greater, which gives a maximum interval of 4096 seconds or more. Use a maxpoll value of 8 or 9 to see if things improve. (There is also a minpoll, which defaults to 6, or 64 sec, but can be set as low as 4, 16 seconds.) If you aren't getting the information I mentioned in your logfile, then you'll need to modify the "logconfig" directive, just change it to "logconfig =all" (without the quotes, with the space, and with the equals sign), and restart the daemon.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2006-10-31 at 08:25 +0200, Hylton Conacher(ZR1HPC) wrote:
Using the command of 'watch -n 1 tail -10 /var/log/ntp' I see that the
Use "tail -f /var/log/ntp" or "tailf /var/log/ntp" instead
ntp daemon only checks at certain intervals for a time server. Which ntp configuration file could I edit to shorten/lengthen the time between the ntp checks? The last check was at 07h29 and the time now is 08h24 and it hasn't checked inbetween.
No, that's the wrong conclussion. The fact that the daemon doesn't log anything doesn't mean that it hasn't checked the time in the interval. It may have done it hundreds of times for all you know. And you can not modify when ntp sees fit to check the time.
If this configuration is not available, what command could I issue to initiate an ntp time check against the internet ntp servers ie after I have enabled the net connection?
Do not use the ntp daemon unless your connection is permanent. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFFRyl9tTMYHG2NR9URAmnYAJ9rwWHhazTat5kkRlYKpYbLaKVl9QCffeuQ oXIgUX4mS46gyhPImuF4fpg= =HGLy -----END PGP SIGNATURE-----
On 31/10/06 04:46, Carlos E. R. wrote:
ntp daemon only checks at certain intervals for a time server. Which ntp configuration file could I edit to shorten/lengthen the time between the ntp checks? The last check was at 07h29 and the time now is 08h24 and it hasn't checked inbetween.
No, that's the wrong conclussion. The fact that the daemon doesn't log anything doesn't mean that it hasn't checked the time in the interval. It may have done it hundreds of times for all you know. The stuff that does go into the ntp logfile is actually pretty spartan when it comes to trying to determine what is happening with a particular server, unless one is willing to do a fair bit of digging (as I noted in my tome replying to Hylton's first post). Better would be to use the "statistics" and "filegen" directives, but I have only got those to work once, and I can't recall what made it work. It worked for awhile, then stopped after a re-install of the entire OS (when I changed hard drives). I'm sure I am still using identical directives, but I've never seen any statistics files show up since. The resultant files were definitely full of useful information when any problems arose connecting with a particular server. If anyone has a working statistics/filegen combination, I would definitely like to see the lines.
And you can not modify when ntp sees fit to check the time.
minpoll/maxpoll
If this configuration is not available, what command could I issue to initiate an ntp time check against the internet ntp servers ie after I have enabled the net connection?
Do not use the ntp daemon unless your connection is permanent.
ntpd -q does the same thing as ntpdate. See also my second note to John Anderson.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Tuesday 2006-10-31 at 05:55 -0600, Darryl Gregorash wrote:
Do not use the ntp daemon unless your connection is permanent.
ntpd -q does the same thing as ntpdate. See also my second note to John Anderson.
I now that. But instead, I use "rcntp ntptimeset", and I let SuSE decide which one to use. Suposedly ntpdate was going to be retired years ago, but it is still there. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFFR06+tTMYHG2NR9URAuilAKCEZ0CK7yNoGPnV2cKGdO1oCP3dZQCeIS5q VXdYc82mwIs5KYbzCAirUZ8= =TwRy -----END PGP SIGNATURE-----
On 31/10/06 07:25, Carlos E. R. wrote:
The Tuesday 2006-10-31 at 05:55 -0600, Darryl Gregorash wrote:
Do not use the ntp daemon unless your connection is permanent.
ntpd -q does the same thing as ntpdate. See also my second note to John Anderson.
I now that.
But instead, I use "rcntp ntptimeset", and I let SuSE decide which one to use. Suposedly ntpdate was going to be retired years ago, but it is still there.
It will be retired when it is retired, but that looks to me like it will only be some time in the infinite future (or after the sun leaves the main sequence, which amounts to about the same thing :-) ). For SuSE it won't be any kind of problem. For some time, they have stored executable names in variables, eg. in this case 'NTPDATE_BIN="/usr/sbin/ntpdate"' which greatly simplifies any changes to the package -- just change ntpdate to "ntpd -q" in one place, and it is done.
Carlos E. R. wrote:
The Tuesday 2006-10-31 at 08:25 +0200, Hylton Conacher(ZR1HPC) wrote:
Using the command of 'watch -n 1 tail -10 /var/log/ntp' I see that the
Use "tail -f /var/log/ntp" or "tailf /var/log/ntp" instead
I initially started with tail and tailf but I find that then the displayed log grows as each entry is added. With 'watch the cli I am using the displayed log is a max of 10 lines and it is updated every second. I actually prefer the 10 line version as I do not need to see the last 30 or so entries. Heck in theory I could change the 10 to a 1. :)
ntp daemon only checks at certain intervals for a time server. Which ntp configuration file could I edit to shorten/lengthen the time between the ntp checks? The last check was at 07h29 and the time now is 08h24 and it hasn't checked inbetween.
No, that's the wrong conclussion.
The fact that the daemon doesn't log anything doesn't mean that it hasn't checked the time in the interval. It may have done it hundreds of times for all you know.
And you can not modify when ntp sees fit to check the time. This ^^^^ answers my question about changing its frequency between updates.
If this configuration is not available, what command could I issue to initiate an ntp time check against the internet ntp servers ie after I have enabled the net connection?
Do not use the ntp daemon unless your connection is permanent. I hear you however I do have an ADSL cnx. I am a very cautious person and I shut the machine down each night mainly due to unreliable power. When I start the machine in the morning, I leave kinternet connected so
:( that the ntp daemon can sync. When I see it has I 'hang-up' on kinternet. Tnx Carlos
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Wednesday 2006-11-01 at 16:55 +0200, Hylton Conacher(ZR1HPC) wrote:
Using the command of 'watch -n 1 tail -10 /var/log/ntp' I see that the
Use "tail -f /var/log/ntp" or "tailf /var/log/ntp" instead I initially started with tail and tailf but I find that then the displayed log grows as each entry is added. With 'watch the cli I am using the displayed log is a max of 10 lines and it is updated every second.
So what? The excess text flow up out of sight. Only if you need it, you can browse back, and some terminals let you customize how much back goes the buffer. And, the watch command causes disk and cpu activity.
And you can not modify when ntp sees fit to check the time. This ^^^^ answers my question about changing its frequency between updates.
Actually, you can somewhat, it is on the docs somewhere. But you _really_ do not need to do it. You need much deeper understanding of how ntp works internally before changing those parameter with hope of improving the defaults. It checks much more often that the log apears to show.
If this configuration is not available, what command could I issue to initiate an ntp time check against the internet ntp servers ie after I have enabled the net connection?
Do not use the ntp daemon unless your connection is permanent. I hear you however I do have an ADSL cnx. I am a very cautious person and I shut the machine down each night mainly due to unreliable power. When I start the machine in the morning, I leave kinternet connected so that the ntp daemon can sync. When I see it has I 'hang-up' on kinternet.
If you hang-up kinternet, you break ntp. As you have adsl, leave the connection up for as long as your computer is powered up. Actually, do whatever needs to be done so that you do not need to login to connect. ntp is designed to be working continuosly. If it has no connection it will fail its purpose. When you power off the computer it will be stopped, that's fine. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFFSMWztTMYHG2NR9URAhCmAJ4op5ZU8ZxLJ5QQ/NBVTAK3l9Pu6gCfXfsL OVWkkhfJBEWJOtOAlV0jHbs= =mrBa -----END PGP SIGNATURE-----
On Tuesday 31 October 2006 07:25, Hylton Conacher(ZR1HPC) wrote:
Hi,
Using the command of 'watch -n 1 tail -10 /var/log/ntp' I see that the ntp daemon only checks at certain intervals for a time server. Which ntp configuration file could I edit to shorten/lengthen the time between the ntp checks? The last check was at 07h29 and the time now is 08h24 and it hasn't checked inbetween.
If your clock is so bad, I'd suggest returning the hardware to the store, because if it drifts so much in just an hour, it's ready for the dust bin
participants (8)
-
Anders Johansson
-
Basil Chupin
-
Carlos E. R.
-
Darryl Gregorash
-
Hylton Conacher(ZR1HPC)
-
James Knott
-
John Andersen
-
Roger Oberholtzer