How to Install Nagios on Ubuntu 24.04 LTS

In this article, we will guide you through the process of installing and configuring Nagios on Ubuntu 24.04 LTS | How to Install Nagios on Ubuntu 24.04 LTS, covering the prerequisites, step-by-step installation, and essential configuration to monitor your system effectively.

Monitoring the health and performance of your IT infrastructure is crucial for preventing downtime and ensuring smooth operations. Nagios, a powerful open-source monitoring tool, allows you to keep an eye on servers, network devices, services, and applications. It provides detailed alerts and reports that help system administrators address issues before they become critical.

Prerequisites

  • SSH Access with admin privileges
  • Ubuntu 24.04 LTS with minimal installation

Step #1:Install Nagios Dependencies packages on Ubuntu 24.04 LTS

First, update your package list and install the necessary dependencies:

sudo apt update
sudo apt install -y build-essential libgd-dev openssl libssl-dev unzip apache2 php libapache2-mod-php php-gd

Step #2:Create a Nagios User and Group in Ubuntu 24.04 LTS

Create a user and group for Nagios:

sudo useradd nagios
sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagios
sudo usermod -a -G nagcmd www-data

Step #3:Download and Compile Nagios on Ubuntu 24.04 LTS

Download the latest Nagios Core release and extract it: To download latest version visit Officical Nagios Site

cd /tmp
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.5.1.tar.gz
tar xzf nagios-4.5.1.tar.gz
cd nagios-4.5.1
How to Install Nagios on Ubuntu 24.04 LTS 1

Configure and compile Nagios:

./configure --with-nagios-group=nagios --with-command-group=nagcmd
make all

Step #4:Install Nagios on Ubuntu 24.04 LTS

Install Nagios binaries, init scripts, and command mode:

sudo make install
sudo make install-init
sudo make install-commandmode
sudo make install-config
sudo make install-webconf
How to Install Nagios on Ubuntu 24.04 LTS 2

Step #5:Install Nagios Plugins on Ubuntu 24.04 LTS

Download and install Nagios plugins on Ubuntu 24.04 LTS

cd /tmp
wget https://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
tar xzf nagios-plugins-2.3.3.tar.gz
cd nagios-plugins-2.3.3
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
sudo make install
How to Install Nagios on Ubuntu 24.04 LTS 3

Step #6:Configure Apache on Ubuntu 24.04 LTS

Enable Apache modules and restart the service:

sudo a2enmod rewrite
sudo a2enmod cgi
sudo systemctl restart apache2

Step #7:Configure Nagios Web Interface on Ubuntu 24.04 LTS

Create a Nagios admin user for the web interface:

sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
How to Install Nagios on Ubuntu 24.04 LTS 4

Step #8:Start Nagios Service on Ubuntu 24.04 LTS command line

Start and enable the Nagios service:

sudo systemctl start nagios
sudo systemctl enable nagios

Step #9:Access Nagios Web Interface on Ubuntu 24.04 LTS

Open your web browser and navigate to http://<your-server-ip>/nagios. Log in with the username nagiosadmin and the password you set earlier.

How to Install Nagios on Ubuntu 24.04 LTS 5

You can use the console for monitoring:

How to Install Nagios on Ubuntu 24.04 LTS 6

Conclusion:

With Nagios installed and configured on your Ubuntu 24.04 system | Install Nagios on Ubuntu 24.04 LTS, you now have a powerful tool for monitoring your infrastructure. This setup enables you to track system performance, detect issues early, and ensure smoother operations. You can further enhance Nagios by exploring additional plugins and advanced configurations as your monitoring needs grow.

Related Articles:

How to Install Nagios on Ubuntu 20.04 LTS

Reference:

Harish Reddy

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Share via
Copy link
Powered by Social Snap