Deep Dive in to Virtualization & Cloud

Nagios Core Install & Configure

Nagios, now known as Nagios Core, is a free and open source computer-software application that monitors systems, networks and infrastructure. Nagios offers monitoring and alerting services for servers, switches, applications and services. It alerts users when things go wrong and alerts them a second time when the problem has been resolved.

Nagios is available in two versions, Nagios Core and Nagios XI. Nagios Core is free, and Nagios Xi has many features, and which is not free. You can compare and download of both versions in this link.

In this blog we will cover how to install and configure Nagios Core 4.4.3 on CentOS 7.

Install & Configure Nagios Core

Once you install and configure your Operating system install the below dependencies like Apache, PHP, SNMP etc

#yum install httpd php php-cli gcc unzip wget glibc glibc-common gd gd-devel net-snmp

Start the Apache service and add same to startup by executing below command

#systemctl start httpd
#chkconfig httpd on

Now create a new nagios user account and setup a password to this account

#useradd nagios
#passwd nagios

Now create a groud for nagios setup “nagcmd” and add nagios user to this group. Also add nagios user in apache group

#groupadd nagcmd
#usermod -a -G nagcmd nagios
#usermod -a -G nagcmd apache

After installing required dependencies and adding user accounts and groups. Let’s start with Nagios core installation.

#cd /opt/
#tar xzf nagios-4.4.3.tar.gz
#cd nagios-4.4.3
#./configure --with-command-group=nagcmd
#make all
#make install
#make install-init
#make install-daemoninit
#make install-config
#make install-commandmode
#make install-exfoliation

Now use below command to setup Apache configuration for Nagios installation.

#make install-webconf

Now setup apache authentication for user ngiosadmin. Do not change this username. else you would require more changes in configuration.

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

Now restart Apache service to make the new settings take effect.

#systemctl restart httpd

After installing and configuring Nagios core service, download latest nagios-plugins source and install using following commands.

#cd /opt
#tar xzf nagios-plugins-2.2.1.tar.gz
#cd nagios-plugins-2.2.1

Now compile and install nagios plugins

#./configure --with-nagios-user=nagios --with-nagios-group=nagios
#make install

You have completed the installation now, First, verify the Nagios configuration file using the following command

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

If there are not error, let’s start the Nagios service

#systemctl restart nagios

Execute the below command to start nagios services and add in startup

#systemctls start nagios
#chkconfig nagios on

Nagios creates its own apache configuration file /etc/httpd/conf.d/nagios.conf. There is no need to make any changes to it. Simply open below URL in browser.

http://FQDN or IP Address/nagios/

Provide Apache authentication Username & Password we created while installation


If you have any comments, please drop me a line.
I hope this article was informative, and don’t forget to buy me a coffee if you found this worth reading.

Views: 0

Leave a Reply

Your email address will not be published. Required fields are marked *

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

About Me

A side profile of a woman in a russet-colored turtleneck and white bag. She looks up with her eyes closed.

Welcome to my blog! I’m Vysakh Nair, a Cloud Architect at Presight, a G42 company. With over 17 years in IT infrastructure, I have honed my skills in Azure, AWS, and VMware technologies. My expertise extends to both Microsoft and Linux environments, and I thrive on tackling challenges in Storage and Networking technologies. Join me as I share insights and experiences from my journey in the world of cloud architecture and IT infrastructure. Continue Reading