How To Install Nagios 4.x Server/Client – Part 1

How To Install Nagios 4.x Server/Client - Part 1

 Nagios is an open source tool for monitoring servers. when there is a good number of the server then health checks and server monitoring is a headache and Nagios is a good solution for such environment. It’s a lovely Open Source monitoring tool and always keep you updated about server health.

If you are using Nagios you can monitor server host on a single platform on your web browser. whenever there is a warning occurring (your setup limit), it shows the warning it sends you mail accordingly. It helps us to reduce downtime and business losses.

This post will help and instruct you to install Nagios4.0.1 from source (tarball) on RHEL 7.x/6.x/5.x, CentOS 7.x/6.x/5.x and Fedora 24-19 distributions. And its is really easy to setup and 100% effective and time-saving.


Server IP:
Nagios: nagios-4.0.1 and nagios-plugins-1.5
Installation Directory: /usr/local/Nagios
Nagios will be accessible at http://IP/nagios or http://localhost/nagios
By default, Nagios Will monitor Your local machine (Disk Usage, CPU Load, Current Users, Total Processes, etc.)

Step 1: Install Required Packages For compilation

Step 2: Create Nagios User and Group

Create a new Nagios user and nagcmd group account and set a password.

Step 3: Download Nagios Core 4.0.1 and Nagios Plugin 2.1.2

Step 4: Extract Nagios Core and its Plugins

Step 5: Configure Nagios Core

Sample Output

Creating sample config files in sample-config/ …
*** Configuration summary for nagios 4.0.1 017-04-2017 ***:
General Options:
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagcmd
Event Broker: yes
Install ${prefix}: /usr/local/nagios
Install ${includedir}: /usr/local/nagios/include/nagios
Lock file: ${prefix}/var/nagios.lock
Check result directory: ${prefix}/var/spool/checkresults
Init directory: /etc/rc.d/init.d
Apache conf.d directory: /etc/httpd/conf.d
Mail program: /bin/mail
Host OS: linux-gnu
IOBroker Method: epoll
Web Interface Options:
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP): /usr/bin/traceroute
Review the options above for accuracy. If they look okay,
type ‘make all’ to compile the main program and CGIs.

Now Make Final Hit to make it small (do not forget I am putting semicolon)

Step 6: Customizing Nagios Configuration


Step 7: Install and Configure Web Interface for Nagios

We have already installed Web Interface (make install-webconf) so need to run this but following are needed

[[email protected] nagios-4.0.1 ]# htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

New password: Re-type new password: Adding password for user nagiosadmin and restart Nagios and Apache

Step 8: Compile and Install Nagios Plugin

Step 8: Checking Configuration and Adding service at start up

Step 9: Checking Configuration and Adding service at start up

Login Using http://localhot/nagios or http://IP/nagios and provide the username “nagiosadmin” & YourPassword

Here You Can see The Host 

How To Install Nagios 4.x Server/Client - Part 1

See Services which are being Monitored

How To Install Nagios 4.x Server/Client - Part 1