[ntp:questions] Reference Clock driver for getting time via "date" command over telnet?

Movis ben at internetaddress.com
Wed Apr 21 11:09:43 UTC 2010


For reasons outside my control, I wish to configure ntpd on Red Hat to
use as the refclock a time obtained by repeatedly telnetting to a
remote machine and using the "date" command.

In other words, I will have a string from a script which would then be
given to my local ntp server as the reference clock. I do not have the
option of opening a port forwarding tunnel or vpn over which to use
ntp between these two servers.

My first thoughts centre on some kind of virtual serial device into
which I could pipe / echo a formatted string containing that date
output along with the local clock time to emulate a clock, and
configuring ntp to use that virtual serial device as its refclock.
However, I do not know how to construct something like that in linux.

My programming experience is next to nothing and I would prefer to
achieve this using some scripting method.

I know it's a fudge and it doesn't take into account the variable time
it would take to execute the date command, or for network delays.
However, this would be infinitely better than nothing, and telnet it
is the only mechanism by which I can communicate, in this instance to
the remote machine.

Could anyone help me put something together which ntpd would accept as
a clock source?

Thanks in advance,


More information about the questions mailing list