Now let us add some clients to monitor by Nagios server.

Add the EPEL repository to install “nagios-plugins” and “nrpe” packages in client systems.
View also: How to Enable EPEL Repository for RHEL/CentOS 6/5 and Installing Nagios-3.4 in CentOS 6.3
Nagios server:
Operating system : CentOS 6.4
IP Address : 192.168.1.80
Nagios client:
Operating System : CentOS 6.3
IP Address : 192.168.1.81
Install “nrpe” and “nagios-plugins” packages in client systems to be monitored.

[[email protected] ~]# yum install -y nrpe nagios-plugins-all openssl

Configure Clients

[[email protected] ~]# nano /etc/nagios/nrpe.cfg
## Line 81 - Add the Nagios server IP ##
allowed_hosts=127.0.0.1 192.168.1.80

Start nrpe service

[[email protected] ~]# /etc/init.d/nrpe start
Starting nrpe: [ OK ]
[[email protected] ~]# chkconfig nrpe on

To add the clients to be monitored through nagios server, open the “nagios.cfg” file in nagios server and uncomment the following lines.

Server add Clients

[[email protected] ~]# nano /etc/nagios/nagios.cfg
## Line 52 - Uncomment ##
cfg_dir=/etc/nagios/servers

Create a directory called “servers” under “/etc/nagios/”.

[[email protected] ~]# mkdir /etc/nagios/servers

Create config file to the client to be monitored.

[[email protected] ~]# nano /etc/nagios/servers/clients.cfg

Insert this:

define host{
use linux-server
host_name client
alias client
address 192.168.1.81
max_check_attempts 5
check_period 24x7
notification_interval 30
notification_period 24x7
}

Restart nagios service.

[[email protected] ~]# /etc/init.d/nagios restart
Running configuration check...done.
Stopping nagios: .done.
Starting nagios: done.

Now open the nagios admin console in the browser and navigate to “hosts” section in the left pane. You will see the newly added client will be visible there. Click on the host to see if there is anything wrong or alerts.

Screenshot from 2013-04-13 23:58:57

Screenshot from 2013-04-14 00:00:34