1. Overview
Nagios Core is an open-source, performance monitoring application for network monitoring tools, server monitoring tools, and application performance monitoring. It is used to monitor hosts and services such such as host up/down status, CPU usage, memory usage, switch or router interface up/down status , and more. It will send an alert when things go bad and when they get better.
In this article will show how to install Nagios Core for network monitoring tools, server monitoring tools, and application performance monitoring on CentOS 7. At the time of writing this document, the latest Nagios Core version that available to download is 4.3.2 and Nagios plugins version is 2.2.1.
2. Prerequisites
In this tutorial of installing Nagios for network monitoring tools, server monitoring tools, and application performance monitoring, it is supposed that:
a. You have already install RHEL/CentOS 7 Linux server up and running. In case that you don’t, you would probably like to read this link. Minimal RHEL/CentOS 7 Installation With Logical Volume Manager (LVM).
b. You have already done the initial server setup. Please refer to this link Minimal RHEL/CentOS 7 Initial Server Setup.
3. Install Required Packages
Since we are going to build Nagios for network monitoring tools, server monitoring tools, and application performance monitoring from the source code, it is mandatory to install some prerequisites packages for Nagios Core development libraries as the following.
# yum -y install httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp openssl-devel wget unzip
4. Install Nagios Core
Before we start to download and install Nagios network monitoring tools, server monitoring tools, and application performance monitoring, we need to disable SELinux first. After change SELinux configuration file, we need to reboot the server to take affect.
# vim /etc/selinux/config SELINUX=disabled # reboot
After the server reboot, we can verify SELinux status with the following command.
# sestatus SELinux status: disabled
Now we need to create a user and group to run Nagios network monitoring tools, server monitoring tools, and application performance monitoring process. Let create a user account name “nagios” and a group name “nagcmd”. Then, we need to add the user to the group with the following commands.
# useradd nagios # groupadd nagcmd # usermod -a -G nagcmd nagios # usermod -a -G nagcmd apache
After we finished installing the required dependencies and adding user accounts. Now we can start Nagios for network monitoring tools, server monitoring tools, and application performance monitoring installation. Download latest Nagios for network monitoring tools, server monitoring tools, and application performance monitoring from the official website as the following.
# cd /tmp # wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.3.2.tar.gz
We need to extract downloaded package using command tar as the following.
# tar zxf nagios-4.3.2.tar.gz # cd nagios-4.3.2
Now that the files are extracted, we can start compiling Nagios for network monitoring tools, server monitoring tools, and application performance monitoring as the following.
# ./configure --with-command-group=nagcmd # make all # make install # make install-init # make install-config # make install-commandmode # make install-webconf
Now we need to setup apache authentication for user nagiosadmin. For the begging, it is better not change this username, so we are not required to do more changes in Nagios for network monitoring tools, server monitoring tools, and application performance monitoring configuration.
# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
5. Install Nagios Plugins
Now Nagios for network monitoring tools, server monitoring tools, and application performance monitoring is installed. Then, we need to install the Nagios plugins so that Nagios Core can utilize these plugin for checks.
# cd /tmp # wget http://www.nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz
We need to extract downloaded package using command tar as the following.
# tar zxf nagios-plugins-2.2.1.tar.gz # cd /tmp/nagios-plugins-2.1.
Nowe we can start to building Nagios Plugins with the following commands.
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl # make all # make install
If everything worked just correctly after install Nagios for network monitoring tools, server monitoring tools, and application performance monitoring and Nagios plugin, we should be able to start your Nagios Core service.
# systemctl restart httpd # systemctl restart nagios
Now we should be able to access Nagios for network monitoring tools, server monitoring tools, and application performance monitoring from web browser by enter http://yourserverip/nagios in the address box.
6. Troubleshoot Nagios HTTP WARNING
Nagios is also a web server monitoring software as we can see the above picture, there one warning on HTTP service on Nagios for network monitoring tools, server monitoring tools, and application performance monitoring host telling that “HTTP WARNING: HTTP/1.1 403 Forbidden”. To solve this warning, we need to create a file name “index.html” default Apache root directory /var/www/html.
# cd /var/www/html # touch index.html
Then, we need to restart Apache and Nagios services.
# systemctl restart httpd # systemctl restart nagios
If we don’t want wait for Nagios process to recheck the service, we can force is check the service manually by click on the service that we want to force check, and then click on “Re-schedule the next check for this service”.
Now the warning is gone and we get the message “HTTP OK HTTP/1.1 200 OK” instead.
6. Conclusion
That’s all about Installing Nagios performance monitoring application as a network monitoring tools, server monitoring tools, and application performance monitoring for IT infrastructure monitoring on RHEL/CentOS 7 from Tech Space KH. Nagios performance monitoring application is one of the best network monitoring tools and server monitoring tools. Hopefully, you can find this guide informative. If you have any questions or suggestions you can always leave your comments below. I will try all of my best to review and reply them.