How to install Nagios monitoring tool on RHEL 8

Nagios Core is an open source PHP build IT infrastructure monitoring and alerting platform. It is used to monitor mission-critical IT infrastructure components, such as network infrastructure, servers, network protocols, system metrics, applications, and services.

In addition, Nagios Core support alerts via email, SMS or custom scripts (when critical infrastructure component failure and recovery), and report events, interrupt, history, notifications and alerts response for later analysis.

It is important, Nagios Core comes with multiple API, we can provide integration with existing or third-party applications and add-ons developed by the community.

This article will guide you through the process Nagios Core 4.4.3 and Nagios Plugins 2.2.1 installed on RHEL Linux distributions 8.

Claim:

  • RHEL8, minimum installation
  • RHEL8, the subscription is enabled
  • RHEL8 with a static IP address

Step 1: Installation required dependencies

1. install Nagios Core packages from source, you need to use the default dnf package manager to install the following dependencies, including Apache HTTP server and PHP.

# dnf install -y gcc glibc glibc-common perl httpd php wget gd gd-devel

2. Next, immediately starts HTTPD service to start automatically when the system boots, and use the command to check the status systemctl.

# systemctl start httpd
# systemctl enable httpd
# systemctl start httpd

Step 2: Download, compile and install Nagios Core

3. Now use wget command to download Nagios Core source packets, decompress it and move to the decompressor directory, as shown in FIG.

# wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.4.3.tar.gz
# tar xzf nagioscore.tar.gz
# cd nagioscore-nagios-4.4.3/

4. Next, run the following command to configure the source packet and build it.

# ./configure
# make all

Creating user and group 5. After Nagios, Apache and added to the user Nagios group, as shown below.

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

6. Now use the following command to install binary files, CGI and HTML files.

# make install
# make install-daemoninit

7. Next, run the following command to install external commands and configuration files, configuration files, and sample Apache-Nagios profile.

# Make install-commandmode # install and configure an external command file
# make install-config # * SAMPLE * installation configuration file.
# Make install-webconf # install the Apache Web server configuration file.

8. In this step, you need to use HTTP basic authentication to protect Nagios Core Web console. Therefore, you need to create a user account to log on Apache Nagios - This account will serve as Nagios Administrator account.

# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Step 3: RHEL 8 mounted in the plug Nagio

9. Next, you need to install the necessary Nagios plug-ins. But before you download and install Nagios plug-ins, you need to install the required packages to compile and build the plug-in package.

# dnf install -y gcc glibc glibc-common make gettext automake autoconf wget openssl-devel net-snmp net-snmp-utils

10. Then use the following command to download and unzip the latest version of Nagios plug-ins.

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

11. The mobile unzipped to compile, build and install Nagios plug, plug Nagios installation, as shown below.

# cd nagios-plugins-release-2.2.1/
# ./tools/setup
# ./configure
# make
# make install

12. At this point, you have set the Nagios Core Services and configure it for use with the Apache HTTP Server. Now you need to restart the HTTPD service. In addition, start and enable Nagios service, and check whether it is up and running as follows.

# systemctl restart httpd.service
# systemctl start nagios.service
# systemctl start nagios.service
# systemctl start nagios.service

Start Nagios Service

13. If a firewall is running, you need to open port 80 in the firewall.

# firewall-cmd --permanent --zone=public --add-port=80/tcp
# firewall-cmd --reload

14. Next, disable the default SELinux in enforcement mode, or you can set it to licensing model.

# sed -i 's/SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
# setenforce 0

Step 4: Visit the Nagios Web console in RHEL 8

15. In the last step, you can now access the Nagios Web console. For example, open a Web browser and point it to Nagios Core Web directory (replace with your own value IP address or FDQN).

http://192.168.56.100/nagios

or

http://tecmint.lan/nagios

You will be prompted to enter a user name and password to access the Web interface. Provide credentials that you created in the first 8:00 (ie nagiosadmin user name and password).

Nagios Log

After successfully logging in, you will see the Nagios interface, as shown in the screenshot below.

Nagios Web console

Congratulations! You have Nagios Core servers on RHEL 8 successfully installed. If you have any questions, please use the feedback form below to contact us.

via:https://www.tecmint.com/install-nagios-on-rhel-8/

翻译:Linuxidc

Guess you like

Origin www.linuxidc.com/Linux/2019-07/159434.htm