Skip to content

Instantly share code, notes, and snippets.

@ryanvgates
Created October 12, 2021 20:53
Show Gist options
  • Save ryanvgates/facd3c996b637ab18a5dd8a06e2c0058 to your computer and use it in GitHub Desktop.
Save ryanvgates/facd3c996b637ab18a5dd8a06e2c0058 to your computer and use it in GitHub Desktop.
Monit for ElasticSearch
#!/bin/sh
sudo apt install monit && \
sudo systemctl enable monit && \
echo '
check process elasticsearch with pidfile /var/run/elasticsearch/elasticsearch.pid
start program = "/bin/systemctl start elasticsearch.service"
stop program = "/bin/systemctl stop elasticsearch.service"' | sudo tee /etc/monit/conf.d/elasticsearch-monitrc && \
sudo systemctl stop monit.service && \
sudo systemctl start monit.service && \
sudo systemctl status monit.service && \
sudo systemctl status elasticsearch.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment