Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to monitor elasticsearch using nagios

I would like to monitor elasticsearch using nagios. Basiclly, I want to know if elasticsearch is up.

I think I can use the elasticsearch Cluster Health API (see here)

and use the 'status' that I get back (green, yellow or red), but I still don't know how to use nagios for that matter ( nagios is on one server and elasticsearc is on another server ).

Is there another way to do that?

EDIT : I just found that - check_http_json. I think I'll try it.

like image 892
Noam Avatar asked Apr 23 '12 08:04

Noam


People also ask

Can Elasticsearch be used for monitoring?

Elasticsearch is a highly scalable, distributed, open-source RESTful search and analytics engine that offers log analytics, real-time application monitoring, click stream analytics, and more. Elasticsearch stores and retrieves data structures in real time.

Which monitoring method is used in Nagios?

An example of passive monitoring is where the Nagios box never reaches out to devices; agents instead send a notification to Nagios – either regularly or just when a triggering event occurs. And that's how Nagios XI works friends!


1 Answers

After a while - I've managed to monitor elasticsearch using the nrpe. I wanted to use the elasticsearch Cluster Health API - but I couldn't use it from another machine - due to security issues... So, in the monitoring server I created a new service - which the check_command is check_command check_nrpe!check_elastic. And now in the remote server, where the elasticsearch is, I've editted the nrpe.cfg file with the following:

command[check_elastic]=/usr/local/nagios/libexec/check_http -H localhost -u /_cluster/health -p 9200 -w 2 -c 3 -s green

Which is allowed, since this command is run from the remote server - so no security issues here...

It works!!! I'll still try this check_http_json command that I posted in my qeustion - but for now, my solution is good enough.

like image 89
Noam Avatar answered Oct 14 '22 13:10

Noam