Difference between revisions of "Install and Configure Nagios Core"

From CNM Wiki
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 53: Line 53:
 
<code>systemctl restart apache2</code>
 
<code>systemctl restart apache2</code>
 
Create a user and set the password when prompted.
 
Create a user and set the password when prompted.
 +
  
 
<code>htpasswd -c -b /usr/local/nagios/etc/htpasswd.users nagiosadmin secret</code>
 
<code>htpasswd -c -b /usr/local/nagios/etc/htpasswd.users nagiosadmin secret</code>
 
<br />When configuring the Nagios server, you will be prompted to enter a password for
 
<br />When configuring the Nagios server, you will be prompted to enter a password for
 
nagiosadmin account for accessing the console.
 
nagiosadmin account for accessing the console.
 +
[[File:password.png]]
 +
 +
Details " we will see information about two servers that are added automatically when
 +
installation-the local server on which Nagios is installed and the server that performs the role of
 +
the internet gateway.
 +
 +
[[File:Nagios_service.png]]

Latest revision as of 16:21, 15 January 2023

The Nagios server is installed using the command:

Update the system packages. sudo apt update

Please note that in addition to these two dependency packages, there is still enough to install many additional programs and services.

apt install wget unzip curl openssl build-essential libgd-dev libssl-dev libapache2-mod-php php-gd php apache2 -y

Download Nagios Core Setup files. To download the latest version, visit the [official releases](https://github.com/NagiosEnterprises/nagioscore/releases)  site.

wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.9.tar.gz

Extract the downloaded files.

tar -zxvf nagios-4.4.9.tar.gz

Navigate to the setup directory.

cd nagios-4.4.9

Run the Nagios Core configure script.

/configure

Compile the main program and CGIs.

make all

Initialize all the installation configuration scripts.

make install-init
Install and configure permissions on the configs' directory.

make install-commandmode Install sample config files.

make install-config

Install apache files.

make install-webconf Enable apache rewrite mode.

sudo a2enmod rewrite Enable CGI config.

a2enmod cgi Restart the Apache service.

systemctl restart apache2 Create a user and set the password when prompted.


htpasswd -c -b /usr/local/nagios/etc/htpasswd.users nagiosadmin secret
When configuring the Nagios server, you will be prompted to enter a password for nagiosadmin account for accessing the console. Password.png

Details " we will see information about two servers that are added automatically when installation-the local server on which Nagios is installed and the server that performs the role of the internet gateway.

Nagios service.png