CentosLinuxMonitoring

Adding clients to Nagios server

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.

[root@client ~]# yum install -y nrpe nagios-plugins-all openssl

Configure Clients

[root@client ~]# 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

[root@client ~]# /etc/init.d/nrpe start
Starting nrpe: [ OK ]
[root@client ~]# 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

[root@server ~]# nano /etc/nagios/nagios.cfg
## Line 52 - Uncomment ##
cfg_dir=/etc/nagios/servers

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

[root@server ~]# mkdir /etc/nagios/servers

Create config file to the client to be monitored.

[root@server ~]# 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.

[root@server ~]# /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

Related Articles

3 Comments

  1. Hey i configured nagios ,, but when i uncomment “cfg_dir=/etc/nagios/servers” and try to restart nagios, i got error :

    “Running configuration check… CONFIG ERROR! Restart aborted. Check your Nagios configuration.”

  2. Hi,

    Very nice tutorial. I have followed your instructions and I have created new user. But in your tutorial client is up but status at my side is down and it is telling an error, which is

    (for 0d 6h 22m 17s)Status Information: was not set
    check_ping: Could not parse arguments
    Usage:
    check_ping -H -w ,% -c ,%
    [-p packets] [-t timeout] [-4

    Kindly help me fixing this.

    Thanks in advance
    Kashif

  3. Hi,

    Very nice tutorial. I have followed your instructions and I have created new user. But in your tutorial client is up but status at my side is down and it is telling an error, which is

    (for 0d 6h 22m 17s)Status Information: was not set
    check_ping: Could not parse arguments
    Usage:
    check_ping -H -w ,% -c ,%
    [-p packets] [-t timeout] [-4

    Kindly help me fixing this.

    Thanks in advance
    Kashif

Leave a Reply to kashif Cancel reply

Your email address will not be published. Required fields are marked *

CAPTCHA


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button