[ntp:questions] Getting the version string programmatically ...

Terje Mathisen Terje.Mathisen at tmsw.no
Thu Dec 17 09:13:59 UTC 2009


David J Taylor wrote:
> The command:
>
> ntpq -c rv
>
> returns a set of data, including the version of NTP in the format:
>
> version="ntpd 4.2.6-o"
>
> I would like to retrieve the same information (just the version field)
> using a UDP interchange with the server rather than running the ntpq
> command. Could anyone advise what the packet I send to the server should
> contain, and what I might get back? Perhaps if you could point me to the
> right Web page, please?

"Use the Source", David!

I.e. just grab the ntpq source code and rip out what you need.

Terje
-- 
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"




More information about the questions mailing list