Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: NTP Server Logs

  1. #1
    Join Date
    Nov 2012
    Beans
    8

    NTP Server Logs

    Hi,
    i am using a Ubuntu Server as a NTP Server, it's working very well, the clock is synchronised.
    now i am trying to activate Logs so i can see "Clients" that synchronize with my server.

    i added two lines to my config :
    ---------------------------
    logfile /var/log/ntpd.log
    statsdir /var/log/ntpstats/
    ---------------------------

    the second one : "statsdir" give informations just about external servers with whom my server synchronize it's clock, it's not the informations i am seeking

    even after restarting my daemon, when i check the "/var/log" directory i cannot find the file ntpd.log, i wonder why ?
    is it the correct line to add to activate logs ?
    such file /var/log/ntpd.log, will it contain informations about NTP clients ?

    Thank you so much

  2. #2
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,935
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: NTP Server Logs

    By default ntpd will log to /var/log/syslog. Unless you need to route the NTP entries to a separate file, just use the default. You can always extract the ntpd entries with "grep ntp /var/log/syslog".
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Nov 2012
    Beans
    8

    Re: NTP Server Logs

    thanks for your reply, however it doesnt work

    i synchronized 2 servers (A & B) with my NTP server successfully, then i entered the command " cat /var/log/syslog | grep @IP-Srv-A/B" and i got nothing displayed

    same thing with " cat /var/log/syslog | grep ntp" there is some ntpd entries like "Jun 20 12:14:56 srvntp ntpd[40621]:......" but no trace about the NTP clients

    my main goal is having the list of all the NTP clients that synchronize with my server

    any hint ?

    Thanks

  4. #4
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,935
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: NTP Server Logs

    You can log the requests with iptables:

    Code:
    /sbin/iptables -A INPUT -p udp --dport 123 -j LOG
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  5. #5
    Join Date
    Nov 2012
    Beans
    8

    Re: NTP Server Logs

    Thanks a lot

    now i can see the entries in syslog "cat syslog | grep DPT=123"
    but the logs are firewall logs, there is no indication about what have been done in NTP, the synchronization is it ok ? any error ? difference between the 2 clocks ....

    so it's basically just a way to be sure that the client has contacted the server, nothing else.
    well, it's a significant information, but is there anyway to have more details ?

    I apologize for the inconvenience

    Thanks

  6. #6
    Join Date
    Sep 2006
    Beans
    7,472
    Distro
    Lubuntu Development Release

    Re: NTP Server Logs

    Syslog will give you the most details.

    You can use grep directly on the logs to look for ntpd activity such as synchronization:

    Code:
    grep ntpd /var/log/syslog
    grep ntpd /var/log/syslog.1
    That use of grep will get any lines that even mention ntpd, such as use of apparmor, and things with the string 'ntpd' like ntpdate

  7. #7
    Join Date
    Nov 2012
    Beans
    8

    Re: NTP Server Logs

    sorry but there is no information about the NTP clients in the syslog
    just some information about the daemon nothing else

  8. #8
    Join Date
    Sep 2006
    Beans
    7,472
    Distro
    Lubuntu Development Release

    Re: NTP Server Logs

    Did you also look in the previous log, /var/log/syslog.1 ? If syslog is very fresh there might not be ntpd data in it.

  9. #9
    Join Date
    Nov 2012
    Beans
    8

    Re: NTP Server Logs

    yes done it, but still no results

    in addition before each check on the logs i try to resynchronize my servers to be sure that there is a communication to be logged

    it appear that the log of the NTP server contain just information about the daemon, the NTP server doens't log entries about NTP clients

    is there any expert here to confirm this observation ?

    Thanks

  10. #10
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,935
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: NTP Server Logs

    Yes, it only logs daemon activity. (Perhaps you are not seeing the results in the log because you still have the logfile setting in ntp.conf?) To see the clients use the iptables rule I gave you above.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •