Monitoring Nano Server Windows Containers with Sonar

Last Updated On September 18, 2018
You are here:

 This section describes how to use Sonar for monitoring Docker containers on Nano Server without cloud services or using any cloud vendor. Sonar is available under BSD license.

Introduction

TL;DR –  This article explain how to accomplish what customers are asking here to monitor Docker Windows containers or hosts on-premise or without dependency on any cloud vendor. The rest of this article is organized as follows:

  • Scenario
  • Architecture
  • Results
  • Steps to achieve the above results

Scenario

An insurance company ABCDEF made strategic decision to adopt Docker in the enterprise and chose to use Windows containers. However, due internal and government regulations all the container logs and monitoring data must be stored in ABCDEF datacenter, which is not connected to the cloud. Thus using any cloud services like Azure OMS is not an option. The ABCDEF has prioritized the following functional for private datacenter deployment:

  • Consolidating all errors and warning from Windows containers or host event logs.
  • Monitoring Windows process metrics from containers or hosts.
  • Monitoring SQL Server metrics from host deployed in company datacenter.
  • Monitoring BizTalk Server cluster metrics, including analytic events, suspended messages and ESB telemetry.

The ABCDEF would like to satisfy the following non-functional requirements:

  • Access, store and analyze mission critical metrics timestamped within shot time interval for anomaly detection on-premise.
  • Plug-in different software for anomaly detection on-premise.
  • Achieve cross-cloud or hybrid portability to use same monitoring stack anywhere.

Development Considerations

The following benefits and liabilities should be considered before using Sonar:

Benefits

  • Ability to choose a subset of metrics to monitor Windows containers and hosts.
  • Monitoring WMI metrics remotely using WS-Management protocol. Installing Sonar on a host is optional.
  • Cost effectiveness – Sonar is licensed under BSD and publicly available for using with Grafana, InfluxDb or Prometheus.
  • Works with any cloud vendor and on-premise deployments.
  • Ability to choose a subset of metrics to monitor Windows containers in datacenter or any cloud.
  • Support for cross-cloud symmetry without being dependent on type of cloud or specific vendor.
  • Flexible deployment options – Sonar can be deployed as process or container (Windows service, Docker container or Kubernetes pod).
  • Minimal performance impact for monitoring critical metrics and logs.
  • Ability to scale – Sonar container is deployed per host.
  • Enabling anomaly detection – storing metrics in time series databases enables many options for analysis and alerting.
  • Easy to configure – no coding is required for adding new settings or changing existing ones.
  • Open to broad scenarios – monitoring WMI metrics for any software product, including BizTalk Server and  SQL Server.

Liabilities

  • Properly securing WSMan endpoints for containers and hosts for access by Sonar.
  • Avoid exposing Sonar to external networks.
  • Sonar depends on time series databases (InfluxDb or Prometheus) for exposing or storing collected metrics.

Solutions

To build solution, ABCDEF decides to deploy containers using Nano Server and use only containers for monitoring datacenter and cloud hosts. They decide to deploy one Sonar container per Nano Server host to use it as WMI scraper to collect all the metrics from other containers and host itself. The list of available choices to implement the solution is shown below:

The above scenarios were implemented in private cloud with Prometheus v1.7 and InfluxDb v1.3.1

Tags: