Nagios Core Installation on CentOS Stream 10
Nagios Core is a powerful open-source monitoring system that enables users to monitor network infrastructure, servers, and applications. This document provides step-by-step instructions for installing Nagios Core on CentOS Stream 10.
Prerequisites
- A system running CentOS Stream 10
- LAMP Stack installed and running, for this, you can refer to one of our guides on installing the LAMP Stack (Apache, MariaDB, and PHP) .
- root or sudo privileges
Install Required Dependencies
Update the system and install necessary packages:
dnf update -y
dnf install -y gcc glibc glibc-common perl pcre2-devel wget unzip autoconf gcc-c++ make curl libpng-devel libjpeg-devel gd-devel perl-DBI openssl-devel
Download and Install Nagios Core
Download the latest version of Nagios Core:
cd /tmp
dnf install wget -y
wget https://github.com/NagiosEnterprises/nagioscore/releases/download/nagios-4.5.9/nagios-4.5.9.tar.gz
Extract the downloaded archive:
dnf install tar -y
tar xzf nagios-4.5.9.tar.gz
ls -lah
cd nagios-4.5.9
Create the Nagios User and Group
useradd nagios
groupadd nagcmd
usermod -aG nagcmd nagios
usermod -aG nagcmd $(whoami) # Add your current user to the nagcmd group
Now, verify that the user exists:
id nagios
make clean
./configure --with-command-group=nagios
make all
make install
make install-init
make install-config
make install-webconf
make install-commandmode
Install Nagios Plugins
cd /tmp
wget https://github.com/nagios-plugins/nagios-plugins/releases/download/release-2.4.12/nagios-plugins-2.4.12.tar.gz
tar xzf nagios-plugins-2.4.12.tar.gz
cd nagios-plugins-2.4.12
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
Verify Installation After installation, check if the plugins were installed:
ls /usr/local/nagios/libexec/
You should see plugin files like check_ping, check_http, etc.
Set Up Web Interface Authentication
Create a login password for the Nagios web interface:
mkdir -p /usr/local/nagios/etc
chown -R nagios:nagios /usr/local/nagios
chmod -R 775 /usr/local/nagios
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Restart Apache:
systemctl restart httpd
Start and Enable Nagios
systemctl enable nagios
systemctl start nagios
Access Nagios Web Interface
Open a web browser and navigate to:
http://Your_Server_IP/nagios
Note: Replace the "Your_Server_IP" with actual IP Address
Log in using:
- Username:
nagiosadmin
- Password: (the one you set earlier)
Conclusion
You have successfully installed Nagios Core on CentOS Stream 10. You can now configure hosts and services to monitor your network efficiently. For further configuration, refer to the official Nagios documentation: https://www.nagios.org/documentation/
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS