Giter Club home page Giter Club logo

munin-elasticsearch's Introduction

Munin plugin for elasticsearch

A Munin plugin for monitoring Elasticsearch nodes. Written in Ruby, depends on JSON gem. Compatible with Elasticsearch 5.xโ€“7.x.

Supported Modes

Cache

elasticsearch_cache - field and query cache stats

Docs

elasticsearch_docs - document count

Garbage Collection

elasticsearch_gc - GC collections/sec

Garbage Collection Running Time

elasticsearch_gc_time - GC collection running time in ms

JVM Heap

elasticsearch_jvm - JVM heap stats

Operations

elasticsearch_ops - index, get, search, delete operations/sec

Store

elasticsearch_store - Size of index on disk

Installation

See the Munin documentation for complete instructions on plugin usage. In short, once elasticsearch_ is in your plugin directory, create symlinks for each desired mode in your Munin service dir (usually /etc/munin/plugins/). For example, to enable JVM monitoring:

ln -s /usr/local/munin/lib/plugins/elasticsearch_ /etc/munin/plugins/elasticsearch_jvm

Configuration

You may also need to create a configuration file for the plugin, if the included defaults aren't suitable to your environment. Usually this would be /etc/munin/plugin-conf.d/elasticsearch.

Variables

  • host - a elasticsearch node capable of providing stats interface (default localhost)
  • port - elasticsearch HTTP API port (default 9200)
  • node - the name of the node to monitor (default _local)
  • user - if HTTP authentication is required, user name
  • pass - if HTTP authentication is required, user password

Example Config

[elasticsearch_*]
env.host 10.1.2.14
env.port 9200
env.node pinky rat
env.user johnsmith
env.user passw0rd

License

See the included LICENSE for rights and limitations under the terms of the MIT license.

munin-elasticsearch's People

Contributors

claygregory avatar daveb93 avatar ebuildy avatar rvavruch avatar waptaff avatar zoconet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

munin-elasticsearch's Issues

URI.escape is obsolete

Hello,

in my munin log I have lots of messages saying:

/etc/munin/plugins/elasticsearch_gc:159: warning: URI.escape is obsolete

gc values

I am running ES 1.0.2. For node stats it returns:

"jvm" : {
        "timestamp" : 1401611712501,
        "uptime_in_millis" : 5144047039,
        "mem" : {
          "heap_used_in_bytes" : 196708880,
          "heap_used_percent" : 18,
          "heap_committed_in_bytes" : 278462464,
          "heap_max_in_bytes" : 1065025536,
          "non_heap_used_in_bytes" : 49975760,
          "non_heap_committed_in_bytes" : 75812864,
          "pools" : {
            "young" : {
              "used_in_bytes" : 13095064,
              "max_in_bytes" : 69795840,
              "peak_used_in_bytes" : 28311552,
              "peak_max_in_bytes" : 69795840
            },
            "survivor" : {
              "used_in_bytes" : 3473408,
              "max_in_bytes" : 8716288,
              "peak_used_in_bytes" : 3473408,
              "peak_max_in_bytes" : 8716288
            },
            "old" : {
              "used_in_bytes" : 180140408,
              "max_in_bytes" : 986513408,
              "peak_used_in_bytes" : 180140408,
              "peak_max_in_bytes" : 986513408
            }
          }
        },
        "threads" : {
          "count" : 63,
          "peak_count" : 70
        },
        "gc" : {
          "collectors" : {
            "young" : {
              "collection_count" : 1731,
              "collection_time_in_millis" : 27437
            },
            "old" : {
              "collection_count" : 2,
              "collection_time_in_millis" : 0
            }
          }
        }
      },

I've made a commit on my fork that changes the collection for gc to:

"count" => node_stats['jvm']['gc']['collectors']['young']['collection_count']

I have little experience with garbage collection so I am unsure if this is the best solution, perhaps it should be capturing more details, ie. young & old, milliseconds as well?

Typo

"Node node found" instead of "No node found"

nil:NilClass (NoMethodError)

Service 'elasticsearch_gc' exited with status 1/0.
Error output from elasticsearch_docs:
/etc/munin/plugins/elasticsearch_docs:138:in <main>': undefined method[]' for nil:NilClass (NoMethodError)

my config was:
[elasticsearch_*]
env.host 10.10.1.126
env.port 9200
env.node graylog2-server

then I wrapped the node variable in double quotes and I don't get the nil error.

es7 + https + ca_file

Hi,
We have an Es7 cluster, and I had to make a few changes to this plugin for it to talk to it. Mostly around the fact we need to use https when talking to ES, and have a custom ca_file to use with openssl etc.

so, I did :

1 . Specified the 'host' env var as https://whatever-server
2. Changed the 'fetch(resource)' function to be :

def fetch(resource)
    uri = URI("" + @host + ":" + @port.to_s + resource)
    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = (uri.scheme == 'https')
    if(http.use_ssl?) 
      http.ca_file = "/etc/whatever/es7.crt"
      http.use_ssl = true
      http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    end

    req = Net::HTTP::Get.new(uri)
    unless @user.empty?
      req.basic_auth @user, @pass
    end

    response = http.request(req)
    return JSON.parse(response.body)
end

after that, it seems to work.

Apologies for what's probably not very good ruby. I suspect the 'ca_file' should really be handled through another ENV thing really.

Thanks for this plugin though ;)

Debian 11 compatibility

sudo /usr/share/munin/plugins/elasticsearch_ autoconf /usr/share/munin/plugins/elasticsearch_:25: warning: URI.escape is obsolete yes

node_encode = URI.escape(@node)
should be replaced

For test, I just remoted uri.escape and plugins works on Debian 11

Elasticsearch 7.x compatibility

Hi,

just wanted to say I tested it with Elasticsearch 7.x and its working out of the box! Maybe you want to update readme.md?

Best regards,
Plastikschnitzer

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.