• notice
  • Congratulations on the launch of the Sought Tech site

Install and configure Nagios on CentOS 7

In this tutorial, we will show you how to install Nagios on CentOS7.Nagios is a powerful open source enterprise software that can monitor network infrastructure, servers and applications.It can be used to monitor Linux and Windows servers and Web applications, Linux and Unix applications, and Windows applications.Some of these features include: parallel service check, plug-in system, sending notifications via email, pager or user-defined service, web interface for viewing status , log files, problem history and notifications, etc.This guide is also applicable to other Linux VPS systems, but it has been tested and written for CentOS 7 VPS.   

Update CentOS 7 server and install necessary packages

Log in to your VPS via SSH as a sudo user:

ssh userame@IP_Address

After logging in, issue the following command to ensure that all installed packages are up to date:


sudo yum update

Next, use the following command to install the prerequisite packages required to install Nagios:

sudo yum install gcc glibc glibc - common wget unzip httpd php gd gd - devel perl postfix

Install Apache, MariaDB and PHP 7

To install Nginx, MariaDB PHP 7 and all required PHP modules on the CentOS server, run the following command:

sudo yum install httpd mariadb - server php php - mysql

After completing the MariaDB installation, run the following command to secure the MariaDB installation:

sudo mysql_secure_installation

Enable MariaDB and Apache to start at system startup:

sudo systemctl enable httpd.service
sudo systemctl enable mariadb.service

Download and install Nagios

Use the following command to download the latest stable version of the Nagios tar archive in the /tmp directory of the server:

wget https :// github.com / NagiosEnterprises / nagioscore / archive / nagios - 4.4.1.tar.gz - O / tmp / nagioscore.tar.gz

After the download is complete, change to the tmp directory and use the following command to decompress the archive:

cd / tmpsudo tar xf nagioscore.tar.gz

After decompressing the Nagios plugin archive, switch to the nagioscore-nagios-4.4.1 directory:

CD / tmp / nagioscore - Nagios - 4.4..1

The next step is to run the./configure script, which will check the system for missing libraries and binaries, and prepare the Nagios source code for the build process:

./ the configure

Now that the configuration is complete, use the make all command to start the compilation process:

make all

Run the following command to create the nagios user and group, and add apache to the nagios group:

sudo make install - groups - users
sudo usermod - a - G nagios apache

The next step is to install Nagios using the make install command:

sudo make install

Run the following command to install the Nagios sample configuration file:

sudo make install - config

Install the initialization script so that you can use the systemctl command to manage the Nagios service:

sudo make install - daemoninit

Next, install the Apache web server configuration file:

sudo make install - webconf

Restart the apache service:

sudo systemctl restart httpd

Use the htpasswd command to create a user account named nagiosadmin

the htpasswd the sudo - C / usr / local / Nagios / etc / the htpasswd.Users nagiosadmin

Run the following commands to install and configure the external command file:

sudo make install - commandmode

Install Nagios plugin

Before downloading and compiling the Nagios plugin, please install the following dependencies:

sudo yum install gcc glibc glibc - common make gettext automake autoconf wget openssl - devel net - snmp net - snmp - utils epel - release perl - Net - SNMP

Use the following command to download the latest stable version of the Nagios tar archive in the /tmp directory of the server:

wget - no - check - certificate - O / tmp / nagios - plugins.tar.gz https :// github.com / nagios - plugins / nagios - plugins / archive / release - 2.2.1.tar.gz

After the download is complete, change to the tmp directory and use the following command to decompress the archive:

cd / tmp
sudo tar xf nagios - plugins.tar.gz

After decompressing the Nagios plugin archive, switch to the nagioscore-nagios-4.4.1 directory:

cd / tmp / nagios - plugins - release - 2.2.1 /

The following command will check the system for missing libraries and binaries, and prepare the Nagios plugin source code for the build process:

./ Tools / Setup
./ the configure

After the configuration is complete, use the make command to start the compilation process:

make

Finally, use the make install command to install the Nagios plugin:

sudo make install

Visit Nagios

Now that you have installed Nagios and Nagios plugins on the CentOS system, use the following command to start the Nagios service

systemctl start nagios

Open your browser and navigate to http://your-domain-or-ip/nagios, you will see a login pop-up window.

Enter the login credentials you created with the htpasswd command, and you will be redirected to the Nagios homepage,

OK. Now you have successfully installed Nagios on CentOS 7. For more information on how to manage Nagios installation, please refer to the official Nagios documentation


Tags

Technical otaku

Sought technology together

Related Topic

1 Comments

author

order lipitor for sale & lt;a href="https://lipiws.top/"& gt;lipitor 10mg brand& lt;/a& gt; oral atorvastatin 10mg

Rveheg

2024-03-08

Leave a Reply

+