This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Error when applying Server clock drift (powershell)

FormerMember
FormerMember

I applied the template Server Clock Drift (powershell) and it's working on almost all of my servers. I'm getting the attached error message on one of them. Does anyone know what would cause this?

  • Is that machine configured to use a 24 hour clock (military time)?

  • Is the error you're receiving persistent for these nodes or does this only occur occasionally?

  • FormerMember
    0 FormerMember in reply to aLTeReGo

    I can they keep going from green to unknown on several servers.

  • Is there any common thread between these hosts that are exhibiting the problem? Are they all running the the same operating system version for instance?

  • We've done some investigation internally and believe the issue is that the default configured NTP server defined in the template is blocking your connection intermittently. If you have many servers configured with this template than it's possible you are exceeding their maximum rate of querying once every 4 seconds on occasion.

    All users should ensure that their software NEVER queries a server more frequently than once every 4 seconds. Systems that exceed this rate will be refused service. In extreme cases, systems that exceed this limit may be considered as attempting a denial-of-service attack.


    To resolve this issue I recommend changing the time server configured for some nodes to use pool.ntp.org instead.


  • FormerMember
    0 FormerMember in reply to aLTeReGo

    I tried using pool.ntp.org and recieved the attached error message.Capture.PNG

  • Based on the message returned it appears that host is blocking connections. The good news is there's plenty of publicly accessible NTP servers. Below is a list of a few of them from http://tf.nist.gov/tf-cgi/servers.cgi

    NameIP AddressLocation
    nist1-ny.ustiming.org64.90.182.55New York City, NY
    nist1-nj.ustiming.org96.47.67.105Bridgewater, NJ
    nist1-nj2.ustiming.org165.193.126.229Weehawken, NJ
    nist1-ny2.ustiming.org216.171.112.36New York City, NY
    nist1-pa.ustiming.org206.246.122.250Hatfield, PA
    time-a.nist.gov129.6.15.28NIST, Gaithersburg, Maryland
    time-b.nist.gov129.6.15.29NIST, Gaithersburg, Maryland
    time-c.nist.gov129.6.15.30NIST, Gaithersburg, Maryland
    time-d.nist.gov2610:20:6F15:15::27NIST, Gaithersburg, Maryland
    nist1.aol-va.symmetricom.com64.236.96.53Reston, Virginia
    nist1-macon.macon.ga.us98.175.203.200Macon, Georgia
    nist1-atl.ustiming.org64.250.177.145Atlanta, Georgia
    wolfnisttime.com207.223.123.18Birmingham, Alabama
    nist1-chi.ustiming.org216.171.120.36Chicago, Illinois
    nist.time.nosc.us96.226.242.9Carrollton, Texas
    nist.expertsmi.com162.17.148.102Monroe, Michigan
    nist.netservicesgroup.com64.113.32.5Southfield, Michigan
    nisttime.carsoncity.k12.mi.us66.219.116.140Carson City, Michigan
    nist1-lnk.binary.net216.229.0.179Lincoln, Nebraska
    wwv.nist.gov24.56.178.140WWV, Fort Collins, Colorado
    time-nist.symmetricom.com12.10.191.251Symmetricom, Boulder, Colorado
    time-a.timefreq.bldrdoc.gov132.163.4.101NIST, Boulder, Colorado
    time-b.timefreq.bldrdoc.gov132.163.4.102NIST, Boulder, Colorado
    time-c.timefreq.bldrdoc.gov132.163.4.103NIST, Boulder, Colorado
    time.nist.govglobal address for all serversMultiple locations
    utcnist.colorado.edu128.138.140.44University of Colorado, Boulder
    utcnist2.colorado.edu128.138.141.172University of Colorado, Boulder
    ntp-nist.ldsbc.edu198.60.73.8LDSBC, Salt Lake City, Utah
    nist1-lv.ustiming.org64.250.229.100Las Vegas, Nevada
    time-nw.nist.gov131.107.13.100Microsoft, Redmond, Washington
    nist-time-server.eoni.com216.228.192.69La Grande, Oregon
    nist1.symmetricom.com69.25.96.13San Jose, California
    nist1-sj.ustiming.org216.171.124.36San Jose, California
    nist1-la.ustiming.org64.147.116.229Los Angeles, California
  • There is a bug in the Server Clock Drift (Powershell) - Clock Drift NTP component.  If you make the following changes it should work reliably, I think.

    Starting around line 24...

    =====

        If ($remoteToSolarSkew)

        {

            $Skew = $remoteToSolarSkew.TotalSeconds - $ntpToSolarSkew;

            $stat=[math]::round($Skew,2);

            #$symb=$Skew.ToString().Substring(0,1);

            $symb=$stat.ToString().Substring(0,1);

            if ($symb -eq "-")

            {

                #$stat=[math]::round($Skew,2);

                $tmp=$stat.ToString().Remove(0,1);

                Write-Host "Message: Clock drift: $stat.";

                Write-Host "Statistic: $tmp";

                exit 0;

            }

            else

            {

                $stat=[math]::round($Skew,2);

                #Write-Host "Message: Clock drift: $symb $stat s.";

                Write-Host "Message: Clock drift: $stat s.";

                Write-Host "Statistic: $stat";

                exit 0;

            }

        }

    =====

    aLTeReGo - not sure if you can validate whether this error exists in the version on thwack.  The version that ships with SAM 6.1.1 has the error it.  By way of explanation, the error is that calling ::round() on a number like -0.00121 will be rounded to 0.00 (notice the negative sign was dropped).  But the $symb is set prior to rounding, so the logic for removing the negative symbol is used on a string with no negative symbol, which then results in $stat printing an empty string instead of a 0.

  • Thank you dthvt for bringing this to our attention (and even suggesting a fix!). I've logged this internally under FB383456 and will investigate the issue. We will likely be updating the template posted in the Content Exchange accordingly.