[ntp:questions] ntp.conf

Dennis Hilberg Jr dont at spam.me
Tue Aug 21 16:06:36 UTC 2007


Aggie wrote:
> Dear all,
> 
> Here's what I want to do. I want to change the clock on my client
> machine will automatically adjust when I change the clock on my server
> machine. And I also want to record the statistics.
> 
> Here's what I did: I use an ethernet cable connect directly between
> these two machine. And I'm not connecting any of these machine to the
> internet.  Then I downloaded and installed NTP on both machine and
> modify the ntp.conf
> 
> On my server, ntp.conf:
> driftfile "C:\Program Files\NTP\etc\ntp.drift"
> server 127.127.1.0 prefer minpoll 4 maxpoll 4
> fudge 127.127.1.0 stratum 0 refid LCL
> 
> On my client, ntp.conf:
> driftfile "C:\Program Files\NTP\etc\ntp.drift"
> server 192.168.1.2 perfer minpoll 4 maxpoll 4
> 
> Result: It works as what i expect. The client adjust its own clock and
> syn to the server clock.
> 
> Here's the problem:
> I don't know how to record statistics
> 
> I'm trying to record some statistic by modifying the ntp.conf file, so
> I added the following lines to the ntp.conf file on client machine:
> 
> enable stats
> statistics clockstats peerstats loopstats rawstats sysstats
> statsdir "C:\Program Files\NTP\etc\"
> 
> filegen loopstats file loopstats.txt type day enable
> filegen sysstats file sysstats.txt type day enable
> filegen loopstats file loopstats type day link enable
> filegen sysstats file sysstats.txt type day link enable
> 
> Did i do anything wrong?? Should i add the same lines on server
> machine? Thank you for the help in advance.
> 

With that ntp.conf you're only generating stats for loopstats and peerstats. 
  This is probably what you want:

enable stats
statistics clockstats peerstats loopstats rawstats sysstats
statsdir "C:\Program Files\NTP\etc\"

filegen clockstats file clockstats.txt type day enable
filegen peerstats file peerstats.txt type day enable
filegen loopstats file loopstats.txt type day enable
filegen rawstats file rawstats.txt type day enable
filegen sysstats file sysstats.txt type day enable

Also, make sure ntpd has write access to its statsdir.

-- 
Dennis Hilberg Jr <timekeeper(at)dennishilberg(dot)com>

NTP Server Information: http://saturn.dennishilberg.com/ntp.php




More information about the questions mailing list