#!/usr/bin/perl                                                                                       
use strict;
use warnings;

my $proc = `ps aux | grep elas` ;
print $proc ;
if ($proc =~ m/elasticsearch/) {print "OK - ES is running"; exit(0) ;}
else {print "CRITICAL - ES DOWN"; system "/opt/elasticsearch/bin/elasticsearch -d" ; exit(2) ;}
