Nagios Core on AlmaLinux 9 — Enterprise-Grade Monitoring with a Stable RHEL Foundation

Nagios Core is a widely trusted open-source monitoring solution that provides health checks, status tracking, and alerting for infrastructure components. It is ideal for setups where configuration transparency, plugin extensibility, and system-level control are required.

AlmaLinux 9, as a downstream rebuild of Red Hat Enterprise Linux 9, delivers the security, performance, and long-term support needed for deploying Nagios Core in production environments, whether on bare metal, virtual machines, or containers.


Why Use Nagios Core on AlmaLinux 9?

AlmaLinux 9 is tailored for enterprise workloads. It provides a consistent and secure platform with 10+ years of lifecycle support—perfect for long-term monitoring solutions like Nagios.

AlmaLinux 9 FeatureBenefit for Nagios Core
Kernel 5.14 LTSModern hardware support and I/O optimization
Systemd 250+Efficient service management for Nagios and Apache
SELinux (enforcing)Strong access control, especially for plugin security
dnf & modularityAllows selection of compatible PHP/Apache versions
OpenSSL 3.xRequired for TLS-secured plugin and web UI connections

This makes AlmaLinux a particularly good fit for air-gapped, compliance-driven, or mission-critical environments.


Nagios Core System Components

Nagios Core consists of:

  • nagios daemon — The main scheduling and check-processing engine
  • Apache with CGI — Provides the web interface
  • Object Definitions — Static configuration files for hosts, services, templates
  • Nagios Plugins — Executable scripts/binaries for health checks
  • Notification Handlers — Scripts that trigger alerts via email, SMS, or APIs

These components align well with the package and service management structures provided by AlmaLinux and the RHEL ecosystem.


Advantages of Using Nagios Core on AlmaLinux 9

  1. Predictable OS Environment
    AlmaLinux provides RPM-based consistency, great for automation and long-term configuration management.
  2. Systemd Integration
    Nagios and Apache services are easily managed, monitored, and restarted using systemctl.
  3. Security Hardening
    SELinux policies can restrict plugin behavior. Custom rules ensure Nagios only interacts with explicitly permitted resources.
  4. Enterprise-Grade PHP Support
    Through Application Streams, you can pin compatible PHP versions (like PHP 8.1 or 8.2) for CGI UI support.
  5. FirewallD Compatibility
    Easily configure secure access to Nagios UI and remote monitoring ports.
  6. Minimal Overhead
    AlmaLinux is optimized for headless, non-GUI workloads—ideal for server-grade deployments with high uptime expectations.

Use Cases for Nagios Core on AlmaLinux 9

  • Infrastructure Monitoring in Data Centers
  • Remote Site Monitoring via VPN or SSH
  • PCI-DSS or HIPAA-Compliant Environments
  • Air-Gapped Monitoring Networks
  • Hybrid Infrastructure (VMs, Physical, Cloud Instances)

Nagios Core’s text-based configurations and plugin architecture make it highly adaptable to a range of environments with strict audit or change control requirements.


Security Considerations

Security LayerImplementation Strategy on AlmaLinux 9
SELinuxCreate custom policies for plugin execution and file access
HTTPS (TLS)Use Apache with mod_ssl and OpenSSL 3.x for encrypted UI
FirewallDRestrict access to ports (80/443 or 5666 for NRPE)
Systemd HardeningApply unit restrictions like ProtectSystem=full
User ManagementDefine Nagios UI access via Apache’s htpasswd authentication

Combined, these features enable Nagios to operate within secure enclaves or externally exposed hardened networks.


Plugin Ecosystem & Extensions

Nagios Core on AlmaLinux supports:

  • Standard Nagios Plugins (check_http, check_disk, check_load, etc.)
  • NRPE / NCPA for remote Linux/Windows monitoring
  • SNMP tools for network device integration
  • Webhook/SMS integration for modern alerting via custom scripts
  • Visualization tools like Grafana (via PNP4Nagios or InfluxDB exporters)

Scripts can be written in Bash, Python, Perl, or compiled languages and run directly as part of the monitoring schedule.


Comparison with Other Monitoring Tools on AlmaLinux 9

Feature/NeedNagios CoreZabbixIcinga 2
TransparencyFull config file controlWeb-basedHybrid (text + web)
PluginsCustom and reusableIntegratedCompatible with Nagios
Web InterfaceBasic CGIRich UIRich UI + API
Time Series DataExternal tools neededBuilt-inOptional via DB
Ease of ScalingManual / with addonsNative agent supportDistributed support

Nagios Core is best when full control over monitoring definitions, schedules, and scripts is preferred.


