Nagios Core: What is Nagios and how to install it on Debian GNU / Linux?
In the field of Networks and Servers, there are excellent and efficient applications for System/Server Administrators (SysAdmins) . Therefore, today we will talk about a well-known one called "Nagios Core".
"Nagios Core" is essentially the free version of "Nagios ," which is a popular open-source program for monitoring devices, services, and networks.
Webmin: Administration from the web browser
And since we rarely address topics related to applications, programs, and systems in the field of Networks and Servers or specifically for use by System/Server Administrators (SysAdmins) , we will immediately leave below some links to previous publications related to this IT field:
Webmin is a web-based system configuration tool for OpenSolaris, GNU/Linux , and other Unix-like systems. It allows you to configure internal aspects of many operating systems, such as users, disk quotas, services, configuration files, system shutdown, and more. You can also modify and control many open-source applications, including the Apache web server, PHP, MySQL, DNS, Samba, and DHCP. Webmin : Administration from the web browser

Nagios Core: Free and free version of Nagios
What is Nagios Core?
According to the official Nagios website , "Nagios Core" is described as follows:
“ Nagios® Core™ is an open-source system and network monitoring application. It monitors the hosts (computers) and services you specify, alerting you when things go wrong and when they improve. Nagios Core was originally designed to run under Linux, although it should also work under most other Unix-based operating systems. Furthermore, it is the free version of our current tool called Nagios XI. ”
Features
Among the many features of "Nagios Core", the following 10 can be mentioned:
- Monitoring network services (SMTP, POP3, HTTP, NNTP, PING, among others.)
- Monitoring the resources of the different monitored hosts (Processor load, disk usage, among others.)
- A simple plugin design that allows users to easily develop their own service checks.
- Parallel service checks.
- The ability to define the network host hierarchy using "parent" hosts, allowing you to detect and distinguish between hosts that are down and those that are unreachable.
- Contact notifications when host or service issues occur and are resolved (by email, pager, or user-defined method).
- The ability to define event handlers to run during host or service events for proactive troubleshooting.
- Automatic rotation of log files.
- Support for implementing redundant monitoring hosts.
- An optional web interface to view the current status of the network, the history of notifications and problems, the log file, and more.
How to install it on Debian GNU / Linux 10?
Before we begin this section, it's worth noting, as usual, that for this practical example we'll be using the standard Respin Linux distribution called MilagrOS GNU/Linux , which is based on MX Linux 19 (Debian 10) . This distribution was built following our " Guide to Taking Snapshots of MX Linux ".
However, any GNU/Linux distribution that supports Systemd can be used . Therefore, we will use this MX Linux Respin , booting from the GRUB boot system with the "Boot with Systemd" option , instead of its default setting, which is without Systemd (or rather, with Systemd-shim ). We will also execute all commands as the Sysadmin user , instead of the root user , of this Respin Linux.
And now, for its download, installation and use , we will use the " Quick Start Installation Guide for Debian " and these would be the commands to execute in the terminal (console) of your Operating System:
1.- Steps to prepare the Operating System
Update the repositories and install essential packages needed to work with "Nagios Core".
sudo apt update
sudo apt install autoconf gcc libc6 make wget unzip apache2 apache2-utils php libgd-dev
2.- Download the current software
cd /tmp
wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.4.6.tar.gz
tar xzf nagioscore.tar.gz
3.- Compile the current software
cd /tmp/nagioscore-nagios-4.4.6/
sudo ./configure --with-httpd-conf=/etc/apache2/sites-enabled
sudo make all
4.- Create Users and Groups
sudo make install-groups-users
sudo usermod -a -G nagios www-data
5.- Install various essential packages
sudo make install
sudo make install-daemoninit
sudo make install-commandmode
sudo make install-config
6.- Install Apache configuration files
sudo make install-webconf
sudo a2enmod rewrite
sudo a2enmod cgi
7.- Install and configure the Firewall via IPTables
sudo apt install iptables
sudo iptables -I INPUT -p tcp --destination-port 80 -j ACCEPT
sudo apt install -y iptables-persistent
8.- Create User account in Apache to start in Nagios Core
sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
9.- Restart / Start Necessary Services
systemctl restart apache2.service
systemctl start nagios.service
Note : Restart your operating system if you experience problems with these commands.
10.- Login to Nagios Core
Run a Web Browser on the local machine if you have a Graphical User Environment (GUI) or on another computer on the Network. And in the address bar write any of the following command commands as you see fit:
http://127.0.0.1/nagios
http://localhost/nagios
http://nombreservidor.dominio/nagios
Nota: If you do not see the "Nagios Core Login" window, check that your Operating System based on Debian GNU / Linux 8/9/10 has the correct configuration. "Document root" of the Apache server inside the following configuration file: /etc/apache2/apache2.conf. Replace the path /var/www by the following: /var/www/html. Then restart the Apache Service or Computer, and try again on the computer.
Installing Nagios Core Plugins
Update the repositories and install essential packages needed to work with "Nagios Plugins".
sudo apt update
sudo apt install autoconf gcc libc6 libmcrypt-dev make libssl-dev wget bc gawk dc build-essential snmp libnet-snmp-perl gettext
Download and unzip the current package with the "Nagios Plugins"
cd /tmp
wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.2.1.tar.gz
tar zxf nagios-plugins.tar.gz
Compile and install the "Nagios Plugins"
cd /tmp/nagios-plugins-release-2.2.1/ ./tools/setup sudo ./configure sudo make sudo make install
Screen shots
























For more information about "Nagios Core", you can explore the following links:
- Official site on GitHub
- Official documentation
- Resource Library
- Quick Start Installation Guides
- About Nagios Core
10 free and open alternatives
- Cacti
- Cabot
- Cockpit Project
- Icinga
- FreeMNS
- Munin
- netdata
- Pandora FMS
- PHP ServerMonitor
- Zabbix
To learn more about these and other alternatives , click on the following link: Open Source Equipment and Network Monitoring Software.

Summary
In summary, as we've seen, Nagios Core is a perfect software tool for networking /servers and system/server administrators (sysadmins) . It's not only powerful but also flexible and adaptive, thanks to its numerous plugins . And for those who might not use it, there are always excellent alternatives like Zabbix, Icinga, and Cockpit Project , among many others.
We hope that this publication will be very useful for the entire «Comunidad de Software Libre y Código Abierto» and of great contribution to the improvement, growth and diffusion of the ecosystem of applications available for «GNU/Linux». And do not stop sharing it with others, on your favorite websites, channels, groups or communities of social networks or messaging systems. Finally, visit our home page at «FromLinux» to explore more news, and join our official channel Telegram from DesdeLinux.
