Hey @Kiran, installing Nagios requires you to have apache and php installed.
let's start with installing apache
sudo apt update
sudo apt install apache2
Install PHP
sudo apt install php php-cgi libapache2-mod-php php-common php-pear php-mbstring
Install nagios Server packages
sudo apt install nagios3 nagios-plugins-basic
The above command will prompt you to create a password for your Nagios account
Configure Nagios server
Go to sudo nano /etc/nagios3/nagios.cfg and make the following changes
# EXTERNAL COMMAND OPTION
# This option allows you to specify whether or not Nagios should check
# for external commands (in the command file defined below). By default
# Nagios will *not* check for external commands, just to be on the
# cautious side. If you want to be able to use the CGI command interface
# you will have to enable this.
# Values: 0 = disable commands, 1 = enable commands
check_external_commands=1
Open Nagios apache config file and limit the access from the localhost and local subnet
sudo nano /etc/nagios3/apache2.conf
Adjust Nagios folder permission
sudo chgrp -R www-data /var/lib/nagios3
chmod 750 /var/lib/nagios3/rw
Restart Nagios and Apache
sudo systemctl restart nagios3.service
sudo systemctl restart apache2.service
Open browser with server hostname or IP address
https://localhost/server-ip
It'll prompt for username and password
Username- nagiosadmin
Password - Whatever you've created