What is Nagios?
Nagios is a free and open-source software application for computer systems. It is used for monitoring the systems, networks and infrastructure.
Its original name was NetSaint developed by Ethan Galstad with the group of some developers in the year 1999.
This software application mainly provides the services of monitoring and alerting for switches, applications, and servers inside the DevOps culture.
It is also used to notify the users when the things go bad, and also alerts them when the things become better.
This software application is available in its following two variants:
Following are some reasons for using the Nagios software application:
History of Nagios
In this year, Ethan Galstad creates a new application using the third-party application which is used for creating the Nagios.
In this year, Ethan starts to build a new application using the ideas and architecture which is designed to run under Linux.
He releases his work which is done in the year of 1998 as a free and open-source project under the name "NetSaint". He hopes that there are one dozen people who are interested in this application.
In this year, he decided to rename the project name as Nagios, because there was the trademark issue with the "NetSaint" name. And, the plugins project of 'NetSaint' is also moved to 'Nagios' plugins project.
In the June month of this year, the Nagios project becomes the SourceForge.Net project.
In this year, LinuxWorld.com rates the Nagios project in the enterprise as one of the top 5 open security tools.
In this year, Nagios is renamed as Nagios Core, and the enterprises of Nagios release the first commercial version of Nagios as Nagios XI.
In this year, Nagios BPI is released for monitoring the process of a business. And, the WebHostingSearch.com awarded Nagios as a "best web tool".
In this year, the 4th version of Nagios Core is released.
In this year, Nagios Core cross the 7,500,000 downloads from the SourceForge.Net website.
Features of Nagios
Following are the various features or characteristics of Nagios application:
Architecture of Nagios
The architecture of Nagios is built on the basis of server-client architecture.
The server of Nagios usually run on a host and the plugins run on the remote server/ or remote host which are to be monitored.
The plugins of Nagios collect the useful data and send them to the process scheduler, which displays the information over the graphical user interface (GUI).
Following are the three main components in the architecture of Nagios application:
The scheduler is the server part of the Nagios system. This component checks the plugins at regular interval and according to their results perform some action.
It is a user interface of the Nagios system, which is displayed on the web pages generated by the CGI. GUI can be a button to red or green, graph, sound, etc.
The button of green color becomes red color on GUI, when the plugins returns an error or warning.
Plugins is a component of the Nagios system, which is configurable by the users. This component detects the services and return the results to the server of Nagios.
Installation of Nagios Core
In this section, we will learn how to install the Nagios on Linux platform. So, follow the given steps for installing the Nagios:
Step 1: In this step, we have to install the packages Apache and Php which are required to be available on your ubuntu system.
So, firstly type the following command in the Linux terminal, which checks the latest updates:
Now, after the completion of the above command, run the following two commands one by one:
Step 2: In this step, we have to create a new user and group for Nagios in the system.
So, firstly type the following command to create a new user for Nagios:
After that, we have to create a new group and add the Nagios user to the Apache group.
Step 3: In this step, we have to download the latest package of Nagios Core from the official site.
But we will first change the directory to /opt/ using the following cd command:
Now, download the latest package of Nagios using the command which is given below:
Now, type the following command for extracting the tar file.
After extracting, again change the directory to nagios-4.4.5 by using the cd command:
After that, run the given command for compiling the Nagios from the source code:
Now, we have to install the Nagios with additional requirements using the make command:
After the successful execution of above commands, now, we will require to copy the scripts of event handler under the libexec directory using the following two commands.
Step 4: In this step, we have to set up an authentication gateway for preventing the unauthorized access to Nagios system:
So, firstly we have to create a configuration file of Apache for our Nagios server using the following command:
When the file is opened in terminal, then you have to type or paste the following code into your file, and then save and close the file.:
Now, we need to set up an authentication gateway of apache for the default user nagiosadmin, by executing the following command.
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Now, we have to enable the configuration of Apache and restart the Apache using the following three commands:
Step 5: After the installation and configuration of Nagios core services, we have to download and install the plugins of Nagios using the following commands. Firstly, we have to change the directory to /opt.
Now, download the plugins and extract the tar file :
Now, we have to compile and install the plugins using the following commands:
After the execution of above command, also run the following two commands on terminal:
Step 6: Now, we have to verify the installation and configuration file of Nagios using the following commands:
Now, type the following command for starting the Nagios service:
Now, enable the Nagios to start automatically on system boot:
Step 7: It is the last step, in this we have access to the web interface of Nagios using the IP address of a system. If you do not know the Ip address of your system, then you check by running the following command on terminal:
This command gives the following output. Here, below we specify the ip address:
After then, we have to type the following URL on a browser. The URL uses the IP address followed by /nagios like:
After pressing the enter key, browser takes us to the Apache authentication, here we have to enter the username and password, which are specified by us in the above steps:
After the successful login, you will get the home page of Nagios Core as shown in the following screenshot:
Advantages of Nagios Application
Following are the benefits or advantages of Nagios:
Disadvantages of Nagios
Following are the limitations or disadvantages of Nagios: