05-14-2018
Thanks rbattle1 for your response.
The user wants us to create a script that runs on the UNIX HP-UX server every 10 min and check for any time drifts >+/- 50 ms. If the time drift is >+/- 50 ms then the script should trigger an email to the user.
I am not quite sure the next steps of the user once they are aware of time drifts.
After talking to couple of DBAs & googling, I understood that if the NTP service runs every 10 minutes on the server, it creates ntp.drift file every time NTP service runs. And ntp.drift contains the offset information and I can use this to calculate time in milli seconds and calculate the time drift. Is this assumption correct?
Please advise. I just want to make sure I am doing the right thing.
Thanks very much in advance.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
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
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
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
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
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
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
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
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
LEARN ABOUT OSX
pacemaker
PACEMAKER(8) BSD System Manager's Manual PACEMAKER(8)
NAME
pacemaker -- clock drift adjustment daemon
SYNOPSIS
pacemaker [-d drift] [-b] [-e error] [-a interval] [-i] [-v] [-n]
DESCRIPTION
pacemaker adjusts the system clock periodically to compensate for clock drift. The clock drift is normally computed by ntpd(8), which writes
a clock drift value in /var/db/ntp.drift. By default, pacemaker will call adjtime(2) once per second to slew the system clock. The daemon
is started by launchd(8) only when the drift file is present or has just been created in the file system. pacemaker detects changes in the
file and re-calculates clock adjustment values appropriately. The daemon will exit if the drift file is deleted and is not re-created within
one minute.
As a fail-safe mechanism, pacemaker will reset the system clock using settimeofday(2) if the system clock requires adjustment exceeding the
maximum value that can be accomodated by adjtime to slew the clock. In practice, this extreme case should never occur.
The -d option allows the specification of either a floating-point drift value, or the path name of an alternate drift file. If a floating
point drift value is specified, pacemaker will use the given value and will not read a drift file.
To reduce power consumption, especially when the system is using internal battery power, it may be desirable to reduce the frequency of calls
to adjust the system's clock drift. The -e and -a options, together with the -b flag allow several ways to control the clock adjustment fre-
quency.
The floating point value following -e specifies a maximum error tolerance in seconds for the system clock. For example, a value of 0.001
specifies that the clock drift adjustment should only be done frequently enough to keep the system clock error within one millisecond, based
on the current clock drift rate.
Alternatively, the clock adjustment frequency can be specified exactly as a value in seconds following -a.
When both -e error and -a interval are provided, pacemaker will choose to adjust the system clock either every interval seconds, or less fre-
quently if the clock error will remain within error seconds.
The settings for -e and/or -a may be specified for operation of the system while using an external power source, and specified independently
for operation using internal batteries. By default, the values for -e and/or -a are used for both power configurations. If the -b flag pre-
cedes -e and/or -a, then the following settings apply only when the system is using internal battery power.
For example, starting pacemaker with the following parameters will cause it to adjust the clock every 2 seconds when the system is using
external power. When running on battery power, it will adjust the clock no more than once every 10 seconds, or less frequently if the clock
error remains less than five milliseconds.
pacemaker -a 2 -b -a 10 -e 0.005
When invoked on the command-line with -i, pacemaker prints a summary of internal parameters and then exits. The -v flag causes pacemaker to
print copies of its log messages to standard error. Note that this requires running the program from the command line rather than from
launchd. -n causes pacemaker to run without actually attempting to adjust the system clock.
FILES
/var/db/ntp.drift default clock drift file
SEE ALSO
launchd(8), ntpd(8), adjtime(2), settimeofday(2).
HISTORY
The pacemaker daemon was introduced in OS X 10.9.
OS X
March 9, 2013 OS X