Just another WordPress.com site

Nagios Client Installation

3.0 Nagios Client Configuration (Linux Clients)

3.1 Now configure NRPE for clients:

Login to the linux box and start installing the nrpe which should be added to monitoring

# groupadd nagios

# useradd –g nagios nagios

# mkdir /home/nagios/downloads

# cd /home/nagios/downloads

3.2 Download nagios-plugins and NRPE for clients

#  wget  http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.14.tar.gz

# wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz

Before installing nagios plugin, do have pre-check 

#rpm -qa gcc

#rpm -qa openssl-devel

If the packages are installed we are good to continue else please install the below packages

#yum install gcc

#yum install openssl-devel

3.3 Install and configure nagios plugin

# tar zxvf  nagios-plugins-1.4.14.tar.gz

#  cd nagios-plugins-1.4.14

#  ./configure –with-nagios-user=nagios –with-nagios-group=nagios

#  make

#  make install

# chown  nagios:nagios /usr/local/nagios

# chown –R nagios:nagios /usr/local/nagios/libexec

# yum install xinetd

3.4 Install and configure NRPE daemon

# cd /home/nagios/downloads

# tar zxvf nrpe-2.12.tar.gz

# cd nrpe-2.12

#  ./configure –enable-ssl

# make all

# make install-plugin

# make install-daemon

# make install-daemon-config

#  make install-xinetd

3.5 Edit nrpe under xinetd and add following

# vi /etc/xinetd.d/nrpe

Only_from = <Nagios Server – IP>

Also the same ip should be defined in /usr/local/nagios/etc/nrpe.cfg

Allowed_hosts =, <Nagios Server – IP>

3.5.1 Add entry for nrpe in /etc/services

 vi /etc/services

nrpe                 5666/tcp                      #nrpe

3.5.2 Start are Reload the Xinetd Daemon

 # service xinetd start/reload

# chkconfig –level 345 xinetd on

3.5.3 Test NRPE Daemon Install

# /usr/local/nagios/libexec/check_nrpe -H localhost  (From Client)

NRPE v2.12

# /usr/local/nagios/libexec/check_nrpe -H <ip address of monitored box> (from server to client IP)

NRPE v2.12

3.5.4 Adding Rules to Iptables to open port on 5666/tcp on client

# iptables –A INPUT –p tcp –m state –state NEW –-dport 5666 –j ACCEPT

# /etc/init.d/iptables save –– > to make changes permanent

Now communication has been established between Server and Client.🙂

3.6 Configuration to be done on the Nagios Server for client to be Monitored

Here I have created a template called linux-box-remote.cfg

  1. /usr/local/nagios/etc/nagios.cfg   Main configuration file
  2. /usr/local/nagios/etc/cgi.cfg         This the file file where we do configuration changes.
  3. /usr/local/nagios/etc/objects directory will be having server scripts.
  4. add the linux-box-remote.cfg line into nagios.cfg once the file is filled with below entries.

3.6.1 linux-box-remote.cfg contains

define host{

name                  linux-box-remote             ; Name of this template

use                     generic-host          ; Inherit default values

check_period          24×7

check_interval        5

retry_interval        1

max_check_attempts    10

check_command         check-host-alive

notification_period   24×7

notification_interval 30

notification_options  d,r

contact_groups        admins

register              0          ; DONT REGISTER THIS – ITS A TEMPLATE


define host{

use       linux-box-remote     ; Inherit default values from a template

host_name <Hostname>    ; The name we’re giving to this server

alias     Centos5 ; A longer name for the server

address   <ip address> ; IP address of the server


define service{

use                 generic-service

host_name           <hostname>

service_description CPU Load

check_command       check_nrpe!check_load


define service{

use                 generic-service

host_name           <hostname>

service_description Current Users

check_command       check_nrpe!check_users


define service{

use                 generic-service

host_name            <hostname>

service_description /dev/hda1 Free Space

check_command       check_nrpe!check_hda1


define service{

use                 generic-service

host_name            <hostname>

service_description Total Processes

check_command       check_nrpe!check_total_procs


define service{

use                 generic-service

host_name            <hostname>

service_description Zombie Processes

check_command       check_nrpe!check_zombie_procs


3.6.2 Save the template and add the line into nagios.cfg

# vi /usr/local/nagios/etc/nagios.cfg


3.6.3 Now verify the configuration file

# /usr/local/nagios/bin/nagios –v /usr/local/nagios/etc/nagios.cfg

 If configuration is good, nagios page will display the configured host

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: