Nagios

For redhat/centos

Client side

yum install epel-release
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
# this repo is for centos 7
yum install nrpe nagios-plugins-users nagios-plugins-load nagios-plugins-swap nagios-plugins-disk nagios-plugins-procs
vi /etc/nrpe.d/op5_commands.cfg
# it’s optional
vi /etc/nagios/nrpe.cfg
# 1.search disk in that file and mention hard-disk number and restart and enable service
# 2.allowed_hosts=127.0.0.1,::1,115.112.176.40 (mention server ip on clent pc in nrpe.conf file)
systemctl restart nrpe
systemctl enable nrpe

Server side

This is the location of nagios configuration file: /usr/local/nagios/etc/objects/linux/linux-hostgroups.cfg

vi linux-hostgroups.cfg
# in this file remove client name from no-disk motoring group
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios restart

Note : check if port 5666 is open on client side for nagios server (vesta)



for ubuntu


Step 2 – Install NRPE Service

sudo apt-get install nagios-nrpe-server nagios-plugins

Step 3 – Configure NRPE

After the installation is complete, edit the nrpe file /etc/nagios/nrpe.cfg:
vim /etc/nagios/nrpe.cfg




Step 4 – Restart NRPE

service nagios-nrpe-server restart





Adding new host to monitor in Nagios

To add a remote host you need to create two new files “hosts.cfg” and “services.cfg” under “/usr/local/nagios/etc/” location.



/usr/local/nagios/etc/nagios.cfg



# You can specify individual object config files as shown below:
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg

# Definitions for monitoring the local (Linux) host
#cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
cfg_file=/usr/local/nagios/etc/objects/linux/linux-template.cfg
cfg_file=/usr/local/nagios/etc/objects/linux/linux-hostgroups.cfg

cfg_file=/usr/local/nagios/etc/objects/linux/linux-hosts.cfg

you need to choose the file on the requirement for me now is /usr/local/nagios/etc/objects/linux/linux-hosts.cfg

here

/usr/local/nagios/etc/objects/linux/linux-template.cfg is the service file



Finally, verify Nagios Configuration files for any errors.


/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Leave a Comment

Your email address will not be published. Required fields are marked *

To Resolve this issue at just 5$ from ServerExpert

https://serverexpert.io/

For Hosting please visit Hostingwebsite.io

You have Successfully Subscribed!

Open chat