sensu-plugins / sensu-plugins-elasticsearch

This plugin provides native ElasticSearch instrumentation for monitoring and metrics collection, including: service health and metrics for cluster, node, and more.
http://sensu-plugins.io
MIT License
32 stars 77 forks source link

check-es-cluster-health warning ::Fixnum #82

Open jothoma1 opened 7 years ago

jothoma1 commented 7 years ago

Hello, i'm using your plugins with sensu 1.0 and the check-es-cluster-health.rb return a warning :

/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/elasticsearch-transport-1.0.18/lib/elasticsearch/transport/transport/base.rb:52: warning: constant ::Fixnum is deprecated /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/elasticsearch-transport-1.0.18/lib/elasticsearch/transport/transport/base.rb:54: warning: constant ::Fixnum is deprecated ESClusterHealth CRITICAL: Cluster state is Red

Thanks in advance

Evesy commented 7 years ago

This will be affecting anyone using this plugin on Ruby 2.4.0; caused by the dependency on the elasticsearch gem. It looks like it's already been fixed upstream however this plugin pins an older version of the gem.

@majormoses You're probably already aware but one to note for the 2.4.1 testing -- To resolve this issue I assume it'll require bumping to use the latest major release (5.) of the elasticsearch gem.

In the meantime @jothoma1 you could export the below to suppress these warnings:

RUBYOPT=-W0

i.e.

command 'RUBYOPT=-W0 /opt/sensu/embedded/bin/check-es-cluster-status.rb' 

EDIT: I see related discussion https://github.com/sensu-plugins/sensu-plugins-elasticsearch/issues/48

majormoses commented 7 years ago

I checked and we can bump to 2.x when I have some time I can try bumping this I am more concerned about the lack of testing in this plugin so it will require lots of testing against multiple versions of ES so we know what breaks on what versions.

eheydrick commented 7 years ago

73 for adding tests.