Server Clock Drift (PowerShell)

The template allows you to check the server clock drift by comparing the target server time with internet time.

Prerequisites: None.

Credentials: Administrator on the target server.


Component Monitors

Clock Drift (Internet Time Service)

This monitor shows the clock drift between the target client (target node) and the target Internet Time Service server (argument) in seconds. Positive values of clock drift in the message field indicates that the time on the target server is running faster than it should. Negative values indicate time on the target server is running slower than it should. This monitor also returns the current time on the target server. 

In the Scripts Arguments field you should provide the hostname of the time server. Time servers can be found here: http://tf.nist.gov/tf-cgi/servers.cgi.

Following is an example of how to use the Scripts Arguments field:

time.nist.gov

Clock Drift (NTP)

This monitor shows the clock drift between the target client (target node) and the target NTP server (argument) in seconds. Positive values of clock drift in the message field indicates that time on the target server is running faster than it should. Negative values indicates time on the target server is running slower than it should.

In the Scripts Arguments field you should provide the hostname of the NTP server. Time servers can be found here: http://www.pool.ntp.org/.

Following is an example of how to use the Scripts Arguments field:

pool.ntp.org


Portions of this document were originally created by and are excerpted from the following sources:

Microsoft Corporation, “Microsoft Support:  Windows Management Framework Core,” Copyright Copyright 2012 Microsoft Corporation.  All rights reserved. Available at http://support.microsoft.com/kb/968930.
PowerShell.com, “Set Internet Time,” Copyright Copyright 2011-2012 PowerShell.com.  All rights reserved. Available at
http://powershell.com/cs/media/p/9869.aspx.
Cardiff University, “Using the Time Service,” Copyright Copyright 2012
.  All rights reserved. Available at http://www.cs.cf.ac.uk/Dave/PERL/node174.html.

Last updated: 11/19/2014 (Rounding error fixed)

  • The components in this template will return a 'Down' status if the script is unable to execute properly for whatever reason. E.G. the script throws an error when being executed. Below is an example of an error being returned by the script that would result in a 'Down' status.

    The return code is different than expected. Testing on node '10.199.4.133' failed with 'Down' status ('Down' might be different if script exits with a different exit code).

    Unable to Get-WmiObject Win32_UTCTime on remote client. Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

  • Under what conditions this monitor template will go into the "DOWN" state ?

    The critical, warning, healthy states are understandable, but what does the DOWN state mean here ?

    Thanks!

  • This could be a reason, but not in my case... I have implemented and tested this on just one of the servers.

  • Typically, that would be a WinRM issue, but the error you shared above is complaining that the script is expecting an integer, but is being returned a string. This usually means the script returned an error. If your firewall is dropping NTP packets that would explain why you're unable to contact pool.ntp.org, but I still suspect that we're troubleshooting an issue getting time from the NTP server consistently. i've seen this occur when users attempt to use external NTP sources which ban/block or rate limit the number of incoming NTP requests from your external publicly facing IP address. This typically occurs for those who apply the template to lots of nodes, each one of them querying every 5min. I'm not going to lie, it's happened to me on more than one occasion too.