Centos install nrpe nagios-plugin

Create Nagios user account on remote server to be monitored:

# useradd nagios
# passwd nagios

Install xinetd:

yum -y install xinetd
chkconfig xinetd on

Download and Install Nagios Plugins:

we can download nagios-plugins from http://www.nagios.org/download/download.php

# wget http://www.nagios.org/download/download.php

extract the files then complie and config nagios-plugins

#tar -xzvf nagios-plugins-x.x.xx.tar.gz
#cd nagios-plugins-x.x.xx
#./configure
#make all
#make install

Downlad and Install NRPE Daemon

http://www.nagios.org/download/download.php
As of this writing NRPE 2.12 (Stable)

Extract the Files:

# tar -xzf nrpe-2.12.tar.gz
# cd nrpe-2.12

Compile and Configure NRPE

** You need the openssl-devel package installed to compile NRPE with ssl support. **

# yum -y install openssl-devel

Install NRPE:

# ./configure

General Options:
 -------------------------
 NRPE port:    5666
 NRPE user:    nagios
 NRPE group:   nagios
 Nagios user:  nagios
 Nagios group: nagios

# make all

# make install-plugin

# make install-daemon

# make install-daemon-config

# make install-xinetd

Post NRPE Configuration

Edit Xinetd NRPE entry:

Add Nagios Monitoring server to the “only_from” directive

# vi /etc/xinetd.d/nrpe

only_from = 127.0.0.1 <nagios_ip_address>

Edit services file entry:

Add entry for nrpe daemon

# vi /etc/services

nrpe      5666/tcp    # NRPE

Restart Xinetd and Set to start at boot:

# chkconfig xinetd on

# service xinetd restart

Test NRPE Daemon Install

Check NRPE daemon is running and listening on port 5666:

# netstat -at |grep nrpe

Output should be:

tcp    0    0 *:nrpe    *.*    LISTEN

Check NRPE daemon is functioning:

# /usr/local/nagios/libexec/check_nrpe -H localhost

Output should be NRPE version:

NRPE v2.12

Open Port 5666 on Firewall

Make sure to open port 5666 on the firewall of the remote server so that the Nagios monitoring server can access the NRPE daemon.

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

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

Twitter picture

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

Facebook照片

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

Google+ photo

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

連結到 %s