User Tools

Site Tools




1. Installing Nagios on Centos 5.x

Nagios needs apache installed first

yum install -y httpd
chkconfig httpd on

Install Nagios by yum

yum install -y nagios nagios-plugins nagios-plugins-nrpe nagios-devel

Setup password file

htpasswd -c /etc/nagios/htpasswd.users nagiosadmin

Restart Services

service httpd restart
service nagios restart

2. Web Interface

Nagios Web Admin Page URL:


3. Installing NRPE to monitor remote Linux Servers

3.1 NRPE - Remote Linux Server Setup

3.1.a) Install by YUM

yum install -y nagios-nrpe

3.1.b) Install by apt-get

apt-get install nagios-nrpe-server

3.1.c) Install by Source

yum install -y gcc pkgconfig pcre pcre-devel open-ssl open-ssl-devel
adduser nagios -M
cd /usr/local/src
tar xzf nagios-plugins-1.4.14.tar.gz
cd nagios-plugins-1.4.14
make all
make install

cd /usr/local/src
tar xzf nrpe-2.12.tar.gz
cd nrpe-2.12
make all
make install
cp init-script /etc/init.d/nrpe
chmod +x /etc/init.d/nrpe
[ -d /usr/local/nagios/etc ] || mkdir /usr/local/nagios/etc
cp sample-config/nrpe.cfg /usr/local/nagios/etc/.
chown -R nagios /usr/local/nagios/etc/
[ -d /etc/xinetd.d/ ] || mkdir /etc/xinetd.d/
cp sample-config/nrpe.xinetd /etc/xinetd.d/nrpe

3.2. NRPE- Configuring Remote Server

Edit /etc/nagios/nrpe.cfg and:

3.2.a) allow nagios server to talk to remote. Note: Do not leave any spaces between the server ip addresses which is delimited by a comma.

allowed_hosts=,<nagios server ip>

3.2.b) replace the check_hda1 with check_disk command below

command[check_disk]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/VolGroup00-LogVol00

3.3 NRPE - running it

Note: Make sure port 5666 is open on remote server

3.3.a) run nrpe by init

chkconfig --level 345 nrpe on
service nrpe start

3.3.b) run nrpe by xinet.d

yum install -y xinetd
service xinetd start

Fixup allowed_hosts in /etc/xinetd.d/nrpe

service xinetd restart

Add following line to /etc/services just above “cvsup” if not exist

nrpe 5666/tcp # NRPE

3.4. NRPE - Configuring Nagios Server

Test that connection to remote works on the nagios server by:

/usr/lib64/nagios/plugins/check_nrpe -H <remote linux server>
/usr/lib64/nagios/plugins/check_nrpe -H <remote linux server> -c check_users

Add following to /etc/nagios/objects/commands.cfg

# nrpe command
define command{
        command_name check_nrpe
        command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

Configure the remote linux host on the nagios server

Add following to /etc/nagios/objects/linux-box-remote.cfg

define host{
          use                linux-server
          host_name myserver   ; The name we're giving to this server
          alias     myserver ; A longer name for the server
          address   ; IP address of the server

define service{
          use                 generic-service
          host_name           myserver
          service_description CPU Load
          check_command       check_nrpe!check_load
define service{
          use                 generic-service
          host_name           myserver
          service_description Current Users
          check_command       check_nrpe!check_users
define service{
          use                 generic-service
          host_name           myserver
          service_description Disk Free Space
          check_command       check_nrpe!check_disk
define service{
          use                 generic-service
          host_name           myserver
          service_description Total Processes
          check_command       check_nrpe!check_total_procs
define service{
          use                 generic-service
          host_name           myserver
          service_description Zombie Processes
          check_command       check_nrpe!check_zombie_procs

Add the remote linux host config file to the nagios.cfg

# Definitions for monitoring remote Linux machine

Restart nagios

service nagios restart


for x64 env plugins are located in : /usr/lib64/nagios/plugins

1) check_jmx4perl - accessing JMX attributes

website: download:

References - User and Groups for External Command File Permissions

guides/install/nagios.txt · Last modified: 2010/12/02 14:23 by michaelc