Sponsored Content
Full Discussion: Script to detect time drift
Operating Systems HP-UX Script to detect time drift Post 303018932 by Green_Star on Tuesday 19th of June 2018 10:07:30 AM
Old 06-19-2018
Hi there, sorry to bother you again.

When I had this command "ntpq -c rl" run on the server, this the the output I get.

Code:
associd=0 status=0615 leap_none, sync_ntp, 1 event, clock_sync,
version="ntpd 4.2.6 Revision 6.0 Tue April 14 14:21:22 UTC 2015",
processor=, system="HP-UX/", leap=00, stratum=3, precision=-20,
rootdelay=14.482, rootdisp=44.199, refid=10.101.162.196,
reftime=ded28e5d.90b912dc  Mon, Jun 18 2018 16:02:37.565,
clock=ded2918b.a1b70695  Mon, Jun 18 2018 16:16:11.631, peer=23187,
tc=10, mintc=3, offset=0.182, frequency=20.824, sys_jitter=0.211,
clk_jitter=0.122, clk_wander=0.000

Do we still need to check for "Phase" in the script?
Code:
s/.*phase=-\{0,1\}\([0-9]*\).*/\1/p
t


Last edited by Don Cragun; 06-19-2018 at 12:41 PM.. Reason: Change COLOR tags to CODE tags, add missing CODE tags.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to detect my script is already running

I have a script which must not be run more than once at any given time. THis script will be scheduled to run every 20 mins as a cron job. In my script can i have logic to say if this script is already running from the previous cron, then exit. How do i go about doing that. If you describe the... (11 Replies)
Discussion started by: rmulchandani
11 Replies

2. Shell Programming and Scripting

AWK script to detect webpages from file

Hi guys I'm very new to unix and I have to create an awk script that detects webpage addresses from a file/webpage and outputs how many times each webpage was detected.e.g. if my file was: (Note: The symbol " was added to stop them being created into links) "www.google.com"... (1 Reply)
Discussion started by: ROFL
1 Replies

3. Shell Programming and Scripting

AWK script to detect webpages from file

Hi guys I'm very new to unix and I have to create an awk script that detects webpage addresses from a file/webpage and outputs how many times each webpage was detected.e.g. if my file was: www.google.com www.facebook.com www.google.com the output should be: www.google.com x2... (2 Replies)
Discussion started by: ROFL
2 Replies

4. Shell Programming and Scripting

Detect if script starts from queue

Dear community, what I'm try to do is deny users to run a script without parameters from command bash, but the same script should run without parameters only from crontab. Example runs by crontab:*/5 * * * * /tmp/script.sh Here the normal execution starts every 5 minutes Example #1 runs by... (16 Replies)
Discussion started by: Lord Spectre
16 Replies

5. Shell Programming and Scripting

How to detect Hanged process in shell script?

I have to check daily 20 processes each day. The names are like Network1 Network2 Network3 ....... Network20. There is built in utility for doing this. Following is the command to check a single network process. check_process_status 1 If we want to check the status of Network2 then the... (6 Replies)
Discussion started by: Nakul_sh
6 Replies

6. Shell Programming and Scripting

Help with detect with regex and move script

