Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

Check Time

Rating
0 votes
Favoured:
0
Current Version
1.1.3
Last Release Date
2018-12-06
Compatible With
  • Nagios 3.x
  • Nagios 4.x
  • Nagios XI
Owner
Hits
7524
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
Script for nagios to check time against a NTP servers, and fixing the time automaticly if needed.
You can use comma separated to use more than one server.
## Description:
Script for nagios to check time against a NTP servers, and fixing the time automaticly if needed.
You can use comma separated to use more than one server.

## Auther:
Yossi Bitton yosbit@gmail.com
Date: November 2018
Version 1.1.3

### PARAMETER NTPServers
NTP server IP or DNS name.
to use more than one server, set parameter: ntp_server_ip1,ntp_server_ip2

### PARAMETER Warn - Alias -W
If offset is below or above Warning value in seconds, the script try to fix the time, if failed exitin with WARNING

### PARAMETER Crit Alias -C
If offset is below or above Warning value in seconds, the script try to fix the time, if failed exitin with CRITICAL.

### EXAMPLE
.check_time.ps1 -NTPServers 192.168.1.1 -W 5 -C 15
.check_time.ps1 -NTPServers 192.168.1.1,192.168.10.100 -W 5 -C 15
.check_time.ps1 -NTPServers 192.168.1.1,192.168.10.100 -W 5 -C 15 -Debug
.check_time.ps1 ( Works with default params)

## Instalation
### NSClient with NSC.ini config file (old version)
Edit NRPE config:
Edit NSC.ini or nsclient.ini and add the following line under section:
[Wrapped Scripts]
check_time=check_time.ps1 $ARG1$
[Script Wrappings]
ps1 = cmd /c echo scripts%SCRIPT%%ARGS%; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -

### NSClient with nsclient.ini config file (new version)
add the followings lines under:
[/settings/external scripts/scripts]
check_time = cmd /c echo scriptscheck_time.ps1 $ARG1$ ; exit($lastexitcode) | powershell.exe -ExecutionPolicy Bypass -command -
## [Download - check_time.ps1](https://github.com/yosbit/nagios-plugins/releases/download/1.1.2/check_time.ps1)