check_clock_offset - NRPE clock ntp offset check

From TykWiki
Jump to navigationJump to search

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