How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
com/install_nagios_ubuntu/
HOME SUBSCRIBE! WRITE FOR US PRIVACY TERMS
Ubuntu
How to install Nagios on Ubuntu
20.04
6 months ago • by Younis Said
Nagios is an open-source monitoring tool that was designed to serve the purpose of
monitoring the different networking apps, their sources, and various Linux based devices.
With Nagios, we can be vigilant of any critical activities and events of software malfunctions
by sending automated alerts to the admins and prevent further damages.
Nagios also keep tabs on networking details(using TCP port, SMTP, POP3, HTTP, NNTP,
PING, etc.)
The way it works can be described in the following manner: Nagios sets up security protocols
on the different nodes in a network to detect any suspicious activity and notifies the users via
an automatic SMS. These problematic activities include HTTP, SSH, FTP fails, other
malfunction and critical errors, etc. And displays the web output using current statuses
notifications and problem history log file etc. Let’s see how we are going to install Nagios on
×
1 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
a Free Hosting Control Panel
Lightweight free Linux open
source panel
aaPanel
Some pre-requisites
We’re assuming that you’re at least familiar with the fundamentals of Linux OS, and have a
basic know-how of its interactive shell works. Other than that, you should have pre-installed
ubuntu 20.04 on your virtual machine or server before proceeding with the installation.
Also, we’re downloading and installing the Nagios package from the official depositories here.
We’ll be using the sudo access mode during the installation. If you’re using your root account,
you should exclude ‘sudo’ before each of the commands we’ve used below.
Here’s how to go about installing Nagios on your Virtual machine or server.
Step 1: Check for the updates
First off, we’ll check the web for the latest packages available, download and install them. Use
the command below to check for updates.
$ sudo apt update && upgrade
$ sudo apt install -y build-essential apache2 php openssl perl make
php-gd libgd-dev libapache2-mod-php libperl-dev libssl-dev daemon
wget apache2-utils unzip
Step 2: Create a user account
Before we install Nagios, we must create a user account parallel to that of the apache user.
Type in the following commands to add a user:
$ sudo useradd nagios
$ sudo groupadd nagcmd
$ sudo usermod -a -G nagcmd nagios
2 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
$ sudo usermod -a -G nagcmd www-data
Step 3: Download Nagios from the official website
With the updates and user account took care of, we can download Nagios by visiting the
official website.
Alternatively, you can use the following commands to download directly from the web:
$ cd /tmp
$ wget [Link]
Then extract the files with the help of tar command, and move it to the location of your choice
$ tar -zxvf /tmp/[Link]
3 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
$ cd /tmp/nagios-4.4.5/
Step 4: Compile Nagios with Ubuntu 20.04
Type in the following commands:
$ sudo ./configure --with-nagios-group=nagios
--with-command-group=nagcmd --with-httpd_conf=/etc/apache2/sites-enabled/
4 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
$ sudo make all
$ sudo make install
$ sudo make install-init
5 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
$ sudo make install-config
$ sudo make install-commandmode
Step 5: Update your email address
Type in the following command:
$ sudo gedit /usr/local/nagios/etc/objects/[Link]
6 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
What this command does is that it edits the file ([Link]) located in the directory usr/local
/nagios/etc/objects, to include the email address where we want to receive notifications.
Step 6: Fire up the web interface installer
With all of the above input into their places, we can finally move on to the installation of
Nagios web interface. Use the following codes, to begin with, the installation.
$ sudo make install-webconf
#TeamCloudNative
Join adopters and
technologists from leading
open source and cloud native
communities.
CNCF
You’ll need a user account to start using the Nagios web interface, so naturally, you must
create a user account first.
Type the following in the interactive shell to create a user account.
$ cd /tmp/nagios-4.4.5$ sudo htpasswd -c /usr/local/nagios/etc/[Link]
$ sudo a2enmod cgi
Finally, you can restart the Apache Servers.
7 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
$ sudo systemctl restart apache2
Step 7: Install Nagios Plugins
If it is not already on /tmp, you can switch directories using:
$ cd /tmp
And then use the following command to start the download.
$ wget [Link]
Next, you must extract the file and place it in the resultant directory:
$ tar -zxvf /tmp/[Link]
8 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
$ cd /tmp/nagios-plugins-2.3.3/
Once you’ve switched the directories, compile the plugins using the following command:
$ sudo ./configure --with-nagios-user=nagios --with-nagios-group=nagios
$ sudo make
9 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
$ sudo make install
Step 8: Using Nagios on Ubuntu
To make sure the configuration was properly seen through, use the following command:
$ sudo /usr/local/nagios/bin/nagios -v
10 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
$ cd /usr/local/nagios/etc/[Link]
Turn on the Nagios service to automatically start it every time you boot your VM by using:
$ sudo systemctl enable nagios
Start the services.
$ sudo systemctl start Nagios
Step 9: Get to know the web interface
Go to [Link] and have a crack at the web interface. You’ll be asked the user
credentials before you log in.
11 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
Upon logging in, you should be seeing the member dashboard:
12 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
Notice the variety of options on the far left of the interface. Hover over them to find out more.
Wrapping things up
In this tutorial, we’ve seen how to install Nagios on Ubuntu 20.04. We went through and
detailed all the steps that need be followed and explained what function each step serves
overall. It is much easier to install Nagios from their official repositories than to install it from
its source code. But sometimes, it so happens that the repositories fail to deliver the latest
versions of Nagios. This, of course, is never the case when you use source code to install
Nagios.
13 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
ABOUT THE AUTHOR
Younis Said
I am a freelancing software project developer, a software engineering
graduate and a content writer. I love working with Linux and open-source
software.
View all posts
How to Use Quota on Ubuntu?
How to Install ReactJS on Ubuntu
20.04?
How to Install Netdata Monitoring
Tool on Ubuntu 20.04
How to Automatically Empty the
Trash in Ubuntu 20.04
How to Install and Use Veracrypt
on Ubuntu 20.04
Monitor Network Traffic with
vnStat on Ubuntu 20.04
How to create and run a Perl
script in Ubuntu 20.04 LTS
14 sur 15 16/03/2021 à 20:44
How to install Nagios on Ubuntu 20.04 – Linux Hint [Link]
Linux Hint LLC, editor@[Link]
1210 Kelly Park Cir, Morgan Hill, CA 95037
AN ELITE CAFEMEDIA PUBLISHER
15 sur 15 16/03/2021 à 20:44