Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Nagios member with nrpe pawan kumar
1. NAGIOS MEMBER WITH NRPE
How To Monitor Remote Linux Host using Nagios 3.0
Download Nagios Plugins and NRPE Add-on
1. Create nagios account
2. Install Nagios Plugins
3. Install NRPE
4. Setup NRPE to run as daemon
5. Modify the /usr/local/nagios/etc/nrpe.cfg
steps to install Nagios Plugins and NRPE on the remote host
Download following files from Nagios.org and move to /home/downloads:
• nagios-plugins-1.4.11.tar.gz
• nrpe-2.12.tar.gz
Create nagios account
[remotehost]# useradd nagios
[remotehost]# passwd nagios
3. Install nagios-plugin
[remotehost]# cd /home/downloads
[remotehost]# tar xvfz nagios-plugins-1.4.11.tar.gz
[remotehost]# cd nagios-plugins-1.4.11
[remotehost]# export LDFLAGS=-ldl
[remotehost]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios
--enable-redhat-pthread-workaround
[remotehost]# make
[remotehost]# make install
[remotehost]# chown nagios.nagios /usr/local/nagios
[remotehost]# chown -R nagios.nagios /usr/local/nagios/libexec/
4. Install NRPE
[remotehost]# cd /home/downloads
[remotehost]# tar xvfz nrpe-2.12.tar.gz
[remotehost]# cd nrpe-2.12
[remotehost]# ./configure
[remotehost]# make all
[remotehost]# make install-plugin
[remotehost]# make install-daemon
[remotehost]# make install-daemon-config
[remotehost]# make install-xinetd
2. [remotehost]#vim /etc/xinetd.d/nrpe
only_from = 127.0.0.1 192.168.1.2
Modify the /etc/services and add the following at the end of the file.
[remotehost]#vim /etc/services
nrpe 5666/tcp # NRPE
[remotehost]#service xinetd restart
[remotehost]# netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN
[remotehost]# /usr/local/nagios/libexec/check_nrpe -H localhost
NRPE v2.12
command[check_disk]=/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
[remotehost]#/usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/hda1
DISK CRITICAL - free space: / 6420 MB (10% inode=98%);|
/=55032MB;51792;58266;0;64741
Configuration steps on the Nagios monitoring server to monitor
NAGIOS SERVER
1. Download NRPE Add-on
Download nrpe-2.12.tar.gz from Nagios.org and move to /home/downloads:
2. Install check_nrpe on the nagios monitoring server
[nagios-server]# tar xvfz nrpe-2.12.tar.gz
[nagios-server]# cd nrpe-2.1.2
[nagios-server]# ./configure
[nagios-server]# make all
[nagios-server]# make install-plugin
./configure will give a configuration summary as shown below:
*** Configuration summary for nrpe 2.12 05-31-2008 ***:
General Options:
————————-
NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios
3. [nagios-server]# rpm -ivh openssl-devel-0.9.7a-43.16.i386.rpm krb5-devel-1.3.4-
47.i386.rpm zlib-devel-1.2.1.2-1.2.i386.rpm e2fsprogs-devel-1.35-12.5.
el4.i386.rpm
warning: openssl-devel-0.9.7a-43.16.i386.rpm: V3 DSA signature: NOKEY, key ID
db42a60e
Preparing… ########################################### [100%]
1:e2fsprogs-devel ########################################### [ 25%]
2:krb5-devel ########################################### [ 50%]
3:zlib-devel ########################################### [ 75%]
4:openssl-devel ########################################### [100%]
[nagios-server]#/usr/local/nagios/libexec/check_nrpe -H 192.168.0.8
NRPE v2.12
NOTE:- 192.168.0.8 is client IP
[nagios-server]#vim /usr/local/nagios/etc/objects/remotehost.cfg
define host{
use linux-server
host_name remotehost
alias Remote Host
address 192.168.1.3
contact_groups admins
}
define service{
use generic-service
service_description Root Partition
contact_groups admins
check_command check_nrpe!check_disk
}
[nagios-server]#vim /usr/local/nagios/etc/nagios.cfg
cfg_file=/usr/local/nagios/etc/objects/remotehost.cfg {add This line}
[nagios-server]# service nagios reload
NOTE
ERROR:-
checking for SSL headers... configure: error: Cannot find ssl headers
Then install this packages
yum install openssl-devel
4. HELP
[remotehost]# make all
cd ./src/; make ; cd ..
make[1]: Entering directory `/usr/local/nrpe-2.13/src'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/usr/local/nrpe-2.13/src'
*** Compile finished ***
If the NRPE daemon and client compiled without any errors, you
can continue with the installation or upgrade process.
Read the PDF documentation (NRPE.pdf) for information on the next
steps you should take to complete the installation or upgrade.
[remotehost]# make install-plugin
cd ./src/ && make install-plugin
make[1]: Entering directory `/usr/local/nrpe-2.13/src'
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/libexec
/usr/bin/install -c -m 775 -o nagios -g nagios check_nrpe /usr/local/nagios/libexec
make[1]: Leaving directory `/usr/local/nrpe-2.13/src'
[remotehost]# cd ./src/ && make install-plugin
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/libexec
/usr/bin/install -c -m 775 -o nagios -g nagios check_nrpe /usr/local/nagios/libexec