How To Install Nagios on CentOS 8

Install Nagios on CentOS 8

In this tutorial we will show you how to install Nagios on CentOS 8. For those of you who didn’t know, Nagios is an open source software that can be used for network and infrastructure monitoring. Nagios will monitor servers, switches, applications and services. It alerts the System Administrator when something went wrong and also alerts back when the issues has been rectified. Resources that can be monitored include CPU, memory and disk space loads, log files, temperature or hardware errors. It can monitor various parameters and problems for services like HTTP, SMTP, DNS, and with the help of plugins it can be highly extended. Nagios core was originally designed to run under Linux, although it should work under most other unices as well.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Nagios on a CentOS 8 server.

Install Nagios on CentOS 8

Step 1. First of all make sure that all packages are up to date.

Step 2. Install required packages and dependencies.

Run the command below to install them:

Next, create Nagios user and group:

Now create a groud for nagios setup “nagcmd” and add nagios user to this group. Also add nagios user in apache group:

Step 3. Installing Nagios on CentOS 8.

First, navigate to the Nagios Core downloads page and grab the latest Nagios core source code:

Perform below steps to compile the Nagios from the source code:

We need to setup the password for the user nagiosadmin. This username will be used to access the web interface so it is important to remember the password that you will input here. Set the password running the following command and enter the password twice:

Step 4. Installing Nagios on CentOS 8.

Before you download and install the Nagios plugins, you need to install the required packages for compiling and building the plugin package:

Then, download and extract the latest version of the Nagios Plugins:

Move into the extracted directory, compile, build and install the Nagios Plugins:

Now you need to restart the apache service. Also, start and enable the Nagios service:

Step 5. Configure firewall for Nagios.

If you have firewall running, you need to open port 80 in the firewall:

Step 6. Accessing Nagios Web Interface.

Finally, you can now access the Nagios web console. Open your web browser and point it to Nagios Core web directory, for example:

When prompted for username and password you will introduce the username “nagiosadmin” and the password that you entered in step 3. In case you forget this password you can modify it by rerunning the htpasswd command in step 3.

Install Nagios on CentOS 8

Congratulation’s! You have successfully installed Nagios. Thanks for using this tutorial for installting Nagios monitoring tool in CentOS 8 systems. For additional help or useful information, we recommend you to check the official Nagios website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!