Health check (xm_hc)

This module provides HTTP response capabilities for checking NXLog Agent’s health status. Using the xm_hc module, the running NXLog Agent instance can accept inbound HTTP/1.1 GET requests and respond to these HTTP/1.1 200 OKs. It discards any other request types with HTTP 405 Method not allowed.

Configuration

The xm_hc module accepts the following directives in addition to the common module directives.

Required directives

The following directives are required for the module to start.

ListenAddr

The module accepts connections on the IP address or hostname and port defined by this directive. The default address is localhost and the default port is 8000. The port number is defined by appending it to the hostname or IP address using a colon as a separator in the format (host:port).

To listen on multiple addresses or ports in a single module instance, this directive can be repeated multiple times. Both IPv4 and IPv6 addresses are supported. If a DNS name is used, the number of addresses or CNAME records should be kept below 16 to avoid potential issues caused by DNS response size limits.

Example

Example 1. Sample example

In this example, the module listens on two ports and responds to GET requests.

nxlog.conf
<Extension hc>
   Module xm_hc
   ListenAddr 0.0.0.0:9999
   ListenAddr 0.0.0.0:9990
</Extension>