In previous article, we learn how to install nagios (monitoring tool). Now we'll learn how to install nagios agent on the system, which needs to be monitored in nagios. This Agent tool is known as Nagios NRPE (for linux). To monitor system having Windows operating system, we need to install NSClient++. NSClient++ is very easy to install as it is simply a .exe file. Here are the steps to install NRPE plugin (agent) on linux machine:
- Install required packages
yum install gcc
yum install openssl-devel
- Create Installation directory
mkdir /install
- Download NRPE
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz
tar -zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure
- Execute Commands
make all
useradd nagios
make install
cd /install
- Download & Install Nagios-Plugin
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz
tar -zxvf nagios-plugins-1.4.14.tar.gz
cd nagios-plugins-1.4.14
./configure
make all
make install
- Install NRPE into /etc/init.d
chmod a+x nrpe
- Backup of Nagios installation
cd /usr/local/
cp -frp nagios/ nagios_/
- Configuration for another server in nagios.cfg
These configurations has to be done on server, where Nagios server is installed.
cd /usr/local/nagios/etc/
vi nagios.cfg
Add below lines to add an entry for another server to be monitored.
# Definitions for monitoring the local (Linux) host
cfg_file=/usr/local/nagios/etc/objects/server96.cfg
- Add Configuration file for another server
cd objects/
cp -rf /usr/local/nagios/etc/objects/localhost.cfg /usr/local/nagios/etc/objects/server96.cfg
chown -R nagios:nagios server96.cfg
vi server96.cfg and made the needful changes.
- Restart the services
service nagios restart
service httpd restart
No comments:
Post a Comment