- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Date/Time Info. from several servers
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 10:37 AM
02-08-2004 10:37 AM
Any idea on creating script (Unix or NT) so as to get the date & time information from several servers?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 11:17 AM
02-08-2004 11:17 AM
Re: Date/Time Info. from several servers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 11:31 AM
02-08-2004 11:31 AM
Re: Date/Time Info. from several servers
ntpq -p ntp-cup.external.hp.com
If you have DNS problems, use the IP address:
ntpq -p 192.6.38.127
It should list the time servers used by ntp-cup. If instead it returns "Request timed out:, then you need to speak to your network administrator about allowing port 123 for NTP to be opened for your computer. Your administrator may have already setup NTP on the company's firewall in which case, check it out with ntpq -p firewall_address.
Once you see an output like this (formatting will be compressed here in the forums):
remote refid st t when poll reach delay offset disp
==============================================================================
-thesimonet.org .TRUE. 1 u 14 64 377 102.28 6.415 1.66
*PALISADE(1) .GPS. 0 l 29 32 377 0.00 0.010 0.02
+bigben.cac.wash .USNO. 1 u 13 128 377 34.26 -1.709 0.15
you are ready to sync your computer. Start by editing /etc/ntp.conf. Since there are a lot of comments, you may wish to delete everything in ntp.conf (a backup copy is stored in /usr/newconfig/etc) and just put these lines:
server ntp-cup.external.hp.com
server 127.127.1.0
fudge 127.127.1.0 stratum 10
driftfile /etc/ntp.drift
Then edit the startup config file: /etc/rc.config.d/netdaemons and edit these lines:
export NTPDATE_SERVER=ntp-cup.external.hp.com
export XNTPD=1
Now make sure your system does not have any date-sensitive programs running (like databases). Then start NTP services with:
/sbin/init.d/xntpd start
This script is run automatically at bootup. It will step-change (jump) your current time to match the NTP server. From now on, time will be within 128ms accuracy.
As far as NT or Win2K, there is no support for the NTP protocol built-in. You'll have to find freeware or a priced product to support NTP. WinXP has NTP built-in.
If you have a large number of computers in your company, you may want to look at stratum levels for distributing NTP services. Your HP-UX system is already acting as an NTP server so you may want to point your other HP-UX system at that server. And in your current server, you should add additional NTP sources (5 to 7 is a good number). NTP is a very sophisticated protocol and knows how interpret time queries from various sources and survive loss of sync as well as large differences between servers.
To learn more about NTP, go to the source: http://ntp.org This is also the location to find other NTP servers on the net.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 11:38 AM
02-08-2004 11:38 AM
Re: Date/Time Info. from several servers
At this stage, I would like to check the dates (timestamp) on 3 servers where I've access as "root". Now the problem with using this command:
rexec SERVER-1 -l root -n date
is that it asks for the root password which I want to avoid. Is there any way to bypass asking the passwd?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 11:43 AM
02-08-2004 11:43 AM
Re: Date/Time Info. from several servers
Friends - Is there any way I can look for the timestamp on the NT box from Unix machine?? Will appreciate very very much for the solution...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 11:48 AM
02-08-2004 11:48 AM
Re: Date/Time Info. from several servers
Three systems sitting in the same building should have the same system time under almost any circumstances. Bill's answer is the right answer.
It can cause significant problems when a file is transferred from server a to server b and was created in the future for example.
http://developer.novell.com/research/appnotes/1999/july/03/02.htm
http://www.eecis.udel.edu/~mills/
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 11:56 AM
02-08-2004 11:56 AM
Re: Date/Time Info. from several servers
Pl. understand my requirement at this point in time. It's NOT necessary that all the 3 servers will have the same time stamp - the reason being - some of the servers are managed by the Telephone service provider for xyz purposes. At this stage, I want to check and make sure that the timestamp is all synchronized - and if not, will implement Bill's solution.
But the requirement is:
Can I create a script on NT box to check the time stamp on the Unix servers - OR vice-versa? I've used "remsh" but want to check the cross-platform systems i.e., NT to Unix or Unix to NT.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 12:32 PM
02-08-2004 12:32 PM
Re: Date/Time Info. from several servers
anyway here is a quick way to check the time on all your boxes
for x in `cat myserverlist`
do
echo $x
ssh $x "ntpq -p; date"
done | tee ntp.stats
mailx myemail@mycomp.com < ntp.stats
peace
Donny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 01:38 PM
02-08-2004 01:38 PM
Solutionmachine snoopy login root password IamAdawg
After creating this file, IMMEDIATELY change the permissions to 600, owned by yourself. Then try the command with:
rexec some_machine date
and you will see the date. If the command asks for the password, the permissions for .netrc are probably wrong. If it says connection refused or closed, then rexec is not permitted.
rexec is the preferred 'r' command to use when maintaining multiple hosts as each host does not need a .rhosts file. The local machine should be secured of course. The best choice is always to use SSH but this requries SSH to be installed on all the machines.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 01:42 PM
02-08-2004 01:42 PM
Re: Date/Time Info. from several servers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 02:27 PM
02-08-2004 02:27 PM
Re: Date/Time Info. from several servers
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 02:41 PM
02-08-2004 02:41 PM
Re: Date/Time Info. from several servers
install cygwin on your nt box, and work on it as if its a real OS(UX) :o(
install ssh, and all the goodies.
http://www.cygwin.com/
you'll be glad you did.
peace
Donny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 02:45 PM
02-08-2004 02:45 PM
Re: Date/Time Info. from several servers
My requirement is not the emulation of Unix like env. in Windows. But the requirement is:
> From Unix server, can I get the information of my NT servers i.e, date/time, ip address etc. etc.?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 02:58 PM
02-08-2004 02:58 PM
Re: Date/Time Info. from several servers
same for loop, this time to your windows boxes.
for x in `cat mywin32boxes'
do
echo $x
ssh $x "ntpq -p; date"
done
peace
Donny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 03:28 PM
02-08-2004 03:28 PM
Re: Date/Time Info. from several servers
the only way i can think of right now is the use of ssh into your windows box and run the native windows date command.
however to ssh into the windows box you must install cygwin 1st, even though you probibly never will use unix emulation on the nt box.
unless you know of another way, let us know.
my 2 cents
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 04:03 PM
02-08-2004 04:03 PM
Re: Date/Time Info. from several servers
I am still trying to achieve the results in one ago - that is, create a single script in Unix, which gets the date/time information from both Unix & NT boxes and give me the results. How that sounds?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-08-2004 04:18 PM
02-08-2004 04:18 PM
Re: Date/Time Info. from several servers
If you didn't disable the 'daytime' service on the unix system, you can do a 'telnet server 13' to get the date displayed without having to compromise on the security. I would write a small script that does a telnet to the each server at this port and puts them in a file. Then you can read that file to consolidate the information.
This doesn't work for NT machines. On Windows you have to use specialized softwares that will run either daytime|time service or sshd to enable you to get the information.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2004 03:15 PM
02-09-2004 03:15 PM
Re: Date/Time Info. from several servers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2004 05:04 PM
02-10-2004 05:04 PM
Re: Date/Time Info. from several servers
Reid, Can you be more specific about your comments?