Nagios 4.1.1: Adding Linux host to Nagios Monitoring server
Installing
Dependencies
# yum install
-y gcc glibc glibc-common gd gd-devel make net-snmp openssl-devel xinetd
ntp openssl* nagios-nrpe*
Create
a new nagios  user
account and set a password. 
# useradd nagios 
Nagios  Plugins
installation:
We
needed to install Nagios plugins in to  the client so that it can execute the
commands given by nagios  server nagios cd  /root/nagios nagios -plugins-2.1.1. tar. gz cd  nagios -plugins-2.1.1. tar. gz configure 
# service nrpe start
Add
the permission to the nagios user for /usr/local/nagios folders
where the nagios plugins are installed just now 
Installing
NRPE client on Linux host:
This allows you to monitor remote machine metrics (disk usage, CPU load, etc.).
NRPE can also communicate with some of the Windows agent addons, so you
can execute scripts and check metrics on remote Windows machines as well.
Same
steps as above. First create the folder:
#
mkdir -p /usr/local/src/nrpe
Download
the files and extract:
Because of an issue with the openssl library folder we need to use
another path than /usr/lib:
#./configure
--with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
Now
make and make install:
Next,
install the NRPE plugin daemon, and sample daemon config file. 
#
make install-plugin
Install
the NRPE daemon under xinetd as a service.
#
make install-xinetd
Next,
open /etc/services file add the following entry for the NRPE daemon
at the bottom of the file.
# vi /etc/services
nrpe            5666/tcp    
            NRPE
Restart
the xinetd service.
#
service xinetd restart
Verify
NRPE Daemon Locally
Run the following command to verify the NRPE daemon working correctly under xinetd.
# netstat -at
| grep nrpe
tcp        0      0 *:nrpe  
                   *:*  
                     
LISTEN
Next,
verify the NRPE daemon is functioning properly. Run the “check_nrpe” command
that was installed earlier for testing purposes.
You will get a following string on the screen, it shows you what version of
NRPE is installed:
NRPE v2.15
In
order to monitor Linux client we needed to edit 2 configuration files
in the Nagios server 
Login
to the Nagios server 
Step
1. Edit hosts.cfg file to add the Linux client and add the client configuration
# vi /usr/local/nagios/etc/hosts.cfg
define host{
Step
2. Edit services.cfg file to add the Linux client host_name to the services
which we want to moinitor
#vi
/usr/local/nagios/etc/services.cfg
define service{
Needed to add the Hostname which is given in the
hosts.cfg file for the servies you want to monitor
Step
3. Finally, verify Nagios Configuration files for any errors and restart the nagios services 
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
# service nagios restart
Now go to Nagios Monitoring Web interface at “http://Your-server-IP-address/nagios”
or “http://FQDN/nagios”
Nagios 4.1.1
other links:
Keywords: Nagios, Monitoring, Linux host, Ading Linux host
This allows you to monitor remote machine metrics (disk usage, CPU load, etc.). NRPE can also communicate with some of the Windows agent addons, so you can execute scripts and check metrics on remote Windows machines as well.
# mkdir -p /usr/local/src/nrpe
Because of an issue with the openssl library folder we need to use another path than /usr/lib:
#./configure --with-ssl=/usr/bin/openssl --with-ssl-lib=/usr/lib/x86_64-linux-gnu
# make install-plugin
# make install-xinetd
# vi /etc/services
nrpe 5666/tcp NRPE
# service xinetd restart
Run the following command to verify the NRPE daemon working correctly under xinetd.
# netstat -at | grep nrpe
tcp 0 0 *:nrpe *:* LISTEN
You will get a following string on the screen, it shows you what version of NRPE is installed:
NRPE v2.15
# vi /usr/local/nagios/etc/hosts.cfg
define host{
#vi /usr/local/nagios/etc/services.cfg
define service{
Needed to add the Hostname which is given in the hosts.cfg file for the servies you want to monitor
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
# service nagios restart
Now go to Nagios Monitoring Web interface at “http://Your-server-IP-address/nagios” or “http://FQDN/nagios”
Keywords: Nagios, Monitoring, Linux host, Ading Linux host
 
Comments
Post a Comment