monitoring elasticsearch service with chkservd

Nile Youth

Active Member
Apr 2, 2015
25
7
53
Egypt
cPanel Access Level
Root Administrator
Twitter
I need to but elasticsearch service in monitor with chkservd

I made that
add : elasticsearch:1

in /etc/chkserv.d/chkservd.conf

and made new file with the same name elasticsearch in /etc/chkserv.d contain:
Code:
service[elasticsearch]=x,x,x,/bin/systemctl restart elasticsearch.service,elasticsearch,root
after restart the chkservd I got that service elasticsearch down when it work fine

Code:
[[email protected] ~]# service elasticsearch status
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2021-07-24 12:32:58 EET; 33min ago
     Docs: http://www.elastic.co
Main PID: 258513 (java)
   CGroup: /system.slice/elasticsearch.service
           ├─258513 /bin/java -Xms1g -Xmx1g -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFra...
           └─261938 /usr/share/elasticsearch/modules/x-pack-ml/platform/linux-x86_64/bin/controll...

Jul 24 12:32:58 main.nileyouth.net systemd[1]: Started Elasticsearch.
can any one help in this please
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
14,425
2,259
363
cPanel Access Level
Root Administrator
Hey there! We have a great article on Elasticsearch here, so you might want to review that to ensure that your tmp directory is properly set up for that tool:


In your code snippet from the chkservd configuration file, you provided this:

Code:
service[elasticsearch]=x,x,x,/bin/systemctl restart elasticsearch.service,elasticsearch,root
but did you change each of the x values to actual values? The first x is the port, the second is the command chkservd will send to check the connection, and the third is the expected response. You can see an example of this using the FTP service here: