Skip to content

Instantly share code, notes, and snippets.

@nl5887
Last active September 1, 2016 13:20
Show Gist options
  • Select an option

  • Save nl5887/61862f3def0ff0010f69 to your computer and use it in GitHub Desktop.

Select an option

Save nl5887/61862f3def0ff0010f69 to your computer and use it in GitHub Desktop.
monit configuration
check process elasticsearch with pidfile /var/run/elasticsearch/elasticsearch.pid
start program = "/etc/init.d/elasticsearch start"
stop program = "/etc/init.d/elasticsearch stop"
check process kibana with pidfile /var/run/kibana.pid
start program = "/bin/bash -c 'cd /usr/share/kibana-4.3.1-linux-x64; nohup ./bin/kibana > /var/log/kibana.log 2>&1 & echo $! > /var/run/kibana.pid'" as uid "kibana" and gid "kibana"
stop program = "/bin/kill -9 `cat /var/run/kibana.pid`"
check process kibana with pidfile /var/run/kibana.pid
start program = "/etc/init.d/kibana start"
stop program = "/etc/init.d/kibana stop"
set httpd port 2812 and
use address localhost # only accept connection from localhost
allow localhost # allow localhost to connect to the server and
# set daemon mode timeout to 1 minute
set daemon 5
check process proxy with pidfile /var/run/proxy.pid
start program = "/bin/bash -c 'cd /home/ec2-user; nohup ./cmd-linux-amd64 > /var/log/proxy.log 2>&1 & echo $! > /var/run/proxy.pid'" as uid "ec2-user" and gid "ec2-user"
stop program = "/bin/kill -9 `cat /var/run/proxy.pid`"
# Include all files from /etc/monit.d/
include /etc/monit.d/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment