Introduction

Nagios is a powerful open-source monitoring system that allows you to monitor your entire IT infrastructure, including networks, servers, applications, and services. This tutorial will guide you through the process of installing Nagios on Debian 12.

Prerequisites

Before you begin, ensure you have:

  1. A Debian 12 server or virtual machine
  2. SSH access to the server
  3. Root or sudo privileges

Step 1: Update System

Before installing any new software, it's always a good idea to update the package repository and installed packages:

sudo apt update
sudo apt upgrade -y

Step 2: Install Required Packages

Install the required packages for Nagios installation:

sudo apt install -y wget apache2 apache2-utils unzip

Step 3: Download and Extract Nagios Core

Download the latest stable version of Nagios Core from the official website:

wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.6.tar.gz

Extract the downloaded archive:

tar -xzf nagios-4.4.6.tar.gz

Step 4: Compile and Install Nagios Core

Change into the Nagios Core directory:

cd nagios-4.4.6

Configure Nagios Core:

./configure --with-httpd-conf=/etc/apache2/sites-enabled

Compile and install Nagios Core:

make all
sudo make install
sudo make install-init
sudo make install-commandmode
sudo make install-config

Step 5: Create Nagios Web Interface User

Create a user for the Nagios web interface:

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

Enter a password for the user when prompted.

Step 6: Install Nagios Plugins

Download and install the latest version of Nagios Plugins:

cd ~
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

Step 7: Start Apache Service

Start the Apache service to enable access to the Nagios web interface:

sudo systemctl start apache2
sudo systemctl enable apache2

Step 8: Access Nagios Web Interface

Open a web browser and navigate to the following URL:

http://your_server_ip/nagios

Log in using the username nagiosadmin and the password you created earlier.

Conclusion

You have successfully installed Nagios monitoring tool on Debian 12. You can now start monitoring your IT infrastructure using Nagios.

Was this answer helpful? 0 Users Found This Useful (0 Votes)