How to install Nagios on Ubuntu 20.04?
Overview
Nagios is an open-source monitoring tool. It helps monitor all your network, servers, services, apps, and processes, which also keeps an inventory of your whole IT infrastructure. This tutorial demonstrates the installation of Nagios on Ubuntu server.
Prerequisites
There are certain prerequisites that need to be met before you begin.
A server running Ubuntu 20.04
Non-root sudo user privileges
Get Started
Step 1 - Setting up Nagios on Ubuntu 20.04
Execute the below commands as a user with sudo permissions to install Nagios:
The Apache configuration file requires the mod_auth_digest and mod_authz_groupfile modules which are used to grant or restrict access to users who have provided proof of group membership. So, to enable these modules, execute the below commands:
Nagios can only be accessed by localhost and private IP addresses under the default configuration of Apache. We will now modify the configuration so that only the users who have been authenticated will be able to view the interface and run commands.
Locate the lines beginning with "Require ip" and "Require all granted" and comment them. Next, navigate to the line "Require valid-user" and uncomment it, as shown below:
Once you are done with the modifications, restart Apache:
By examining their status, you can confirm that Nagios and Apache are both operating correctly:
Press q or Ctrl+z to exit.
Step 2 - Setting Up a User Account
By default, Nagios is set up to give the user "nagiosadmin" administrative rights. You can access the Nagios web interface and control your inventory using this user. To create the user, enter the following htdigest command:
To make modifications effective, restart the Apache service:
Step 3 - Setting Up the Firewall
UFW firewall setup software is included in Ubuntu. Ensure that the HTTP/HTTPS ports are open if your system has a firewall enabled:
Step 4 - Getting to the Nagios Web Interface
Open your preferred browser and enter your IP address, and then type /nagios (version number) to access the Nagios web interface:
Conclusion
We have successfully demonstrated how to set up Nagios on Ubuntu system.
Last updated