Changes in the Nagios server:


First of all enable NRPE plugin for the client host in Nagios server:


  1. Make sure check_nrpe command is defined inside commands.cfg file. If not, add it (assuming nrpe plugin is installed along with Nagios ):

define command{

command_name check_nrpe

command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$



Nrpe enables some default monitoring for the host like CPU Load, Current Users, total processes … etc.


  1. The custom nrpe script that we are planning to place for nfs monitoring can be downloaded from here.  The script has to be placed in the client server and not in the Nagios server but we have to make the script definition in the commands.cfg file in Nagios server itself. So add the below lines to define the nfs check in commands.cfg file:

define command{

command_name check_nfs

command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_nfs_health


Note that “check_nfs_health” is the bash script name that I have downloaded from the url above.


  1. Make sure that the “server.cfg” got the host definition of the client server where nfs has to be monitored:

define host {

use                             linux-server


alias                           for_testing_nfs


max_check_attempts              5

check_period                    24x7

notification_interval           30

notification_period             24x7



  1. Enable the service definition in the services.cfg file :

define service{

use                     generic-service


service_description     NFS Monitoring

check_command           check_nrpe!check_nfs



Changes in the nfs client:


  1. Make sure nrpe plugin is installed:


#yum install nrpe


  1. Edit NRPE configuration to add the below line right under “COMMAND DEFINITIONS”:


#vi /etc/nagios/nrpe.cfg

command[check_nfs]=/usr/lib64/nagios/plugins/check_nfs_health -i client -s default -a /mnt/nfs/var/nfsshare -x none -f ignore

Now, download the nfs check bash script from the link provide above to the location à /usr/lib64/nagios/plugins/check_nfs_health  (I renamed “” to ”check_nfs_health“ ).  Make sure that the script has got executable permissions.

“/mnt/nfs/var/nfsshare” is the nfs mount point that I have created and that needs to be monitored.


  1. Restart nrpe client in the server :

systemctl restart nrpe.service



Reload Nagios service in the Nagios master server :


#systemctl reload nagios.service


And voila…