1

I wrote an application that runs on Linux and uses ntpdate to query our NTP server. In some cases, ntpdate returns the error "no server suitable for synchronization found”. I need to be able to detect the same error on our Windows application. How can i achieve that using C# (my goal is to “fail” where ntpdate fails in order to align the behavior of my 2 applications)?

Found “How to Query an NTP Server using C#?”, but unfortunately it returns the time where ntpdate returns "no server suitable for synchronization found”. Also tried using windows commands: “w32tm /monitor /computers:ntp_server_ip” And “w32tm /stripchart /computer:ntp_server_ip /dataonly /samples:1” But i failed to understand from its output that there is an issue with the NTP server.

I have spent quite some time looking for an answer, but with no success.

Please assist.

Mishta
  • 51
  • 1
  • 3
  • This is a message from ntpdate. Seems that ntpdate interprets some data from the ntp server and creates this message. – H.G. Sandhagen Jun 14 '19 at 18:43
  • All domain-joined Windows computers will use the domain controller as an NTP source by default, so the windows machine likely really is configured to use NTP, and returning the time is the correct result. If you break NTP on the Windows server, it will return an error, too. – Joel Coehoorn Jun 14 '19 at 21:18

0 Answers0