How to Install Nagios 4.4.9 On ubuntu 22.04
Nagios is a strong IT foundation checking device planned to give a smooth execution of cycles in an association. Nagios screens the continuous exercises of the host and it gives a caution assuming something awful occurs.
The Nagios support is accessible for Linux and Microsoft-based working frameworks. Ubuntu is a generally utilized dispersion of Linux which is outfitted with the most recent elements and an intuitive connection point. Ubuntu 22.04 is the most recent LTS delivered as of late.
Keeping in view the significance of Nagios, this post gives a bit by bit methodology to introduce Nagios on Ubuntu 22.04.
First, change hostname your server
hostnamectl set-hostname nagios-ubnt22
Change static IP Address
I set the IP address 192.168.1.20/24
Match your network
nano /etc/netplan/00-installer-config.yaml
press ctrl + x for save
hostnamectl
Update and upgrade the Ubuntu system’s packages via the following command.
apt update -y && apt upgrade -y
Install the apache, php, openssl, and relevant dependencies. You can introduce them independently, yet getting them with a solitary command is suggested.
apt install wget unzip vim curl openssl build-essential libgd-dev libssl-dev libapache2-mod-php php-gd php apache2 -yReboot Server
reboot
Download the tar.gz file via the following command.
wget https://github.com/NagiosEnterprises/nagioscore/releases/download/nagios-4.4.9/nagios-4.4.9.tar.gz
Extract and install nagios by following the steps.
tar -zxvf nagios-4.4.9.tar.gz
./configure
make all
make install-groups-users
usermod -a -G nagios www-data
make install
make install-daemoninit
make install-commandmode
make install-config
make install-webconf
a2enmod rewrite cgi
systemctl restart apache2
make install-classicui
For security, enable ufw (firewall) on your ubuntu server
ufw enable
ufw allow apache
ufw openssh
ufw reload
Make another Nagios client as we did here. The beneath referenced order makes a client named "nagiosadmin" and the result will request that you set a secret key for "nagiosadmin" client.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Download the tar.gz file with the help of the following command.
wget https://nagios-plugins.org/download/nagios-plugins-2.3.3.tar.gz
Extract nagios-plugins
tar -zxvf nagios-plugins-2.3.3.tar.gz
nagios-plugins-2.3.3
Execute the following command to run the configure script for Nagios user and group.
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make install
Let’s start with checking the version of installed Nagios as follows.
sudo /usr/local/nagios/bin/nagios -v
systemctl restart apache2 nagios
systemctl status apache2 nagios
Make sure the service apache2 and nagios are running
open your browser : http://192.168.1.20/24
username : nagiosadmin
password : yourpassword
Congratulations, you have already install nagios 4.4.9 on ubuntu 22.04 server version.
Thank you :)

Comments
Post a Comment