Check clock offset - NRPE clock ntp offset check: Difference between revisions

From TykWiki
Jump to navigationJump to search
(Created page with '{{DISPLAYTITLE:check_clock_offset - NRPE clock ntp offset check}} category:nagios The <code>net-mgmt/nagios-plugins</code> port contains the plugin <code>check_ntp_time</code…')
 
 
Line 19: Line 19:
Add the following line to <code>/usr/local/etc/nrpe.cfg</code>:
Add the following line to <code>/usr/local/etc/nrpe.cfg</code>:
<pre>
<pre>
command[check_clock_offset]=/usr/local/libexec/nagios/check_ntp_time -H dk.pool.ntp.org -w 0.5 -c 1
command[check_clock_offset]=/usr/local/libexec/nagios/check_ntp_time -H dk.pool.ntp.org -c -0,01:0,01
</pre>
</pre>



Latest revision as of 12:28, 18 June 2010

The net-mgmt/nagios-plugins port contains the plugin check_ntp_time which can be used to see how far off the servers clock is, when compared to an NTP server somewhere.

Configuring Nagios

Define a new service on the Nagios server, in /usr/local/etc/nagios/objects/services.cfg:

define service{
        use                             generic-service
        hostgroup_name                  freebsd-servers,freebsd-jails
        service_description             nrpe_check_clock_offset
        check_command                   check_nrpe2!check_clock_offset
}

All the FreeBSD servers I monitor gets their clocks checked, hosts as well as jails.

Configuring NRPE

Add the following line to /usr/local/etc/nrpe.cfg:

command[check_clock_offset]=/usr/local/libexec/nagios/check_ntp_time -H dk.pool.ntp.org -c -0,01:0,01

Replacing dk.pool.ntp.org with a local NTP server (pool).

Remember to restart NRPE after changing the config:

sudo /usr/local/etc/rc.d/nrpe2 restart