How Nagios Works

Nagios is one of the most popular tools for servers, applications, services, network devices, and other components (including IoT - Internet of Things) monitoring.

What makes Nagios great is that it is open source software.

This also means - it is free of charge. Well, maybe not fully free as you need server administrator time to install, setup and configure it. Also, you need some (even a small machine) to run it.

In this article, we will explain what Nagios is, its role in Continous Monitoring (DevOps), how it works and how to get the best out of it.

What is Continuous Monitoring

Term Continous Monitoring is widely used by IT organizations. It can be applied to any type of system or application. For example, if you have an online store, then you can use continuous monitoring to find out whether there are problems with your payment gateway. Or, if you have an eCommerce website, such as Amazon, you can monitor it to make sure everything is working properly.

Continuous monitoring is different from traditional monitoring because it requires constant attention. Traditional monitoring involves checking things once every day or so.

With continuous monitoring, you check services constantly. If something goes wrong, you know about it immediately.

Why do I Need Continuous Monitoring

The main reason why you might want to use continuous monitoring is to avoid downtime. Downtime is when your service or application stops working.

Downtime happens when there are problems with your hardware, software, configuration or resources usage. When you have continuous monitoring, you don’t have to wait until an issue occurs before you notice it. You can detect issues early on and take action right away.

The second reason why you may want to use continuous monitoring comes from availability. Availability refers to the ability of your systems/applications to keep running even if they encounter errors.

If you have continuous monitoring, then you can make sure that your service or application keeps running even if it encounters an error. This way, you can ensure high availability.

Thirdly, you may want to use it to reduce operational costs. With continuous monitoring, you can automatically react to changes in your environment. For example, if you see that CPU utilization is increasing, you can add more machines to handle the load.

Finally, you may want to apply continuous monitoring to improve performance. By continuously monitoring your application’s performance, you can spot bottlenecks and fix them before they cause major issues.

So, let’s dive into the details of how Nagios helps in this context.

Nagios Pros and Cons

Continuous Monitoring could be done with Nagios or any other tool but Nagios has several big advantages:

  • It is by far one of the most popular monitoring tools
  • It is open-source
  • It is free of charge tool
  • A proven tool as a monitoring solution for almost 20 years now

But also some big disadvantages:

  • You need a person with Linux/Unix skills
  • There is no admin interface or dashboard to setup new checks
  • You can’t scale monitoring needs with Nagios.
  • Technical knowledge is required to work with Nagios
  • Ugly UI (User Interface)

## How to install Nagios

Nagios could be installed on any OS (Operating System): Windows, MacOS, Linux, UNIX, etc. It’s not limited to only one type of operating system.

Usually, OS package managers have Nagios package and installing software is just one command away. For example in Ubuntu that would be:

sudo apt install nagios3 nagios-nrpe-plugin

Nagios configuration files are located in /usr/local/nagios/etc folder.

Nagios Architecture

When explaining Nagios we should focus on what is Objects, Core and Status layers.

Objects in Nagios are apps or services that you are going to monitor. That can be website, e-commerce store, server, database, network, printer, fax machine and more.

Core layer consists of Nagios daemon (software that runs in the background), plugins (to check services) and performance data storage to RRD (round-robin database).

Status layer is responsible for displaying information about hosts, services, events, etc. Or even alerting on-duty persons about downtime. Nagios has its own dashboard to display information about services.

How does Nagios monitoring work

Once installed and configured, Nagios daemon (background software) will be checking constantly (every 5 minutes by default) for services it is configured to follow.

When the service is down or its performance metrics are above threshold - it can alert people about disruption so that they could investigate.

Nagios has three warning levels:

  • Success when service is working fine

  • Warning when some threshold is reached, but it is not critical for service to operate (think of 80% disk space usage which a problem, but not yet a critical one)

  • Error when service is down or a certain threshold is reached (f.e. 100% disk space used)

The biggest issue with Nagios is that you have to configure everything and for IT organization with lots of services that might mean lots of SysAdmin (system administrators) hours.

What is Nagios Core

You might hear Nagios Core name from online articles. That is just another (older) name for plain Nagios.

Nagios has its paid (and very expensive!) alternative - Nagios XL which we will introduce a bit later in this article.

## Use Nagios plug-ins

Nagios has a plugin for any IT infrastructure place you want to follow:

  • SNMP

  • SSH

  • SMTP

  • HTTP

  • FTP

  • POP3

  • IMAP

  • LDAP

  • MySQL

  • Oracle

  • SQL Server

  • PostgreSQL

  • Solr

  • MongoDB

  • Memcached

  • Redis

  • ElasticSearch

  • RabbitMQ

  • Apache Kafka

  • Cassandra

  • Docker

  • Kubernetes

It has also integrations to many other services:

  • Prometheus

  • Grafana

  • OpenStack

  • Zabbix

  • InfluxDB

  • AWS CloudWatch

  • GCP Stackdriver

  • Azure Monitor

  • Istio

  • Pingdom

  • New Relic

  • Splunk

  • Logentries

  • Honeycomb

  • Datadog

Thousand Nagios plugins could be found and downloaded from Official Nagios Exchange (Marketplace) page →

 
UptimeTea Logo White
Tool to monitor your websites, SAAS, APIs, and other services. With ability inform your team members or managers about the status of your services.
2022 © UptimeTea. All rights reserved.