Page 1 of 3

Elasticsearch-health-monitoring plugin

Posted: Fri Oct 02, 2015 11:07 am
by WillemDH
Hello,

Just stumbled on this:

https://exchange.nagios.org/directory/A ... ng/details

And wondered if that is something we could use for nls?

Grtz

Willem

Re: Elasticsearch-health-monitoring plugin

Posted: Fri Oct 02, 2015 11:14 am
by jolson
Definitely - there's actually a nice one that I have tested and verified as functional:
https://github.com/anchor/nagios-plugin-elasticsearch

Code: Select all

pip install nagios-plugin-elasticsearch
/usr/bin/check_elasticsearch -H 127.0.0.1 -m 1
In general, most plugins that work with elasticsearch will work with Nagios Log Server. Remember that the plugins should be run locally, since we deny outside access to elasticsearch without appropriate authentication.

Re: Elasticsearch-health-monitoring plugin

Posted: Mon Nov 16, 2015 7:42 am
by WillemDH
Jesse,

I've been trying to plugin and something seems wrong with the perfdata. I'm not getting any graphs, although the service details do show perfdata. Any ideas?

Re: Elasticsearch-health-monitoring plugin

Posted: Mon Nov 16, 2015 1:26 pm
by jolson
This wound up working for me. Did you wait the required 15 minutes or so for the service to plot a few data points?
2015-11-16-122558_1316x943_scrot.png

Re: Elasticsearch-health-monitoring plugin

Posted: Tue Nov 17, 2015 12:45 am
by Box293
WillemDH wrote:Jesse,

I've been trying to plugin and something seems wrong with the perfdata. I'm not getting any graphs, although the service details do show perfdata. Any ideas?
Image
Each datasource has 1 too many ;

cluster_nodes=2;;;;;

Should be:

cluster_nodes=2;;;;

Because of this the performance data will be discarded.

Re: Elasticsearch-health-monitoring plugin

Posted: Tue Nov 17, 2015 3:30 am
by WillemDH
Hmmm ok, I see. Question is why Jesse's version has the correct amount of ; and I don't? had a look through the python script, but didn't immediately found any cause. When I execute this from CLI I also get 5 ;

Re: Elasticsearch-health-monitoring plugin

Posted: Tue Nov 17, 2015 10:09 am
by jolson
My perfdata actually has five semicolons as well - I don't think that is the problem.
2015-11-17-090909_400x390_scrot.png
Willem, how do you have your service check configured? Mine is performing without the use of any flags
/usr/bin/check_elasticsearch
How is your check being performed?

Also, what version of python are you running?

Code: Select all

python -V

Re: Elasticsearch-health-monitoring plugin

Posted: Tue Nov 17, 2015 10:21 am
by WillemDH
Jesse,

I'm executing the plugin with check_nrpe. I added

Code: Select all

command[check_elasticsearch]=/usr/bin/check_elasticsearch -H 127.0.0.1 -m 1
to /usr/local/nagios/etc/nrpe/common.cfg
And this is the command I'm executing from Nagios:

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_nrpe -H nls-server -t 120 -c check_elasticsearch 
OUTPUT: Monitoring cluster 'ee9e60a0-f4cb-41ec-a97f-8f17434b748e' | cluster_nodes=2;;;;; cluster_master_eligible_nodes=2;;;;; cluster_data_nodes=2;;;;; cluster_active_shards=342;;;;; cluster_relocating_shards=0;;;;; cluster_initialising_shards=0;;;;; cluster_unassigned_shards=0;;;;; cluster_total_shards=342;;;;; cluster_total_indices=35;;;;; cluster_closed_indices=0;;;;; storesize=451346100119B;;;;; documents=487909914c;;;;; index_ops=27868667c;;;;; index_time=15449587ms;;;;; flush_ops=409c;;;;; flush_time=54353ms;;;;; throttle_time=6070112ms;;;;; index_ops=27868667c;;;;; index_time=15449587ms;;;;; delete_ops=0c;;;;; delete_time=0ms;;;;; get_ops=12389c;;;;; get_time=3130ms;;;;; exists_ops=12336c;;;;; exists_time=3126ms;;;;; missing_ops=53c;;;;; missing_time=4ms;;;;; query_ops=40003c;;;;; query_time=251105ms;;;;; fetch_ops=39736c;;;;; fetch_time=6876ms;;;;; merge_ops=21416c;;;;; refresh_ops=106074c;;;;; refresh_time=4176375ms;;;;; gc_old_count=4c;;;;; gc_young_count=15931c;;;;; heap_used=35%;;;;;
The service has been cloned from another service where perfdata works fine.

Re: Elasticsearch-health-monitoring plugin

Posted: Tue Nov 17, 2015 3:13 pm
by jolson
Interesting. What happens if you make another service using the exact commands you've described to me? I replicated your setup on a test cluster of mine and everything worked properly.

What does your 'performance graphs' page look like? I assume it's simply blank?

Re: Elasticsearch-health-monitoring plugin

Posted: Tue Nov 17, 2015 6:24 pm
by Box293
jolson wrote:My perfdata actually has five semicolons as well - I don't think that is the problem.
I believe newer versions of rrdtool is particular about this. I think it starts when you implement rrdcached as that installs a newer version of rrdtool than what is shipped with XI.

I'm pretty sure if @willemdh increases the logging verbosity then he would see the data being discarded in the logs:

http://support.nagios.com/wiki/index.ph ... leshooting

Code: Select all

tail -f /usr/local/nagios/var/perfdata.log > /tmp/perfdata.txt
tail -f /usr/local/nagios/var/npcd.log > /tmp/npcd.txt