How to Monitor Elasticsearch Cluster Using eG Enterprise?

eG Enterprise monitors the Elasticsearch Single-node Cluster using an agent based or agentless approach. In case of the agentless approach, an eG agent used to monitor the cluster should be deployed on a remote Windows host in the environment. Regardless of the approach (agent-based or agentless), the eG agent makes RESTful API calls to connect to the cluster to pull metrics related to availability, health and search performance of the cluster. For this purpose, each test that the eG agent runs on the Elasticsearch cluster should be configured with the credentials of a user who has privileges to make RESTful API calls to the cluster.

By default, the eG agent will not require any authentication to collect metrics from the cluster. In some highly secured environments, to prevent unauthorized access to the Elasticsearch cluster, administrators secure the cluster using security plugins such as X-Pack, Shield, etc. In such environments, to collect metrics, you may have to configure the tests with the credentials of a user who has privileges to access the cluster via the security plugin.

Enabling JMX Support

To collect JVM related metrics from the Elasticsearch cluster, enable JMX support for the Elasticsearch. follow the steps discussed below;

  • Stop the Elasticsearch cluster.
  • Open the file in the <ELASTIC-INSTALL-DIRECTORY>>/bin/ folder.
  • Search for the [JAVA_OPTS="$JAVA_OPTS -Xmx${ES_MAX_MEM}"] line in the file. Then, add the following lines after the above-mentioned line:

    JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname=<<IP address>>"


    <<PORT NUMBER>> denotes Any port number which you wish to listen

    <<IP address>> is the IP address of the host on which the Elasticsearch is running

    For example:

    JAVA_OPTS="$JAVA_OPTS -Djava.rmi.server.hostname="

  • Save the <<Elastic-Install-Directory>>/bin/ file
  • Start the Elasticsearch server.
  • Ensure that JMX is listening by executing netstat -an | grep "LIST" command

Once the above-said pre-requisites are set in place, manage the Elasticsearch component to start monitoring the target cluster. The steps for managing the Elasticsearch component are explained in Managing Elasticsearch Cluster.