Running Nagios Core on AlmaLinux 9 gives you:

  • A secure and stable RHEL-class Linux environment
  • Long lifecycle support through 2032
  • Fine-tuned plugin execution and system resource usage
  • Compatibility with enterprise security models (SELinux, SSL, firewalls)
  • A mature and extensible monitoring platform for complex infrastructure

This setup is ideal for sysadmins and infrastructure teams seeking deterministic behavior, low resource usage, and deep customization.


Step 1: Create a Shape.Host Instance

Go to https://shape.host and log in.

Click “Create”, then choose “Instance”.

Shape.host Resources dashboard with Create > Instance highlighted.

Choose a server location closest to your users.

Shape.host instance form with the data center location selector highlighted.

Select AlmaLinux 9 (64-bit) as the OS.

Choose a plan with at least 2 CPUs, 2 GB RAM, and 10 GB SSD.

Shape.host instance form with the operating system image selector highlighted.

Click “Create Instance”.

Shape.host instance form with the Create Instance button highlighted.

After creation, copy the IP address of the server.

Shape.host Resources dashboard with the server IP address highlighted.

Step 2: Connect to the Instance

On Linux/macOS:

ssh root@your-server-ip

On Windows:

  1. Download and install PuTTY.
  2. Open PuTTY and enter your server’s IP.
  3. Log in as root when prompted.

Step 3: Update the system

dnf update -y

This ensures all packages are up to date.

Terminal showing DNF/YUM package management commands and output.

Step 4: Install Required Packages

dnf install httpd php php-cli gcc glibc glibc-common unzip wget make autoconf automake libtool libxml2 libxml2-devel gd gd-devel openssl openssl-devel perl gettext -y

Installs Apache, PHP, compilers, libraries, and other dependencies needed for compiling and running Nagios.

Terminal showing DNF/YUM package management commands and output.

Step 5: Create Nagios User and Group

useradd nagios

Creates the nagios user.

groupadd nagcmd

Creates the nagcmd group for command access.

usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

Adds nagios and apache users to nagcmd group.

Terminal showing Linux user account management commands.

Step 6: Download and Compile Nagios Core

cd /usr/src
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/refs/tags/nagios-4.5.9.tar.gz
tar xzf nagioscore.tar.gz
cd nagioscore-nagios-4.5.9

Downloads and extracts Nagios Core source code.

Terminal showing file download commands and transfer output.
./configure --with-command-group=nagcmd
make all

Configures and compiles Nagios.

Terminal showing gcc commands or output during Download and Compile Nagios Core.
Terminal showing file and directory setup commands.

Step 7: Install Nagios

make install
make install-init
make install-commandmode
make install-config
make install-webconf

Installs Nagios binaries, daemon, command mode, configuration files, and web config for Apache.

Terminal showing file and directory setup commands.
Terminal showing make commands or output during Install Nagios.
Terminal showing file ownership or permission commands.
Terminal showing make commands or output during Install Nagios.
Terminal showing make commands or output during Install Nagios.

Step 8: Create Web Login

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

Creates the nagiosadmin login for accessing the Nagios web interface.

Terminal showing an HTTP authentication password-file command.

Step 9: Enable and Start Apache

systemctl enable httpd
systemctl start httpd
systemctl status httpd

Starts and enables the Apache web server.

Terminal showing the interactive process monitor.

Step 10: Install Nagios Plugins

cd /usr/src
wget -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/refs/tags/release-2.4.12.tar.gz
tar xzf nagios-plugins.tar.gz
cd nagios-plugins-release-2.4.12

Downloads and extracts Nagios plugins.

Terminal showing file download commands and transfer output.
./tools/setup
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

Configures, compiles, and installs plugins.

Terminal showing make commands or output during Install Nagios Plugins.
Terminal showing software build configuration output.
Terminal showing file and directory setup commands.
Terminal showing make commands or output during Install Nagios Plugins.

Step 11: Verify Configuration and Start Nagios

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

Checks if your Nagios config is valid.

Terminal showing service commands or output during Verify Configuration and Start Nagios.
systemctl enable nagios
systemctl start nagios
systemctl status nagios

Starts and enables Nagios monitoring.

Terminal showing systemd service management commands or output.

Step 12: Access Nagios Web Interface

Open your browser and go to:

http://your-server-ip/nagios

Login using nagiosadmin and the password you set earlier.

Browser HTTP authentication prompt for the Nagios interface.
Nagios Core home page with navigation and service platform information.

Powered by Shape.Host

For fast and reliable hosting, use Shape.Host Linux SSD VPS. All tutorials are tested and work flawlessly on their infrastructure.