Hello,
Is there any way for us to monitor system time with APM, and issue warnings if time drift > x, for example?
Best Regards,
Simon
If you read how to check if NTP adjusted system time on Linux? - Super User
you find there is a file named /var/lib/ntp/drift.
It contains the amount of drift that your system is experiencing.
Combine that with the following:
and you could have a viable NTP SAM template.
Have you tried using one of the following Application Template?
Server Clock Drift (PowerShell)
Server Clock Drift (Perl)
Much better answer than mine. I should look @ the available templates more often.
I just put the Server Clock Drift (Perl) template on 40 servers and found 1 out of sync.
Sorry, I'm missed to follow up entirely since my post. I'll get on this asap. Thank you.
Rgrds,
Hi again,
I'm kind of struggling with the poweshell template at the moment. I'm experiencing som kind of reliability issue. It worked fine on the first try, so I made a copy of it but as I tested it again after changing a few parameters (credentials + string arguments) I started getting errors. So I went back to the default template and then it worked again during a few test runs, but as I started assigning the monitor, it stopped working again although nothing has been changed to the template. Seems to occur sporadic. This is the error I get from time to time:
Output: ==============================================
Message: Try to rerrun script. Error: Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
Errors: ==============================================
Exception calling "Connect" with "2" argument(s): "No connection could be made because the target machine actively refused it 216.171.120.36:13"
At line:5 char:20
+ $TcpClient.Connect <<<< ($time_server, 13)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Exception calling "GetStream" with "0" argument(s): "The operation is not allowed on non-connected sockets."
At line:6 char:35
+ $TcpStream = $TcpClient.GetStream <<<< ()
You cannot call a method on a null-valued expression.
At line:7 char:27
+ $length = $TcpStream.Read <<<< ($buffer, 0, $buffer.Length);
+ CategoryInfo : InvalidOperation: (Read:String) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
Exception calling "ParseExact" with "3" argument(s): "String was not recognized as a valid DateTime."
At line:10 char:24
+ [DateTime]::ParseExact <<<< ($raw.SubString(7,17), 'yy-MM-dd HH:mm:ss', $null).toLocalTime()
Any idea?
Have you downloaded the latest version of this template from the Thwack Content Exchange, or are you using the one that was included out-of-the-box? I suggest deleting the template entirely, downloading the one available here -> Server Clock Drift (PowerShell) and see if that works better for you.