Git Product home page Git Product logo

munin-plugin-elasticsearch's Introduction

Munin plugin for elasticsearch

A useful Munin plugin for monitoring elasticsearch 1.x nodes in Perl.
This original codes has out of maintenance, so I have started maintenance this plugin.

Features

  • Supports elasticsearch 1.0.x / 1.1.x / 1.2.x / 1.3.x / 1.4.x / 2.x / 5.x
  • Supports monitoring local and/or another hosts

Plugins

  • elasticsearch_cache - field and filter cache stats
  • elasticsearch_cluster_shards - cluster shards stats
  • elasticsearch_docs - document count
  • elasticsearch_gc_time - garbage collection time stats
  • elasticsearch_index_size - index size
  • elasticsearch_index_total - index total count
  • elasticsearch_jvm_memory - JVM heap/non-heap memory usage
  • elasticsearch_jvm_pools_size - JVM pools size stats
  • elasticsearch_jvm_threads - JVM thread stats
  • elasticsearch_open_files - open files count
  • elasticsearch_translog_size - translog file size

Configuration

Variables

  • env.host - a elasticsearch node capable of providing stats interface (default localhost)
  • env.port - elasticsearch HTTP API port (default 9200)

Example Config

Before use, put these settings into munin configuration.

  • examples of munin config file
    • in the case of all plugin config into single file.
      /etc/munin/plugin-conf.d/munin-node
    • in the case of creating file per plugins.
      /etc/munin/plugin-conf.d/elasticsearch
example of custom host and port configuration
[elasticsearch_*]
env.host localhost
env.port 9200

Install

Install this plugins with following steps after config setuped.

# For centos
$ cd /usr/local/src/
$ sudo git clone https://github.com/y-ken/munin-plugin-elasticsearch.git
$ cd munin-plugin-elasticsearch
$ sudo cp -p elasticsearch_* /usr/share/munin/plugins/
$ sudo ln -s /usr/share/munin/plugins/elasticsearch_* /etc/munin/plugins/
$ sudo -H munin-node-configure --shell | grep elasticsearch | sudo -H sh
$ munin-node-configure | grep elasticsearch
$ sudo service munin-node restart

To confirm wokring fine or not, you can check like below.

$ munin-run elasticsearch_jvm_memory
heap_used.value 5017533904
heap_max.value 8520204288
heap_committed.value 8520204288
non_heap_used.value 60425328
non_heap_committed.value 90300416

Author

Licence

MIT License

munin-plugin-elasticsearch's People

Contributors

aki77 avatar arthurzenika avatar gasol avatar mickm avatar nxhack avatar oliver006 avatar tmessi avatar y-ken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

munin-plugin-elasticsearch's Issues

munin-node: Error output from elasticsearch_docs:

I recently got the error several times in syslog:

munin-node: Error output from elasticsearch_docs:

I suspect it may be because server was under heavy load and the GET request failed. Under this circumstance shouldn't the script print "$name.value U" instead of an error message to comply with Munin expected format?

It's not a big deal except that I do monitor the syslog for unexpected errors which often times exposes real issues and this kind of error creates noise.

Thanks!

The plugins on RHEL 7.2 with ElasticSearch 2.2.0 works fine with "munin-run" from commandline, but not within the "munin-node" deamon

The plugins on RHEL 7.2 with ElasticSearch 2.2.0 works fine with "munin-run" from commandline (1), but not within the "munin-node" deamon (2).

(1)========================================

**$for i in elastic*; do sudo munin-run $i; done**
filter_size.value 0
field_size.value 1810111592
relocating_shards.value 0
active_shards.value 86
active_primary_shards.value 86
delayed_unassigned_shards.value 0
initializing_shards.value 0
unassigned_shards.value 86
num_docs.value 1625779043
young.value 22449394
old.value 93028
index_size.value 326320956997
search.value 2239097
index.value 4671004712
delete.value 0
get.value 1201318
heap_used.value 14076187952
heap_max.value 33198768128
non_heap_used.value 136132720
heap_committed.value 33198768128
non_heap_committed.value 138285056
young_used.value 99639656
old_used.value 13954949032
old_peak.value 25439922600
young_peak.value 697958400
survivor_used.value 21599264
survivor_peak.value 87228416
count.value 167
peak_count.value 193

(2)========================================

