Menu
User

DropVPS Team

Writer: Cooper Reagan

How to install nagios on almalinux 9

How to install nagios on almalinux 9

Publication Date

07/11/2025

Category

Articles

Reading Time

2 Min

Table of Contents

Nagios is a powerful monitoring system used to track server performance, services, network health, and more. Here’s how you can install Nagios Core (the open-source version) on AlmaLinux 8/9 step by step.

Step 1: Install Required Packages

First, make sure your system is up to date and has the necessary development tools:

sudo dnf update -y
sudo dnf install -y httpd php gcc glibc glibc-common wget unzip net-snmp perl gd gd-devel make
sudo dnf groupinstall "Development Tools" -y

Start and enable Apache:

sudo systemctl enable httpd --now

Step 2: Create a Nagios User and Group

Create the user and group needed by Nagios:

sudo useradd nagios
sudo groupadd nagcmd
sudo usermod -a -G nagcmd nagios
sudo usermod -a -G nagcmd apache

Step 3: Download and Compile Nagios Core

Get the latest stable release from the Nagios website:

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

Compile and install:

./configure --with-command-group=nagcmd
make all
sudo make install
sudo make install-commandmode
sudo make install-init
sudo make install-config
sudo make install-webconf

Step 4: Set Up Web Interface

Create a Nagios admin account for web login:

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

Restart Apache:

sudo systemctl restart httpd

Allow Apache through the firewall:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload

Step 5: Install Nagios Plugins

Nagios needs plugins to actually check services:

cd /tmp
wget https://nagios-plugins.org/download/nagios-plugins-2.4.6.tar.gz
tar -xzf nagios-plugins-2.4.6.tar.gz
cd nagios-plugins-2.4.6
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
sudo make install

Step 6: Enable and Start Nagios

sudo systemctl enable nagios
sudo systemctl start nagios

Step 7: Access Nagios Dashboard

Open your browser and go to:

http://your-server-ip/nagios

Login using:

  • Username: nagiosadmin

  • Password: (the one you set with htpasswd)

That’s it — Nagios Core is now installed and running on AlmaLinux. From here, you can begin adding hosts and services to monitor your infrastructure in real time.

Linux VPS
U
Loading...

Related Posts

How to install nagios on almalinux 9