Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare Time between Two Servers

Status
Not open for further replies.

Milleniumlegend

IS-IT--Management
Dec 16, 2003
135
I would like to compare the time between two servers. I have synched the time between the servers but for my application we need to log the times from one server on the other.

Is there a utility or some program that I can use to log times from remote servers to the local server.

Many thanks
 
Place the following into a .CMD file:

net time \\remote_server_name >>path\time.log

------------

You could use Task Scheduler to have it run automaticly for you.

 
Is it possible to get time in milliseconds ??

I would like to compare the time between two boxes in milliseconds and log the time on the server where the script would be running.
 
You are presuming quite a bit about not only the accuracy of the system clocks but also the latency of the network.

Even enabling an internet or "atomic" utility on the authoratative time server; e.g.
Win2k/XP/Windows2003 use the service W32Time which is based on the Simple Network Time Protocol (SNTP) as specified in RFC RFC 1769 (now superceded by RFC 2030). SNTP is designed to ensure loose synchronization only, which in the W32Time implementation means the clocks of all Windows 2000/XP/2003 machines in a forest will agree within 20 seconds of one another (or 2 seconds difference within a particular site).
 
Basically what I wanted to check is if the two servers which are basically on the same switch are not showing too much difference in time. We have synced the times but we need to know if the times when the response was sent from server a to server b there is any lag between them.

It would be helpful to see what the time is in milliseconds between the two servers for every minute.

Many Thanks
 
To show and log these results would require a simple script. Be aware that time increments are completely system dependent. On my workstation, for example, the timer increment is 15 ms.

"The value of function Timer increases at intervals of 54.9 ms and is rounded to one hundredth of a second. The interval is system-dependent, often 10 ms or 54.9 ms."

See for vbasic routines for date and time, (including a live Timer measurement of your system):
 
It occured to me just as I saved the above, that you could use PATHPING.EXE from the Win2k Resource Kit. When Pathping performs a scan, the first part of the output is similar to Tracert in that it simply shows the path from your IP address to the destination. But with Pathping, after showing this path, a scanning time estimate is displayed while the utility sends large numbers of packets to the various routers along the path. After a delay, Pathping shows the detailed test results gleaned by statistically analyzing the returned packets. In milliseconds.

Say Server 1 had an IP of 10.0.0.95 and server 2 had an IP of 10.0.0.124.

Server 1
pathping -n 10.0.0.124 >>server2_time.txt

Server 2
pathping -n 10.0.0.80 >>sever1_time.txt

These can be placed as a single line in a CMD file and Scheduled Tasks used to execute them.

pathping [-n] [-h maximum_hops] [-g host-list] [-p period] [-q num_queries [-w timeout] [-T] [-R] target_name

Parameters

-n

Does not resolve addresses to host names.

-h maximum_hops

Specifies maximum number of hops to search for the target. Default is 30 hops.

-g host-list

Allows consecutive computers to be separated by intermediate gateways (loose source route) along host-list.

-p period

Specifies number of milliseconds to wait between consecutive pings. Default is 250 milliseconds (1/4 second).

-q num_queries

Specifies number of queries to each computer along the route. Default is 100.

-w timeout

Specifies number of milliseconds to wait for each reply. Default is 3000 milliseconds (3 seconds).

-T

Attaches a layer-2 priority tag (for example, 802.1p) to the ping packets that it sends to each of the network devices along the route. This helps identify network devices that do not have layer-2 priority configured. This parameter must be capitalized.

-R

Checks to see if each network device along the route supports the Resource Reservation Setup Protocol (RSVP), which allows the host computer to reserve a certain amount of bandwidth for a data stream. This parameter must be capitalized.

target_name

Specifies the destination endpoint, identified either by IP address or host name.

The pathping command performs the equivalent of a traceroute to identify which routers are on the path. It then sends pings periodically to all of the routers over a given time period, and computes statistics based on the number returned from each.

To avoid congestion, pings should be sent at a sufficiently slow interval.

To minimize the effects of burst losses, do not send pings too close together.

-p period parameter

Pings are sent to each intermediate hop, one at a time. Therefore, the interval between two pings sent to the same hop is (period) x (number of hops).

-w timeout parameter

Multiple pings can be done in parallel, so the amount of time specified in the timeout parameter is not bounded by the amount of time specified for the period parameter for waiting between pings.

-T parameter

Enabling layer-2 priority on the host computer allows packets to be sent with a layer-2 priority tag, which can be used by layer-2 devices to assign a priority to the packet. Legacy devices that do not understand layer-2 priority will toss tagged packets, since they will appear as malformed packets. Therefore, a switch that connects to a legacy network should be configured to strip the tag before forwarding the packets. This option helps identify the network elements that are tossing the tagged packets.

The pathping command is case-sensitive. This parameter must be capitalized.

-R parameter

An RSVP reservation message for a non-existent session is sent to each network device along the route. If the device is not configured to support RSVP, it returns an Internet Control Message Protocol (ICMP) unreachable message. If it is configured to do RSVP, it returns a Reservation Error. Some devices may not return either of these messages. If this happens, pathping returns a timeout message.

The pathping command is case-sensitive. This parameter must be capitalized.

The following example shows output for pathping:


Code:
D:\>pathping -n msw

Tracing route to msw [7.54.1.196]
over a maximum of 30 hops:
  0  172.16.87.35
  1  172.16.87.218
  2  192.68.52.1
  3  192.68.80.1
  4  7.54.247.14
  5  7.54.1.196

Computing statistics for 125 seconds...
            Source to Here   This Node/Link
Hop  RTT    Lost/Sent = Pct  Lost/Sent = Pct  Address
  0                                           172.16.87.35
                                0/ 100 =  0%   |
  1   41ms     0/ 100 =  0%     0/ 100 =  0%  172.16.87.218
                               13/ 100 = 13%   |
  2   22ms    16/ 100 = 16%     3/ 100 =  3%  192.68.52.1
                                0/ 100 =  0%   |
  3   24ms    13/ 100 = 13%     0/ 100 =  0%  192.68.80.1
                                0/ 100 =  0%   |
  4   21ms    14/ 100 = 14%     1/ 100 =  1%  7.54.247.14
                                0/ 100 =  0%   |
  5   24ms    13/ 100 = 13%     0/ 100 =  0%  7.54.1.196

Trace complete.
When pathping is run, the first results list the route. This is the same path that is shown using tracert. Next, pathping displays a busy message for approximately the next minute and a half (the exact time varies by the hop count). During this time, pathping gathers information from all the routers previously listed and from the links between them. At the end of this period, it displays the test results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top