**$cat /var/log/munin-node/munin-node.log**
2016/03/22-18:13:35 Munin::Node::Server (type Net::Server::Fork) starting! pid(13540)
Resolved [*]:4949 to [0.0.0.0]:4949, IPv4
Binding to TCP port 4949 on host 0.0.0.0 with IPv4
Setting gid to "0 0"
2016/03/22-18:13:35 [13540] Error output from elasticsearch_docs:
2016/03/22-18:13:35 [13540]     500 for http://localhost:9200/_nodes at /etc/munin/plugins/elasticsearch_docs line 49.
2016/03/22-18:13:35 [13540]             main::get_json_from_url('http://localhost:9200/_nodes') called at /etc/munin/plugins/elasticsearch_docs line 55
2016/03/22-18:13:35 [13540] Service 'elasticsearch_docs' exited with status 13/0.
2016/03/22-18:13:35 [13540] Error output from elasticsearch_index_total:
2016/03/22-18:13:35 [13540]     500 for http://localhost:9200/_nodes at /etc/munin/plugins/elasticsearch_index_total line 48.
2016/03/22-18:13:35 [13540]             main::get_json_from_url('http://localhost:9200/_nodes') called at /etc/munin/plugins/elasticsearch_index_total line 54
2016/03/22-18:13:35 [13540] Service 'elasticsearch_index_total' exited with status 13/0.
2016/03/22-18:13:36 [13540] Error output from elasticsearch_jvm_threads:
2016/03/22-18:13:36 [13540]     500 for http://localhost:9200/_nodes?jvm=true at /etc/munin/plugins/elasticsearch_jvm_threads line 49.
2016/03/22-18:13:36 [13540]             main::get_json_from_url('http://localhost:9200/_nodes?jvm=true') called at /etc/munin/plugins/elasticsearch_jvm_threads line 55
2016/03/22-18:13:36 [13540] Service 'elasticsearch_jvm_threads' exited with status 13/0.
2016/03/22-18:13:36 [13540] Error output from elasticsearch_jvm_memory:
2016/03/22-18:13:36 [13540]     500 for http://localhost:9200/_nodes/_local/stats/jvm at /etc/munin/plugins/elasticsearch_jvm_memory line 49.
2016/03/22-18:13:36 [13540]             main::get_json_from_url('http://localhost:9200/_nodes/_local/stats/jvm') called at /etc/munin/plugins/elasticsearch_jvm_memory line 55
2016/03/22-18:13:36 [13540] Service 'elasticsearch_jvm_memory' exited with status 13/0.
2016/03/22-18:13:36 [13540] Error output from elasticsearch_jvm_pools_size:
2016/03/22-18:13:36 [13540]     500 for http://localhost:9200/_nodes?jvm=true at /etc/munin/plugins/elasticsearch_jvm_pools_size line 49.
2016/03/22-18:13:36 [13540]             main::get_json_from_url('http://localhost:9200/_nodes?jvm=true') called at /etc/munin/plugins/elasticsearch_jvm_pools_size line 55
2016/03/22-18:13:36 [13540] Service 'elasticsearch_jvm_pools_size' exited with status 13/0.
2016/03/22-18:13:37 [13540] Error output from elasticsearch_cluster_shards:
2016/03/22-18:13:37 [13540]     500 for http://localhost:9200/_cluster/health at /etc/munin/plugins/elasticsearch_cluster_shards line 49.
2016/03/22-18:13:37 [13540]             main::get_json_from_url('http://localhost:9200/_cluster/health') called at /etc/munin/plugins/elasticsearch_cluster_shards line 55
2016/03/22-18:13:37 [13540] Service 'elasticsearch_cluster_shards' exited with status 13/0.
2016/03/22-18:13:37 [13540] Error output from elasticsearch_cache:
2016/03/22-18:13:37 [13540]     500 for http://localhost:9200/_nodes at /etc/munin/plugins/elasticsearch_cache line 49.
2016/03/22-18:13:37 [13540]             main::get_json_from_url('http://localhost:9200/_nodes') called at /etc/munin/plugins/elasticsearch_cache line 55
2016/03/22-18:13:37 [13540] Service 'elasticsearch_cache' exited with status 13/0.
2016/03/22-18:13:37 [13540] Error output from elasticsearch_index_size:
2016/03/22-18:13:37 [13540]     500 for http://localhost:9200/_nodes at /etc/munin/plugins/elasticsearch_index_size line 49.
2016/03/22-18:13:37 [13540]             main::get_json_from_url('http://localhost:9200/_nodes') called at /etc/munin/plugins/elasticsearch_index_size line 55
2016/03/22-18:13:37 [13540] Service 'elasticsearch_index_size' exited with status 13/0.
2016/03/22-18:13:37 [13540] Error output from elasticsearch_gc_time:
2016/03/22-18:13:37 [13540]     500 for http://localhost:9200/_nodes/_local/stats/jvm at /etc/munin/plugins/elasticsearch_gc_time line 49.
2016/03/22-18:13:37 [13540]             main::get_json_from_url('http://localhost:9200/_nodes/_local/stats/jvm') called at /etc/munin/plugins/elasticsearch_gc_time line 55
2016/03/22-18:13:37 [13540] Service 'elasticsearch_gc_time' exited with status 13/0.

