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.