How can I monitor the time difference between a Windows system and a ntp-server? I would like to do something like: get the time of the target Windows system (maybe by snmp?), then get the time of a specific ntp-server, then calculate the difference in seconds. After that I would like to deploy this sensor for every windows system monitored in prtg.
Article Comments
Thank you, but our ntp-servers don't run on Windows and therefore can't be queried by powershell in the described way. I'm aware of an Windows executable called w32tm which does just that, but I would like to avoid using powershell-remote-calls at all. Our Environment contains roughly 500 monitored Windows systems. It would probably cause a lot of load on the probes when running the sensor this way, won't it? Isn't there another way?
The only two ways I can think of are: - calling w32tm by invoke-command - creating a push-sensor on every Windows system and running a scheduled job on the target systems reguraly providing the time-difference data by using w32tm
I'm just worried about the load on the probes.
Jul, 2018 - Permalink
Executing one small script on a host periodically would not increase the load on these. If you're referring to the load caused by the sensors - the HTTP Push Data sensors are really easy on the system. They basically do nothing else than wait for results :) We've recently installed a system with thousands of them with no issues so far.
Kind regards,
Stephan Linke, Tech Support Team
Aug, 2018 - Permalink
This is exactly what the SNTP Sensor does :) But it's only available for Probe systems (i.e. either the PRTG server itself or systems that have a remote probe installed).
The following script will actually query the target host and output the timediff to PRTG:
Note that the script requires WMI Permissions as well as a correctly configured PowerShell environment.
Kind regards,
Stephan Linke, Tech Support Team
Jul, 2018 - Permalink