How to Install Nagios 4.4.5 on RHEL/CentOS 8/7 and Fedora 30

Nagios is an awesome Open Source monitoring tool, it provides you more comprehensive monitoring environment to always keep an eye on your all machines/networks whether you are in your data center or just your small labs.

With Nagios, you can monitor your remote hosts and their services remotely on a single window. It shows warnings and indicates if something goes wrong in your servers which eventually helps us to detect some problems before they occur. It helps us to reduce downtime and business losses.

Recently, Nagios released its latest versions Nagios Core 4.4.5 and its latest stable release of Nagios plugins 2.2.1 on August 20, 2019.

This article is intended to guide you with easy instructions on how to install the latest Nagios Core 4.4.5 from source (tarball) on RHEL 8/7/6, CentOS 8/7/6 and Fedora 26-30 distributions.

Within 30 minutes you will be monitoring your local machine, no advanced installation procedure only basic installation that will work 100% on most of today’s Linux servers.

Please Note: The installation instructions were shown in here are written based on CentOS 7.5 Linux distribution.

Installing Nagios 4.4.5 and Nagios Plugin 2.2.1

If you follow these instructions correctly, you will end up with the following information.

Nagios and its plugins will be installed under /usr/local/nagios directory.

Nagios will be configured to monitor few services of your local machine (Disk Usage, CPU Load, Current Users, Total Processes, etc.)

Nagios web interface will be available at http://localhost/nagios

Step 1: Install Required Dependencies

We need to install Apache, PHP and some libraries like gcc, glibc, glibc-common and GD libraries and its development libraries before installing Nagios 4.4.5 with the source. And to do so, we can use yum default package installer.

Configure Nagios Core

Now, first we will configure Nagios Core and to do so we need to go to Nagios directory and run configure file and if everything goes fine, it will show the output in the end as sample output. Please see below.

Sample output:

*** Compile finished ***
If the main program and CGIs compiled without any errors, you
can continue with testing or installing Nagios as follows (type
'make' without any arguments for a list of all possible options):
make test
- This runs the test suite
make install
- This installs the main program, CGIs, and HTML files
make install-init
- This installs the init script in /lib/systemd/system
make install-daemoninit
- This will initialize the init script
in /lib/systemd/system
make install-groups-users
- This adds the users and groups if they do not exist
make install-commandmode
- This installs and configures permissions on the
directory for holding the external command file
make install-config
- This installs *SAMPLE* config files in /usr/local/nagios/etc
You'll have to modify these sample files before you can
use Nagios. Read the HTML documentation for more info
on doing this. Pay particular attention to the docs on
object configuration files, as they determine what/how
things get monitored!
make install-webconf
- This installs the Apache config file for the Nagios
web interface
make install-exfoliation
- This installs the Exfoliation theme for the Nagios
web interface
make install-classicui
- This installs the classic theme for the Nagios
web interface

Step 6: Install and Configure Web Interface for Nagios

We are done with all configuration in the backend, now we will configure Web Interface For Nagios with the following command. The below command will Configure Web interface for Nagios and a web admin user will be created “nagiosadmin”.

In this step, we will be creating a password for “nagiosadmin”. After executing this command, please provide a password twice and keep it remember because this password will be used when you login in the Nagios Web interface.

That’s it for now, in my upcoming articles, I will show you how to add Linux, Windows, Printers, Switches, and Devices to Nagios monitoring Server. If you’re having any trouble while installing, please do contact us via comments. Till then stay tuned and connected to Tecmint and don’t forget to Like and Share us to spread around.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

412 Responses

When I run the command “systemctl start httpd.service“. It shows the following error “Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.”

I am also new to Linux. I am also having same problem as you mention in your first comment. Can you please mention the details about port forwarding. I have installed nagios on server . I am getting error of 404 not found.

I am a beginner with Linux and network monitoring tools. I am installing Nagios 4.3.4 on CentOS 7. I followed the instructions posted here however, I cannot access the web interface. Should I have modified some config file to provide the IP address of my machine/server, please? Could you please point me towards things which I could check?

I was getting the ‘This site can’t be reached’ error on Google Chrome upon trying to access the Nagios web interface via http://10.0.2.15. However, I managed to solve this. I had forgotten to mention that I installed Nagios on a virtual machine on PC. The problem that I was having was due to a port forwarding issue it seems. I set up port forwarding (for port 80) from the VM to the PC and now everything works just fine :)

Hi I got an error the same as you. I try to do many things still not help.

I disabled SElinux
add port “12489 ” in firwalld.
and after check i found the problem when i start
==================================================
[[email protected] ~]# systemctl enable nagios
nagios.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig nagios on
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit’s
.wants/ or .requires/ directory.
2) A unit’s purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, …).
======================================================
==>> can anyone help me?!

I have verified nagios configuration as per your above process configuration is all OK. but in my nagios web URL on homepage i am getting a message “nagios core not running” it is not showing nagios running with PID. in TOP command result also there no PID associated to nagios.