Operating System - HP-UX
1832928 Members
2651 Online
110048 Solutions
New Discussion

Re: How to verify server clock...?

 
SOLVED
Go to solution
praveen..
Super Advisor

How to verify server clock...?

Hi,
I got a request from my client to check the server clock of 5 servers...

server1# date
Thu Dec 21 00:31:53 CST 2006

server2# date
Thu Dec 21 00:34:02 CST 2006

server3# date
Thu Dec 21 00:41:08 CST 2006

server4# date
Thu Dec 21 00:41:15 CST 2006

server5# date
Thu Dec 21 00:41:16 CST 2006


all the servers are physically together..
so why the time difference...

does i need to check the ntp service, if yes, how can i do it...?

Please suggest
thanks

10 REPLIES 10
Dennis Handly
Acclaimed Contributor

Re: How to verify server clock...?

Peter Godron
Honored Contributor

Re: How to verify server clock...?

Praveen,
I shedule a cron for root:
00 08 * * * /usr/sbin/ntpdate -u >>/var/log/ntpdate.log

where ntpserver is the name of your companys ntpserver.

See "man ntpdate"
Sunil Sharma_1
Honored Contributor

Re: How to verify server clock...?

Praveen,

It's quite possible that server clocks are not in sync for some servers. Even HP accept to have some minor difference in two servers clock you set on same time. You can configure NTP service to have the same and consistence time in all servers.

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***
praveen..
Super Advisor

Re: How to verify server clock...?

these are the details:



NTP Network Time Sources:



Host Name Relationship Preferred NTP Authentication Server Current Time

or Address to Local Host Server? Version Key Number



170.108.110.50 server Yes 3 server1 Thu Dec 21 00:31:53 CST 2006

170.108.110.50 server Yes 3 server2 Thu Dec 21 00:34:02 CST 2006

170.108.110.50 server Yes 3 server3 Thu Dec 21 00:41:08 CST 2006

170.108.25.100 server Yes 3 server4 Thu Dec 21 00:41:15 CST 2006

170.108.25.100 server Yes 3 server5 Thu Dec 21 00:41:16 CST 2006



Please suggest
Bill Hassell
Honored Contributor

Re: How to verify server clock...?

If all your servers have NTP setup then something (a router or firewall) is blocking NTP queries, or the xntpd service is not running. Start by checking each server for xntpd:

UNIX95=1 ps -f -C xntpd

If it is running, then check that the NTP servers can be contacted:

ntpq -p

This command shows the NTP server used by this machine. You should get several lines of output. If not, NTP is blocked. Aloso grep for ntp in syslog:

grep -i ntp /var/adm/syslog/syslog.log


Bill Hassell, sysadmin
George Liu_4
Trusted Contributor

Re: How to verify server clock...?

make one as ntp server and others use that system as a ntp server
praveen..
Super Advisor

Re: How to verify server clock...?

hostname_server# UNIX95=1 ps -f -C xntpd
UID PID PPID C STIME TTY TIME CMD
root 2283 1 0 Nov 5 ? 05:06 /usr/sbin/xntpd

hostname_server# ps -ef | grep -i xntpd
root 2283 1 0 Nov 5 ? 5:06 /usr/sbin/xntpd
root 3875 3852 1 02:11:46 pts/1 0:00 grep -i xntpd

hostname_server# ntpq -p
remote refid st t when poll reach delay offset disp
==============================================================================
#inforesdc0.info .LOCL. 1 u 481 512 377 0.84 -7.844 6.48

hostname_server#
Peter Nikitka
Honored Contributor

Re: How to verify server clock...?

Hi,

you'll have to check the xntp setup of your servers. Check /etc/ntp.conf:

awk 'NF && ! /#/' /etc/ntp.conf

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
praveen..
Super Advisor

Re: How to verify server clock...?

which parameter should i check in /etc/ntp.conf file.


Thanks
Peter Nikitka
Honored Contributor
Solution

Re: How to verify server clock...?

Hi,

my servers request ntp updates from another one (which has permission to enter/cross the DMZ/firewall). These are the effective contents of ntp.conf.

standard server:
root@hpats5[201] awk 'NF && ! /^#/' /etc/ntp.conf
server 12.34.56.78 version 3 prefer
broadcastclient yes

server synched to firewall (12.34.56.78):
awk 'NF && ! /^#/' /etc/ntp.conf
server 127.127.1.0 # local clock (LCL)
fudge 127.127.1.0 stratum 10 # LCL is unsynchronized
server dmz.ip.addr.1
server dmz.ip.addr.2
driftfile /var/lib/ntp/drift/ntp.drift # path for drift file
logfile /var/log/ntp # alternate log file

server synched to internet sources:
awk 'NF && ! /^#/' /etc/ntp.conf
server 127.127.1.0 # local clock (LCL)
fudge 127.127.1.0 stratum 10 # LCL is unsynchronized
server ntp0.fau.de # IP 131.188.3.220
server ntp1.t-online.de # IP 195.145.119.188
server ptbtime1.ptb.de # IP 192.53.103.108
server ptbtime2.ptb.de # IP 192.53.103.104
driftfile /var/lib/ntp/drift/ntp.drift # path for drift file
logfile /var/log/ntp # alternate log file

NB:Better use ntp servers located in your region!

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"