Dark Mode
Image
  • Sunday, 29 January 2023
DevOps-9: Continuous Monitoring [Nagios]

DevOps-9: Continuous Monitoring [Nagios]


DevOps-9: Continuous Monitoring [Nagios] - Outline

9.1. Learning Objectives

The organization is working on a project which contains the concept of Continuous Monitoring.

Objective:

  • Overview of Continuous Monitoring
  • Purpose of Nagios and Nagios Plugins
  • Monitoring Tools

 

2.2. Overview of Continuous Monitoring

Continuous Monitoring is the ability to detect risk, compliance, and security issues in an operational environment. It acts as an auditing tool, where it can navigate through old monitoring data to analyze and improve the performance of the system.

The roles of Continuous Monitoring are:

  • Assists in the design of a reliable system
  • Displays application behavior during peak business hours
  • Reduces cost by acquiring precise knowledge of software asset duplication
  • Reduces the chance of an application going down
  • Notifies you if there is a problem with your application service
  • Retrieves and analyzes historical data

 

Types of Continuous Monitoring,

Continuous Monitoring

 

The deals with the monitoring of:

Continuous Monitoring Continuous Monitoring Continuous Monitoring

 

There are several tools available for Continuous Monitoring,

Continuous Monitoring

 

9.3. Nagios Overview

Nagios is an open-source continuous monitoring program for system, network and IT infrastructure monitoring. It is available in two variants,

Continuous Monitoring

Nagios Core is an open-source product, whereas Nagios XI is a licensed version.

Advantages of Nagios:

  • Finds any type of network issue
  • Monitors the infrastructure actively
  • Facilitates automatic problem resolution
  • Troubleshoots server performance issues

Features of Nagios:

Continuous Monitoring

Nagios Architecture: It uses a client-server architecture.

Continuous Monitoring Continuous Monitoring

The scheduler sends a signal to execute the plugins at the remote host. The plugin gets the status from the remote host. The scheduler updates the user interface and notification are sent to the admin.

 

9.4. Nagios Plugins

Plugins are compiled executable or scripts(perl/shell) that can be run from the command line. Plugins allow the user to monitor database. They are standalone extensions to Nagios Core.

Continuous Monitoring

  • Official Plugins: These plugins are developed by the official Nagios Plugins team.
  • Community Plugins: These plugins are developed by hundreds of Nagios community members.
  • Custom Plugins: These plugins are developed by users in order to suit their environment.

Configuration plugins on Remote Nodes:

Continuous Monitoring

There are the two types of installation:

Continuous Monitoring

 

9.5. Monitoring with Nagios

Nagios implements monitoring by using the default plugins. There are some default plugins available to monitor devices and services.

Continuous Monitoring

Default Plugins: The Nagios exchange website offers a number of additional plugins developed by users.

Continuous Monitoring

 

9.6. ELK Stack Overview

ELK stack is an open-source, distributed monitoring solution sittable for almost any structured and unstructured data source. ELK is the acronym for three open-source projects:

Continuous Monitoring

The main components of ELK stack are:

Continuous Monitoring

Elasticsearch: It is distributed search and analytics engine analytics for data. It is highly scalable.

Continuous Monitoring

Logstash: Data processing component and it collect data from various sources.

Continuous Monitoring

Kibana: It is a data visualization tool. It provides the graphical user interface for Elasticsearch. It has – Ease of use, Ease of conversion, Ease of analyzing complex data.

Beats: Beats are lightweight data collectors. These are installed directly on the data source. The most frequently used data collectors are:

Continuous Monitoring

Benefits of ELK Stack:

  • Views stats to detect defects in application
  • Collects logs from servers and applications that can be analyzed for improvement
  • Backup of monitoring stats and able to store our monitoring system.
  • Combination of Elasticsearch, Logstash, and kibana.
  • A set of utilities provide the most powerful analytics for the business.

 

9.7. Demo - Monitoring Using ELK Stack

Continuous Monitoring https://github.com/WorkstationG/ELKExample Continuous Monitoring Continuous Monitoring Continuous Monitoring Continuous Monitoring

Open kibana to your web browser: http://localhost:5601/app/kibana

Continuous Monitoring

In your localhost login to Jenkins: http://localhost:8080/login

Dashborad>Credentials>System>Add Global credential from Jenkins,

Continuous Monitoring

Create an “pipeline” item,

Continuous Monitoring Continuous Monitoring Continuous Monitoring Continuous Monitoring

 

In the command line,

Continuous Monitoring

Now go back to the jenkin item “SpringBootApplicationDocker” and click on “build now” to build the Jenkins job and to deploy the Docker container on the Docker host.

Continuous Monitoring

You can see that Jenkins pipeline has completed the build and the deployment process for the SprintBootApplicationDocker.

Continuous Monitoring Continuous Monitoring

Now go back to your terminal,

Continuous Monitoring

Now navigate to your web browser and explore different page for your Spring boot application,

Continuous Monitoring

Now go to the kibana dashboard, Management>Index Management –to the log result for your application,

Continuous Monitoring

In this way we can perform the monitoring by ELK Stack.

 

 

Comment / Reply From