Freewaregruppe Monitoring/Nagios-Plugins
Windows-Plugin: checks the Windows system time against an NTP time source
check_w32tm is a Windows plugin for Nagios, which checks the Windows system time against an NTP time source.
Windows-Tool w32tm.exe
Usually you run the plugin with the comparative NTP source:
C:> check_w32tm.exe host=<NTP-Source>
For debugging purposes, it may also be called with a more detailed output option (this mode is not suitable for continuous operation, but for testing purposes only).
Afterwards it will output the detailed status of the individual components:
C:> check_w32tm.exe host=ptbtime1.ptb.de debug
Host: ptbtime1.ptb.de Warning: 5 Critical: 10 Timeout: 15 ptbtime1.ptb.de wird verfolgt [192.53.103.108:123]. 1 Proben werden gesammelt. Es ist 25.09.2014 08:17:59. 08:17:59, +00.4795167s Offset: 0,4795167 OK: Offset to ptbtime1.ptb.de: 0,4795167s
For information on the plugin and its usage you can call it with the help command:
C:> check_w32tm.exe help
check_w32tm - Revision: 1.1 Copyright (C) 2014 LuftEngineering GmbH Report Bugs to:info@luft-it.de check_w32tm plugin for Nagios. Compares localtime with a timeserver. Using w32tm .exe Usage: host - Timeserver (required) warning - Warning threshold (default=5) critical - Critical threshold (default=10) timeout - Seconds before the plugin times out (default=15) version - Plugin version help - Show this text debug - Print details. NOT for use with nagios
Preferably the plugin is copied into the script directory where you will store your checks under Windows.
When using NSClient ++ use an entry in NSC.INI similar to this, is generated and pointed to check_w32tm:
... [/modules] NRPEServer=enabled CheckExternalScripts=enabled [/settings/NRPE/server] allow arguments=true [/settings/external scripts/scripts] check_w32tm=scripts\check_w32tm.exe host=ptbtime2.ptb.de ...
Checking the set time, excessive deviation:
C:> check_w32tm.exe host=ptbtime1.ptb.de
CRITICAL: Offset to ptbtime1.ptb.de: 662s
2019-01-22
check_w32tm 1.9 – for Windows 2016 und 2019 Serversystems
2016-06-10
1.5 – Support for german (and english) Server OS
2015-11-02
1.4 – Support for .Net 4.5
2014-20-10
1.3 – Add RegEx to find TimeDiff in output and add perf data
2014-11-07
1.2 – Support for czech OS
2014-06-07
1.1 – Support for .Net 3.5 and 64 bit OS
2012-21-01
1.0 – First public version
check_w32tm is licensed under the GNU General Public License.
Joachim Luft will answer your questions to this plugin and is happy about your donation.