Header RSS Feed
 
» Nagios/Monitoring Plugins

Monitoring Plugin: check_es_system

Last Update: January 05, 2018

This is a plugin to monitor the system (disk and memory) usage of an ElasticSearch cluster/node. Lots of ElasticSearch clusters run in the cloud (popular: found.no). This is convenient, however as ES does not run on your own server, you cannot monitor the used disk space. This is where this plugin comes in. Just tell the plugin how much diskspace you have available (-d) on the ElasticSearch cluster and it will alarm you when you reach a threshold.

Jump to...
Download
Version History
Requirements
Definition of parameters
Command definition
Nagios and Icinga 1 service definition examples
Icinga 2 service definition examples
Screenshots

------------------------

Download
Download check_es_system check_es_system.sh
Download plugin and save it in your Nagios/Icinga plugin folder (e.g. /usr/local/nagios/libexec)
Contribute on https://github.com/Napsty/check_es_system
919 downloads so far...

------------------------

Version History
20160429: Started programming plugin
20160601: Continued programming. Working now as it should =)
20160906: Added memory usage check, check types option (-t)
20160906: Renamed plugin from check_es_store to check_es_system
20160907: Change internal referenced variable name for available size
20160907: Output now contains both used and available sizes
20161017: Add missing -t in usage output
20180105: Fix if statement for authentication (@deric)
20180105: Fix authentication when wrong credentials were used

------------------------

Requirements
- curl command (SUSE: zypper in curl, Debian/Ubuntu: apt-get install curl)
- jshon command (SUSE: search for jshon, Debian/Ubuntu: apt-get install jshon)
- Other bash relevant commands as expr (plugin checks for its existance)

------------------------

Definition of parameters

Parameter Description
-H * Hostname or ip address of ElasticSearch Node
-P Port (defaults to 9200)
-S Use https
-u Username if authentication is required
-p Password if authentication is required
-d * Available disk or memory size (ex. 20)
-t * Type of check to run (disk|mem)
-o Size unit (K|M|G) (defaults to G)
-w Warning threshold in percent (default: 80)
-c Critical threshold in percent (default: 95)
-h Help!

*mandatory!

------------------------

Command definition in Nagios and Icinga 1

# 'check_es_system' command definition
define command{
command_name check_es_system
command_line $USER1$/check_es_system.sh -H $ARG1$ -d $ARG2$ -t $ARG3$ $ARG4$
}

Command definition in Icinga 2

object CheckCommand "check_es_system" {
  import "plugin-check-command"
  command = [ PluginContribDir + "/check_es_system.sh" ]

   arguments = {
      "-H" = {
        value = "$es_address$"
        description = "Hostname or IP Address of ElasticSearch node"
      }

      "-P" = {
        value = "$es_port$"
        description = "Port number (default: 9200)"
      }

      "-S" = {
        set_if = "$es_ssl$"
        description = "Use https"
      }

      "-u" = {
        value = "$es_user$"
        description = "Username if authentication is required"
      }

      "-p" = {
        value = "$es_password$"
        description = "Password if authentication is required"
      }

      "-d" = {
        value = "$es_available$"
        description = "Define the available disk or memory size of your ES cluster"
      }

      "-t" = {
        value = "$es_checktype$"
        description = "Define the type of check (disk|mem)"
      }

      "-o" = {
        value = "$es_unit$"
        description = "Choose sizing unit (K|M|G) - defaults to G for GigaByte"
      }

      "-w" = {
        value = "$es_warn$"
        description = "Warning threshold in percent (default: 80)"
      }

      "-c" = {
        value = "$es_crit$"
        description = "Critical threshold in percent (default: 95)"
      }
  }

  vars.es_address = "$address$"
}

------------------------

Nagios and Icinga 1 service check examples

# Check ElasticSearch Store
define service{
  use generic-service
  host_name myesnode
  service_description ElasticSearch Store Usage
  check_command check_es_system!myescluster.in.the.cloud!50!disk!-u read -p only
}

In this example, the disk check happens on myexcluster.in.the.cloud and assumes a 50GB available disk space. There is authentication required to access the cluster statistics so here the login happens with user "read" and password "only".

------------------------

Icinga 2 service check examples

# Check Elasticsearch Store
object Service "ElasticSearch Store Usage" {
  import "generic-service"
  host_name = "myesnode"
  check_command = "check_es_system"
  vars.es_address = "myescluster.in.the.cloud"
  vars.es_user = "read"
  vars.es_password = "only"
  vars.es_checktype = "disk"
  vars.es_available = "50"
}

In this example, the disk check happens on myexcluster.in.the.cloud and assumes a 50GB available disk space. There is authentication required to access the cluster statistics so here the login happens with user "read" and password "only".

------------------------

Screenshots


Go to Homepage home
Linux Howtos how to's
Monitoring Plugins monitoring plugins
Links links

Valid HTML 4.01 Transitional
Valid CSS!
[Valid RSS]

7028 Days
until Death of Computers
Why?