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

check_time_diff

Rating
0 votes
Favoured:
0
Current Version
0.0
Last Release Date
2016-12-25
Compatible With
  • Nagios 3.x
License
GPL
Hits
4536

Help Support Ethan Galstad's New Project:

Help Support Ethan

A Message From The Founder...

As the founder of Nagios, I'm asking for your help in a cause that's dear to my heart.

I'm launching a new project to help better the world by providing the information, ideas, and inspiration that I believe can improve the lives of people everywhere.

I know you're busy managing networks, but I would appreciate it if you would consider liking my Facebook page and showing your support for the content and messages I produce by sharing them with your friends and family.

You can learn more about my project by visiting ethangalstad.me/nagios. Thank you for your time. I wish you all the best in your endeavors, whatever they may be.

- Ethan

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 check_time_diff.sh 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/check_time_diff.sh -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