Install Nagios Core from RPM on CentOS 7 / RHEL 7

nagios_logo
Nagios is a free software, which offers monitoring and alerting services for servers, switches, applications and services.

This tutorial describes simple Nagios Core and Nagios Plugins installation from rpm packages on CentOS 7 / RedHat 7. There is no need to configure and compile Nagios Core tar.gz based source files unless you really need the newest version.

Steps:

1. Install Apache HTTP server

Install httpd rpm from the default repo:

[root@tuxfixer ~]# yum install httpd

2. Prepare Rpmfind repository

We will use Rpmfind repository (www.rpmfind.net) to download Nagios Core and Nagios Plugins.

Create rpmfind repository file:

[root@tuxfixer ~]# touch /etc/yum.repos.d/rpmfind.repo

Edit repository file to look like below:

# Rpmfind repository file

[rpmfind]
name=Rpmfind repository
baseurl=ftp://195.220.108.108/linux/epel/7/x86_64/
enabled=1
gpgcheck=0

Verify repository list:

[root@tuxfixer ~]# yum repolist

3. Install Nagios rpms

[root@tuxfixer ~]# yum install nagios nagios-common nagios-plugins-all

4. Setup Nagios admin password

Create new password for nagiosadmin:

[root@tuxfixer ~]# htpasswd -c /etc/nagios/passwd nagiosadmin

5. Enable services

Start and enable httpd service:

[root@tuxfixer ~]# systemctl start httpd
[root@tuxfixer ~]# systemctl enable httpd

Start and enable nagios service:

[root@tuxfixer ~]# systemctl start nagios
[root@tuxfixer ~]# systemctl enable nagios

6. Configure firewalld for Apache and Nagios

Open port 80/tcp to allow http traffic:

[root@tuxfixer ~]# firewall-cmd --zone=public --add-port=80/tcp --permanent

Reload firewalld service:

[root@tuxfixer ~]# firewall-cmd --reload

7. Connect to Nagios Dashboard

Navigate to Nagios WebGUI in your Web Browser:

http://host_ip/nagios

Log in using credentials: nagiosadmin / password_you_set_in_step_4

nagios core installation from rpms on centos 7 red hat 7

4 thoughts on “Install Nagios Core from RPM on CentOS 7 / RHEL 7

  1. Steve Swaney May 26, 2018 at 16:13

    Thanks. Dead easy to install from your directions.

  2. Eric June 4, 2018 at 12:10

    This is great! Very straightforward and easy! Thanks!

  3. snehal sarode July 20, 2018 at 06:50

    Hi I follow the same steps but i get error in nagios web UI. This error i am facing Whoops! Error: Could not read object configuration data!. Is there any solution to resolve this error.

    • Grzegorz Juszczak July 20, 2018 at 21:08

      Hi
      It looks like permissions problem. Perhaps webserver process/user is not able to access some of nagios directories.

Leave a Reply

Name *
Email *
Website

This site uses Akismet to reduce spam. Learn how your comment data is processed.