FedoraRHEL Based

How To Install Nagios on Fedora 40

Install Nagios on Fedora 40

In this tutorial, we will show you how to install Nagios on Fedora 40. Nagios Core is a widely used network monitoring system that provides a centralized platform for monitoring various aspects of your IT infrastructure. With Nagios, you can keep an eye on hosts (servers, workstations, routers, switches, etc.), services (HTTP, SMTP, DNS, etc.), system resources (CPU, memory, disk space), and network protocols (ICMP, SNMP, etc.). It offers a web-based interface for viewing current system status, event information, and historical logs.

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 the step-by-step installation of the Nagios open-source monitoring on Fedora 40.

Prerequisites

Before we dive into the installation process, ensure that you have the following prerequisites in place:

  • A server running one of the following operating systems: Fedora 40.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • You will need access to the terminal to execute commands. Fedora provides the Terminal application for this purpose. It can be found in your Applications menu.
  • A stable internet connection to download the necessary packages.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Nagios on Fedora 40

Step 1. Update the System.

To ensure a smooth installation process and maintain the security and compatibility of your Fedora 40 system, it is crucial to update it to the latest version before proceeding with the PostgreSQL installation. Open a terminal and run the following commands:

sudo dnf clean all
sudo dnf update

These commands will update your system’s packages to their latest versions, including any security patches and bug fixes.

Step 2. Installing Required Packages.

Open a terminal and use the dnf package manager to install the necessary packages:

sudo dnf install httpd php gcc glibc glibc-common gd gd-devel perl postfix

Step 3. Create a Nagios User and Group.

For security reasons, it’s recommended to create a dedicated user and group for running Nagios processes:

sudo useradd -r -m nagios
sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagios

Step 4. Installing Nagios on Fedora 40.

Next, download the latest version of Nagios Core from the official website:

wget https://github.com/NagiosEnterprises/nagioscore/releases/download/nagios-4.5.2/nagios-4.5.2.tar.gz

Extract the downloaded archive:

sudo tar xzf nagios-4.5.2.tar.gz

Navigate to the extracted Nagios Core directory and configure it for your system:

cd nagioscore-nagios-4.5.2/
sudo ./configure --with-command-group=nagcmd

Once the configuration is complete, compile Nagios Core:

sudo make all

After compilation, install the required components:

sudo make install-groups-users
sudo usermod -a -G apache nagios
sudo make install
sudo make install-init
sudo make install-commandmode
sudo make install-config
sudo make install-webconf

These commands install Nagios Core, create the necessary user and group accounts, add the nagios user to the apache group, install the init script, set up external command handling, copy sample configuration files, and configure the Apache web server.

Step 5. Installing Nagios Plugins.

Nagios plugins are external scripts or programs used to monitor various services and system resources. Install the official Nagios plugins:

cd /tmp
sudo wget https://github.com/nagios-plugins/nagios-plugins/releases/download/release-2.4.10/nagios-plugins-2.4.10.tar.gz
sudo tar xzf release-2.4.10.tar.gz
cd nagios-plugins-release-2.4.10/
sudo ./configure --with-nagios-user=nagios --with-nagios-group=nagios
sudo make
sudo make install

These commands download the latest Nagios plugins release, extract it, configure it with the nagios user and group, compile the plugins, and install them.

Before starting Nagios, verify the configuration:

sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

If no errors are reported, start the Nagios service:

sudo systemctl start nagios

To ensure Nagios starts automatically after system reboots, enable the service:

sudo systemctl enable nagios

Step 7. Access Nagios Web Interface.

You can now access the Nagios web interface by opening a web browser and navigating to http://your_server_ip/nagios. The default login credentials are:

  • Username: nagiosadmin
  • Password: nagiosadmin

It’s highly recommended to change the default password for security reasons. You can use the htpasswd utility to update the password:

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

Enter a new password when prompted.

Install Nagios on Fedora 40

The Nagios web interface provides an overview of the monitored hosts, services, and any issues or alerts. You can navigate through various sections to view detailed information, acknowledge problems, and schedule downtime for maintenance.

Congratulations! You have successfully installed Nagios. Thanks for using this tutorial for installing the Nagios open-source monitoring on Fedora 40. system. For additional help or useful information, we recommend you check the 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 the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button