Hi all, I am needing some help with a script that will search for a video file by known extensions and then do a pattern search (I'm guessing via regex) and then based on a match of one type of another move the file to an assigned directory. I would like to do this with either a shell script... (7 Replies)
Discussion started by: Simplify
7 Replies

7. UNIX for Advanced & Expert Users

A script to detect system type

Hi forum, So I am trying to determine the OS type with the following script: #!/usr/bin/sh OStype1=`uname -s` Sunos1=SunOs if then echo "This system is Linux" exit 0 elif then echo "This system is SunOs" exit 0 elif (1 Reply)
Discussion started by: dampio
1 Replies

8. UNIX for Beginners Questions & Answers

Script to detect time drift on server

Hello there, I am not an expert in networking related stuff but I got a requirement to create UNIX script to query our Company's internal time source via NTP for time drift detect and report it when > +/- 50ms. I have been googling a lot but thought to post it in this forum to get a... (1 Reply)
Discussion started by: Green_Star
1 Replies

9. Shell Programming and Scripting

How to detect url in use in a script?

Hello, I have a small script and it runs from web application in below format: pipe:///path_to_myscript.sh url1 url2 url3 myscript.sh: #!/bin/bash count=0 while do count=$((count+1)) exec 3>&1 ((ffmpeg -i $1 ...... -f mpegts pipe:1 2>/dev/null 1>&3 ) 2>&1 | \ while read LINE; do echo... (9 Replies)
Discussion started by: baris35
9 Replies
ntp_intro(7)						 Miscellaneous Information Manual					      ntp_intro(7)

NAME
ntp_intro - Network Time Protocol (NTP) introductory information DESCRIPTION
The Tru64 UNIX software supports two time services: Network Time Protocol (NTP) Time Synchronization Protocol (TSP) Because it can be traced to clocks of high absolute accuracy, NTP provides a more accurate time service than TSP. By contrast, TSP syn- chronizes time to the average of the network host times. TSP is an acceptable time service if your system is not on the Internet and does not have access to a highly accurate time server; otherwise, NTP is recommended. Network Time Protocol The Network Time Protocol (NTP) provides accurate, dependable, and synchronized time for hosts on both wide area networks (like the Inter- net) and local area networks. In particular, NTP provides synchronization traceable to clocks of high absolute accuracy, and avoids syn- chronization to clocks keeping bad time. Hosts running NTP periodically exchange datagrams querying each other about their current estimate of the time. Using the round-trip time of the packet, a host can estimate the one-way delay to the other host. (The assumption is that the delay is roughly equal in both direc- tions.) By measuring the one-way delay and examining the timestamps that are returned with the NTP packet, a host computes the difference between its clock time and that of the host it queried. A host queries a remote host several times over a period and feeds the results from the multiple samples to a digital-filtering algorithm. The algorithm provides a more accurate estimate of the delay, clock offset, and clock stability than could be obtained with a single sam- ple. NTP messages also contain information about the accuracy and reliability of the time sources. An NTP host connected directly to a highly accurate time source, such as a radio receiver tuned to a time code signal broadcast by a government agency, is called a stratum 1 server. Every other NTP host adopts a stratum number that is one higher than the host from which it sets its own time. For example, a host syn- chronized to a stratum 1 server becomes a stratum 2 host. Stratum determination is done automatically, and the stratum of a host can vary as its connectivity changes. A host running NTP combines various information to decide which of the hosts it queried provides the time it believes to be the most accu- rate. This information includes the output of the digital-filtering algorithm and the stratum numbers of the hosts it queried. By commu- nicating with several other hosts, an NTP host can usually detect those hosts that are keeping bad time, and is able to stay synchronized even if some of the other hosts become unavailable for long periods. In practice, NTP is able to synchronize clocks to within a few milliseconds even over wide area networks spanning thousands of miles. To obtain even greater accuracy, use the NTP_TIME kernel option. See System Administration for more information. You can optionally use a high-resolution clock, enabling the time returned by the clock_gettime routine to be extrapolated between the clock ticks. The granularity of the time returned will be in microseconds. To use the high-resolution clock, use the MICRO_TIME kernel option. For detailed information on NTP, see Network Time Protocol (Version 3) (RFC 1305). Time Synchronization Protocol The Time Synchronization Protocol (TSP) is the protocol used by the daemon. In its simplest application, the TSP servers on a broadcast network (for example, an Ethernet) periodically broadcast TSP packets. The hosts on the network elect one of the hosts on the network run- ning TSP as a master. The master then controls the further operation of the protocol until it fails and a new master is elected. The mas- ter collects time values from the other hosts and computes the average of all the times reported. It then sets its own clock to this aver- age, and tells the other hosts to synchronize their clocks with it. TSP quickly synchronizes all participating hosts. However, because TSP does not trace time back to sources of known accuracy, it is unable to correct for systematic errors. If a clock drifts significantly, or if a mistake is made in setting the time on a participating host, the average time calculated and distributed by the master can be affected significantly. For information on setting up the network time services, refer to Network Administration. RELATED INFORMATION
Commands: ntp(1), ntpdate(8), ntptrace(8), timedsetup(8), xntpdc(8) Functions: ctime(3) Files: ntp.conf(4), ntp.drift(4), ntp.keys(4) Daemons: timed(8), xntpd(8) Network Time Protocol (Version 3) (RFC 1305) Network Administration System Administration delim off ntp_intro(7)
All times are GMT -4. The time now is 07:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy