Step-by-Step Guide: Configuring Nagios 4.4.10 on RHEL 9 for Monitoring - Part-1

Опубликовано: 06 Сентябрь 2026
на канале: The SysAdm
777
10

In this comprehensive tutorial, we'll walk you through the process of configuring Nagios on a Red Hat 9 server to monitor your network. Whether you're new to Nagios or an experienced user, you'll find valuable insights and step-by-step guidance in this video.

**Key Topics**:
Red Hat 9 Server Setup
Nagios Installation
Configuration of Hosts and Services
Monitoring Dashboards
Nagios

By the end of this tutorial, you'll have a fully functional Nagios system up and running, helping you maintain the reliability and security of your network. Don't forget to like, subscribe, and hit the notification bell to stay updated on more tech tutorials and tips. Thanks for watching!

*Installation Steps*

Prerequisites
Before we begin, make sure that you have a server running either CentOS or RHEL 9/8, with root access or a user with sudo privileges. Additionally, ensure that your server is up-to-date by running the following command:

yum update -y

Step 1: Install Required Dependencies
Before we install Nagios, we need to install a few dependencies: Apache web server, PHP, and GCC. You can install these by running the following command:
yum groupinstall "development tools"
yum install httpd php php-cli gcc unzip wget glibc glibc-common gd gd-devel net-snmp

Step 2: Create a Nagios User and Group
Nagios requires a user and group to run its processes. To create these, run the following commands:
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

Step 3: Download Nagios Core
To download Nagios Core, we will use the wget command to download the latest version of Nagios Core from the official website. Run the following command to download it:
wget https://assets.nagios.com/downloads/n...

Once the archive has been downloaded, we can extract it using the following command:
tar xzf nagios-4.4.10.tar.gz

Step 4: Compile Nagios Core
To compile Nagios Core, navigate to the extracted directory using the following command:
cd nagios-4.4.10

Next, run the following command to compile Nagios Core:
./configure --with-command-group=nagios
make all

Step 5: Install Nagios Core
Once the compilation is complete, we can install Nagios Core by running the following commands:
make install
make install-commandmode
make install-init
make install-config
make install-webconf

Step 6: Install Nagios Plugins
Nagios Plugins are required to extend the functionality of Nagios Core. After installing and configuring core service, Download latest nagios-plugins source and install using the following commands.

wget http://nagios-plugins.org/download/na...
tar xzf nagios-plugins-2.4.3.tar.gz
cd nagios-plugins-2.4.3

Now compile and install nagios plugins
./configure --with-nagios-user=nagios --with-nagios-group=nagcmd
make
make install

Step 7: Configure Nagios
To configure Nagios, we need to edit the Nagios configuration file. To do this, run the following command:
vi /usr/local/nagios/etc/nagios.cfg

In the configuration file, check for the following line, add them if not available:
cfg_file=/usr/local/nagios/etc/objects/commands.cfg
cfg_file=/usr/local/nagios/etc/objects/contacts.cfg
cfg_file=/usr/local/nagios/etc/objects/timeperiods.cfg
cfg_file=/usr/local/nagios/etc/objects/templates.cfg

cfg_file=/usr/local/nagios/etc/objects/localhost.cfg

Save and close the file.

Step 8: Set up Authentication
By default, Nagios requires authentication to access the web interface. To set up authentication, run the following command to create an admin user:
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Enter a password to complete the process

Step 9: Verify and Start Services
First, verify the Nagios configuration file using the following command.

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

If there is no error found, run the following command to enable and start Nagios service:
systemctl enable --now nagios

Next, start the Apache web server using the following command:
systemctl enable --now httpd


Step 10: Access the Nagios Web Interface
Finally, you can access the Nagios web interface by navigating to http://your-server-ip-hostname/nagios in your web browser. You will be prompted to enter the username and password you created in step 8.

______________________________________________________________________________

#linuxbasics #learnbengali #linux #learnlinux #rhel #linuxos #linuxforbeginners #linuxadministration #linuxtutorial #youtube #subscribe #ansible #ansibleinbengali #bgmi #bms #linuxos #nagios