Adding Nagios plugin to NRPE check

In this example we will add check_ntp_time plugin to nrpe checks. We already have fully functioning NAGIOS monitoring server and client running NRPE. We are runnign CentOS 7 on both Nagios server and client.

1. Make sure plugin exists in Nagios plugin directory on the client
2. Edit nrpe configuration file on client and add check_ntp_time check

command[check_ntp_time]=/usr/local/nagios/libexec/check_ntp_time -H "Name of NTP server" -w 0.5 -c 1

3. On NAGIOS server define service in Nagios configuration file

define service{
use                     generic-service
hostgroup_name          KVMhostgroup, LinuxHostgroup
service_description     NTP Server
check_command           check_nrpe!check_ntp_peer

4. Veryfy your NAGIOS configuration and restart NAGIOS

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios restart