How To Install Nagios on CentOS 7


For those of you who didn’t know, Nagios is an open source software that can be used for network and infrastructure monitoring. Nagios will monitor servers, switches, applications and services. It alerts the System Administrator when something went wrong and also alerts back when the issues has been rectified. Resources that can be monitored include CPU, memory and disk space loads, log files, temperature or hardware errors. It can monitor various parameters and problems for services like HTTP, SMTP, DNS, and with the help of plugins it can be highly extended.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation nagios on centos 7.

Install Nagios on CentOS 7

Step 1. First, Install required packages and dependencies.

Step 2. Create “nagios” user and add “apache” user to Nagios group.

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

Step 3. Install Nagios on CentOS 7.

Download Nagios source code from official site:

Download latest nagios-plugins source and install using following commands:

Step 4. Configure Apache authentication.

We need to setup the password for the user nagiosadmin. This username will be used to access the web interface so it is important to remember the password that you will input here. Set the password running the following command and enter the password twice:

Step 5. Run Nagios configuration check.

Next we have to make Nagios start at boot time, so first verify that the configuration file has no errors running the following command:

And you should get the output:

Step 6. Start the apache and nagios service.

Step 7. Access Nagios Web Interface.

Nagios creates its own apache configuration file /etc/httpd/conf.d/nagios.conf. There are no need to make any changes to it. Simply open url in browser http://nagios-server-ip/nagios.

When prompted for username and password you will introduce the username “nagiosadmin” and the password that you entered in step 4. In case you forget this password you can modify it by rerunning the htpasswd command in step 4.


Congratulation’s! You have successfully installed nagios. Thanks for using this tutorial for installting nagios on centos 7 systems.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!