Operating System - HP-UX
1758582 Members
2011 Online
108872 Solutions
New Discussion юеВ

ntp on HPUX 11 workstation

 

ntp on HPUX 11 workstation

We have an HPUX 11 workstation that is connected to our network. I need to configure it to get the time from the ntp server, which I have the IP for.

Is there any simple way to configure this machine to be just a client and get the time from that one server?

Thanks!
12 REPLIES 12
melvyn burnard
Honored Contributor

Re: ntp on HPUX 11 workstation

yes, use SAM
Select TIME (last entrry I think)
and then
NTP Network Time Sources

My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Mancboy
Valued Contributor

Re: ntp on HPUX 11 workstation

1) Use SAM
or
2) edit the files by hand:
2.1) edit /etc/rc.config.d/netdaemons
ensure XNTPD is set to 1
2.1) edit /etc/ntp.conf
put your time server on a line prefixed with server and suffixed with prefer
eg server IP_ADDRESS_OF_TIME_SERVER prefer
2.2) ensure there is a line "broadcastclient" /etc/ntp.conf
2.3) ensure there is a line "driftfile /etc/ntp.drift" in /etc/ntp.conf

then /sbin/init.d/xntpd start
spex
Honored Contributor

Re: ntp on HPUX 11 workstation

Hi George,

15 05 * * * /usr/sbin/ntpdate timeserver

An advantage to syncing via a cronjob is that xntpd doesn't need to run in the background. Of course, on the flip side, you will only sync as often as the job is scheduled to execute. If your workstation's clock has minimal drift, this method should work for you.

PCS
IT_2007
Honored Contributor

Re: ntp on HPUX 11 workstation

you can add ntp IP address in /etc/ntp.conf

server

change from "0" to "1" in /etc/rc.config.d/netdaemons

export XNTPD=1

/sbin/init.d/xntpd start

to check ntp settings..

ntpq -p


Bill Hassell
Honored Contributor

Re: ntp on HPUX 11 workstation

Actually, SAM is just a bitt too simple to get everything right. Before you start, make sure yuou can reach the NTP server:

ntpq -p ntp-server-or-IP

If you don't get a listing of the time servers inside this box along with a bunch of numbers, then you'll have to enable NTP traffic through your router and/or firewall. The port is 123.

If ntpq works OK, then replace the /etc/ntp.conf file with just these lines:

server your_ntp_server
driftfile /etc/ntp.drift

Then create the driftfile:

touch /etc/ntp.drift

Now verify that your local timezone is correct. The $TZ value is translating the GMT (Zulu or UTC) time into your local time. Edit the file: /etc/rc.config.d/netdaemons and find the two lines:

export NTPDATE_SERVER=your_ntp_server
export XNTPD=1

Now you need to adjust the time to match the server. There are two ways to do this:

1. If the time is within 5 minutes of correct time, you can run xntpd which will start 'slewing' the clock towards the correct time. This will not affect any applications as all seconds will be accounted for. An alternative is to use the date -a option but this requires you to monitor the time and manually start xntpd once date is finished.

2. Force the time to 'jump' to the correct value. Before you do that, verify that no applications are running that may be affected by a change in time. To jump the time, just use the start/stop script:

/sbin/init.d/xntpd start

The alternative (safest) way is to reboot which will run the xntpd script as part of startup. Bdefore xntpd is started, the time is jumped to the server's current time, long before any apps are started.

Once xntpd is started, monitor the time sync with ntpq -p with no server name. ntpq will report on your local server and it's accuracy. Also check syslog.log for any errors.

xmtpd will keep your workstation within 128ms of the NTP server's time. Note that your NTP server should have multiple sources for timesync to handle possible problems.


Bill Hassell, sysadmin

Re: ntp on HPUX 11 workstation

Thanks.

When I run ntpq -p I get the following:

ntpq: connect: no route to host

Do i need to contact our network guys because it's a network thing, or is this still a config issue?
IT_2007
Honored Contributor

Re: ntp on HPUX 11 workstation

Can you ping IP address?
Sp4admin
Trusted Contributor

Re: ntp on HPUX 11 workstation

Hi,

You can use SAM to configure NTP or configure with /etc/ntp.conf file.

But I would follow Bill's advice.

sp,
Bill Hassell
Honored Contributor

Re: ntp on HPUX 11 workstation

You wrote:

> When I run ntpq -p I get the following:

> ntpq: connect: no route to host

> Do i need to contact our network guys because it's a network thing, or is this still a config issue?

Definitely a network issue. ntpq doesn't need any configuration at all. Now if the NTP server is internal to your network, then the IP address is likely unreachable - try ping and telnet (assuming telnet is enabled on the NTP server). If the NTP server is on the open Internet, then almost all default configs for firewalls/routers is to block port 123. Again, a network admin task.

If the server is on the open Internet and not a local corporate NTP server, ALWAYS specify a minimum of 3 to 5 servers and take advantage of the NTP pool. Here's a couple of open NTP servers plus the NTP server pool:

server time.nist.gov
server rolex.usg.edu
server 2.north-america.pool.ntp.org

(for information on the NTP server pool, see http://www.pool.ntp.org/ )

Each one you choose must reply to the ntpq -p command as in:

ntpq -p server time.nist.gov
ntpq -p server rolex.usg.edu
ntpq -p server 0.north-america.pool.ntp.org

Once you can reach the servers, follow the details above.

Now if you have more than one computer in your company, 100% of all computers and network appliances (firewalls, routers, web servers, PC servers, smart UPS boxes, network monitoring boxes, etc) must also use NTP. This is more of a network architect's job, but you do need a couple of servers internally which then provide time service to all your other systems. You don't want each bnox going out to the Internet servers. That is the concept of NTP stratums (see http://www.ntp.org for details).


Bill Hassell, sysadmin