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


Remember Me

Directory Tree


0 votes
Current Version
Last Release Date
Compatible With
  • Nagios 3.x
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
NRPE plugin to check time difference between Nagios server and monitored Linux host
Q. Why check_time_diff?

A. We wanted to check for both broken time synchronisation on both clients and servers in a way that was agnostic about whichever synchronisation mechanism was in use (ntpd, crony, systemd-timesyncd ...) on Linux systems. The plugins that did that were:
* check_daytime, rejected because we did not want to install something to listen on the daytime or time ports
* check_time, rejected because we did not want to set up ssh for it.

Q. Which OSes is check_time_diff known to work with?

A. Debian Jessie

Q. How to set up on the monitored host (NRPE server)?

1. Install in /usr/lib/nagios/plugins root:root 755

2. Create /etc/nagios/nrpe.d/check_time_diff.cfg with this single line:

command[check_time_diff]=/usr/lib/nagios/plugins/ -c $ARG2$ -f $ARG3$ -t "$ARG4$" -w $ARG5$

3. Effect the new configuration by restarting service nagios-nrpe-server

Q. How to configure the Nagios server?

1. Create hostgroup no-time-diff by adding these lines to /etc/nagios3/conf.d/hostgroups_nagios2.cfg:

define hostgroup {
hostgroup_name no-time-diff
alias Hosts we do not check time on

2. Add these lines to /etc/nagios3/conf.d/services_nagios2.cfg, adding any other hostgroups which should not be checked:

define service {
check_command check_nrpe!check_time_diff!$HOSTALIAS$ 2 iso8601 "$SHORTDATETIME$" 1
service_description Time diff
hostgroup_name all, !no-time-diff
use generic-service
notification_interval 0

3. Validate the changed conf:

nagios3 -v /etc/nagios3/nagios.cfg

4. Effect the changed conf by restarting service nagios3