In this guide, we will show you how to install nagios 4.4.7 on Fedora36 and CentOS 9 systems.
Nagios Core, formerly known as Nagios, is a free and open-source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved.
Nagios is known for being the best server monitoring software on the market. Server monitoring is made easy in Nagios because of the flexibility to monitor your servers with both agent-based and agentless monitoring. With over 5000 different addons available to monitor your servers, the community at the Nagios Exchange have left no stone unturned.
Install Nagios 4.4.7
Just follow the steps below to install nagios 4.4.7
- Make sure that all system packages are up-to-date as follows:
dnf update -y && dnf upgrade -y
- First, install Apache, PHP and some libraries like gcc, gd, glibc-common and glibc by running the command below:
dnf install httpd httpd-tools net-snmp glibc-common gd gd-devel php gcc glibc make -y
- Create user and group for nagios as follows:
useradd nagios groupadd nagcmd
- Add nagios user and apache user to the nagcmd group
usermod -G nagcmd nagios && usermod -G nagcmd apache
- Then download the nagios 4.4.7 and nagios-plugins 2.3.3 by running the commands below:
mkdir /root/nagios cd /root/nagios wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.7.tar.gz wget https://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
- Also the required packages for the installation:
dnf install openssl-devel
- Extract Nagios and nagios Plugins as follows:
tar -xvf nagios-4.4.7.tar.gz tar -xvf nagios-plugins-2.3.3.tar.gz
compile nagios 4.4.7
- Next step is to configure the nagios core:
cd nagios-4.4.7 ./configure --with-command-group=nagcmd
- Compile and install the biaries with the two below commands:
make all make install
- Install the init scripts for nagios:
make install-init
- Also install command-mode for nagios to work from cli
make install-commandmode
- Finally, run the following command to install conf files for nagios
make install-config
- Also install webconf for nagios web working:
make install-webconf
- Create Auth user to log into the nagios web page:
htpasswd -s -c /usr/local/nagios/etc/htpasswd.users unixcopadmin
nagios-plugin 2.3.3
- Configure nagios plugin as follows:
cd .. ./configure --with-nagios-user=nagios --with-nagios-group=nagios
- Compile it with make and make install commands as shown below
make make install
- Verify the installation and the confs of nagios core
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
- Start nagios and httpd services as follows:
systemctl restart httpd.service systemctl start nagios.service
Access nagios core web interface
Open nagios in your favorite browser with http://Ip_address/nagios then enter the username unixcopadmin and your password as shown below in the screenshot
And, here we go, Nagios will be directed as follows
Conclusion
That’s it
Thanks.