[ntp:questions] howto read ntpq output directly?

mayer at gis.net mayer at gis.net
Mon Mar 21 17:41:30 UTC 2005

----- Original Message Follows -----
> hello there.
> i have a network of machines that are synchronized by ntpd.
> i would like to read the output of nptq -c peer directly from
> my c source code (specifically, i would like to read the tallycode
> to know if the machines are synced). one ugly way is to
> system("ntpq -c peer > somefile"), and do some parsing on the output
> file (looking for * and such). does any of you masters of global
> time know of a cleaner way to do that?
> greatly appreciate your oncoming help,
> avishai.

Take the source code for ntpq and modify it to be a callable interface
to get what you want. If you do this we'd appreciate it if you can
contribute this back so we can incorporate it in out source code and
take advantage of it. Right now it's not very modular.


More information about the questions mailing list