How to install Nagios on RHEL 7 - nomorespice/rhel7-howto GitHub Wiki

Nagios is a free and open-source computer-software application that monitors systems, networks and infrastructure. Nagios provides monitoring and alerting services for servers, switches, applications and services. This procedure will guide you through the installation process on a Red Hat Enterprise Linux 7 server.

This document assumes that:

Install required software

mkdir /var/src
yum -y install gd-devel

Create and configure the required user and groups

useradd nagios
passwd -l nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

Download, compile and install the Nagios service

cd /var/src
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.5.tar.gz -O nagios-4.4.5.tar.gz
tar xzf nagios-4.4.5.tar.gz
cd nagios-4.4.5
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-daemoninit
make install-config
make install-commandmode
make install-exfoliation
make install-webconf

cd /var/src
wget https://nagios-plugins.org/download/nagios-plugins-2.3.0.tar.gz -O nagios-plugins-2.3.0.tar.gz
tar xzf nagios-plugins-2.3.0.tar.gz
cd nagios-plugins-2.3.0
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

Create a web access username and password

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Start and enable required services

systemctl restart httpd
systemctl enable nagios
systemctl start nagios