Linux serverNETWORK ADMINISTRATIONS

Install & Configure Nagios 4 on Redhat Enterprise Linux 8 (RHEL/CentOS)

Nagios is configured using text files and provides an intuitive web interface for administration and monitoring. In case of an issue, service degradation or outage, Nagios will send alerts via Email, SMS or even a phone call if configured to do so.

Login as root user and Follow steps below to install and configure Nagios 4 monitoring server on RHEL after you have configure local repository.
DNF/YUM video link:

1. Set SELinux in permissive mode:
# sed -i ‘s/SELINUX=.*/SELINUX=permissive/g’ /etc/selinux/config
# setenforce 0

2. Install required packages.
# dnf install @php -y
# dnf install @perl @httpd wget unzip glibc automake glibc-common gettext autoconf php php-cli gcc gd gd-devel net-snmp openssl-devel unzip net-snmp postfix net-snmp-utils -y

3. Install Development Tools on RHEL / CentOS 8.
# dnf groupinstall “Development Tools”

4. After the installation, start and enable httpd and php-fpm services.
# systemctl enable –now httpd php-fpm

5. Confirm services status.
# systemctl status httpd php-fpm

6. Change your working directory to /usr/src.
# cd /usr/src

7. Then download and extract Nagios tarball.
# export VER=”4.4.5″
# curl -SL https://github.com/NagiosEnterprises/nagioscore/releases/download/nagios-$VER/nagios-$VER.tar.gz | tar -xzf –

8. Change to created Nagios folder.
# cd nagios-$VER

9. Compiling Nagios Core on RHEL 8 / CentOS 8. After extracting the archive, run the configure script
# ./configure

10. Run the make command with all option to compile the main program and CGIs.
# make all

11. Create User And Group. Below commands creates the nagios user and group. The apache user is also added to the nagios group.
# make install-groups-users
# usermod -a -G nagios apache

12. Install Nagios on RHEL / CentOS 8 base.
# make install

13. Install the init script in /lib/systemd/system.
# make install-daemoninit

14. Install and configures permissions on the directory for holding the external command file.
# make install-commandmode

15.Install sample config files in /usr/local/nagios/etc.
# make install-config

16. Install the Apache config file for the Nagios web interface.
# make install-webconf

17. Installs the Exfoliation theme for the Nagios web interface.
# make install-exfoliation

18. Install the classic theme for the Nagios web interface.
# make install-classicui

19. Create Nagios Web user:
You need to add a user account for accessing the Nagios web interface.
# sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Provide password twice.

20. Enter and confirm password for the user. You also need to restart the Apache service for changes to take effect:
# systemctl restart httpd

21. Now Install Nagios Plugins:
21.(a) Nagios plugins are used to extend Nagios monitoring features. Switch to /usr/src directory.
# cd /usr/src

21.(b) Download Nagios plugins from Github releases page.
# VER=”2.2.1″
# curl -SL https://github.com/nagios-plugins/nagios-plugins/releases/download/release-$VER/nagios-plugins-$VER.tar.gz | tar -xzf –

22. Change to the plugins source directory:
# cd nagios-plugins-$VER

23. Compile and install Nagios plugins by running commands below.
# ./configure –with-nagios-user=nagios –with-nagios-group=nagios
# make && make install

24. Confirm that your Nagios installation was successful and working.
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

25. Enable nagios service.
# systemctl enable –now nagios

26. Service status should indicate running.
# systemctl status nagios

27. Access Nagios Web Dashboard. Allow http and https protocols on the firewall.
# firewall-cmd –permanent –add-service={http,https}
# firewall-cmd –reload

28. During installation, an Apache configuration file for Nagios was added. You can access the dashboard on http:[IP/hostname]/nagios/
Authenticate with username and password added earlier.

Username: nagiosadmin
You should see Nagios Dashboard where you can add devices to be monitored.
You are done. You have successfully installed and configured Nagios 4 in RHEL 8.
======

Reset Root Password in RHEL 8:

Logical Volume Management in RHEL 8:

Configure VNC in RHEL:

Create Swap File in RHEL 8:

========
Contact Us:

To Follow Vikas Nehra’s Twitter Handle:👇
http://bit.ly/VikasNehraTwitterHandle

For Registration:👇
http://bit.ly/NehraClassesRegForm

To Visit Our Facebook Page:👇
www.facebook.com/nehraclasses

To Follow Nehra Classes on Instagram:👇
https://www.instagram.com/nehraclasses/

To Our Visit Our Webpage:👇
http://bit.ly/NehraClassesWebpage

Join Us on Telegram App: 👇
https://t.me/NehraClasses

WhatsApp Us: 👇
https://bit.ly/2Kpqp5z

Email Us:👇
Email: nehraclasses@gmail.com
===
©COPYRIGHT. ALL RIGHTS RESERVED.

#NehraClasses #LinuxTraining

source

centos 8

4 thoughts on “Install & Configure Nagios 4 on Redhat Enterprise Linux 8 (RHEL/CentOS)

  • Hi, how many host(Windows) can we add in Nagios core? currently one of our client Nagios XI version tool and due to high price they want to move free software that is like Nagios core. if we move Nagios core can we restore Nagios XI database to Nagios core? please advise here.

Comments are closed.