**$telnet localhost 4949
**Connected to localhost.
Escape character is '^]'.
# munin node at foo
**list**
cpu df df_inode elasticsearch_cache elasticsearch_cluster_shards elasticsearch_docs elasticsearch_gc_time elasticsearch_index_size elasticsearch_index_total elasticsearch_jvm_memory elasticsearch_jvm_pools_size elasticsearch_jvm_threads entropy forks fw_conntrack fw_forwarded_local fw_packets if_eno16780032 if_err_eno16780032 interrupts irqstats load memory netstat ntp_10.204.0.20 ntp_kernel_err ntp_kernel_pll_freq ntp_kernel_pll_off ntp_offset ntp_states open_files open_inodes postfix_mailqueue postfix_mailvolume proc_pri processes swap tcp threads uptime users vmstat
**fetch elasticsearch_cache**
# Bad exit
.
**fetch elasticsearch_cluster_shards**
# Bad exit
.
**fetch elasticsearch_docs**
# Bad exit
.
quit
Connection closed by foreign host.


---
$cat /etc/redhat-release
**Red Hat Enterprise Linux Server release 7.2 (Maipo)**

---
$curl http://localhost:9200/
**{
  "name" : "foo",
  "cluster_name" : "foo-test",
  "version" : {
    "number" : "2.2.0",
    "build_hash" : "8ff36d139e16f8720f2947ef62c8167a888992fe",
    "build_timestamp" : "2016-01-27T13:32:39Z",
    "build_snapshot" : false,
    "lucene_version" : "5.4.1"
  },
  "tagline" : "You Know, for Search"
}**

---
**$ls -lh elasticsearch_* **
lrwxrwxrwx. 1 root root 44 Mar 22 17:11 elasticsearch_cache -> /usr/share/munin/plugins/elasticsearch_cache
lrwxrwxrwx. 1 root root 53 Mar 22 17:11 elasticsearch_cluster_shards -> /usr/share/munin/plugins/elasticsearch_cluster_shards
lrwxrwxrwx. 1 root root 43 Mar 22 17:11 elasticsearch_docs -> /usr/share/munin/plugins/elasticsearch_docs
lrwxrwxrwx. 1 root root 46 Mar 22 17:11 elasticsearch_gc_time -> /usr/share/munin/plugins/elasticsearch_gc_time
lrwxrwxrwx. 1 root root 49 Mar 22 17:11 elasticsearch_index_size -> /usr/share/munin/plugins/elasticsearch_index_size
lrwxrwxrwx. 1 root root 50 Mar 22 17:11 elasticsearch_index_total -> /usr/share/munin/plugins/elasticsearch_index_total
lrwxrwxrwx. 1 root root 49 Mar 22 17:11 elasticsearch_jvm_memory -> /usr/share/munin/plugins/elasticsearch_jvm_memory
lrwxrwxrwx. 1 root root 53 Mar 22 17:11 elasticsearch_jvm_pools_size -> /usr/share/munin/plugins/elasticsearch_jvm_pools_size
lrwxrwxrwx. 1 root root 50 Mar 22 17:11 elasticsearch_jvm_threads -> /usr/share/munin/plugins/elasticsearch_jvm_threads

Work with no HTTP nodes?

We have a cluster with some http enabled nodes and http disabled nodes (data nodes).

Is it working in a such configuration?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.