Welcome To How To Install Nagios Core

This page will go through how to install Nagios

Setting the software up

sudo apt update

sudo apt install wget unzip curl openssl build-essential libgd-dev libssl-dev libapache2-mod-php php-gd php apache2

wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.6.tar.gz

sudo make all

sudo make install-groups-users

sudo usermod -a -G nagios www-data

sudo make install

sudo make install-commandmode

sudo make install-config

sudo make install-webconf

sudo ufw allow Apache

sudo ufw reload

sudo systemctl restart apache2

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

sudo apt-get install -y autoconf gcc libc6 libmcrypt-dev make libssl-dev wget bc gawk dc build-essential snmp libnet-snmp-perl gettext

cd /tmp

wget –no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.3.3.tar.gz

tar zxf nagios-plugins.tar.gz

cd /tmp/nagios-plugins-release-2.3.3/

sudo ./tools/setup

sudo ./configure

sudo make

Adding Hosts to monitor

This part of the guide will go through how to add different host types to the nagios monitoring tool

Adding the different hosts

For Windows Machines

First you will want to go to install nsclient++ onto the windows machine you want to monitor you can get this from: https://github.com/mickem/nscp/releases.

You will want to download the link from here:

Once it is installed you will want to open the newly installed nsclient++ application and then click next as shown in the screenshot below

Now you will want to select the generic part in the selection panel as shown in the screen shot below

Now you will want to select the typical option as shown in the screenshot below

Now you will want to enter in the required information

For the allowed host: enter in the IP address where your nagios service is hosted

For the password you can leave blank

For the modules to load please ensure only the two shown in the screenshot below are enabled

Then click next

The Setup

For Linux Machines

this part of the guide will go through what commands are needed to install the nrpe server onto the linux machine you want to monitor

The Setup

Sudo apt install nagios-nrpe-server nagios-plugins -y

Sudo nano /etc/nagios/nrpe.cfp

Change server address to point to nagios host

And for the allowed host add the server ip

Sudo systemctl restart nagios-nrpe-server

Sudo systemctl enable nagios-nrpe-server

Check if firewall is enabled

Sudo ufw status

If enabled

Sudo ufw allow 5666/tcp

Sudo ufw status

Should see the allowed tcp

Sudo ufw allow ssh

The Setup to monitor the nrpe and nsclient++ services