Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vivekjuneja/4dd5cc3ec7819b081bda to your computer and use it in GitHub Desktop.
Save vivekjuneja/4dd5cc3ec7819b081bda to your computer and use it in GitHub Desktop.
Monit Service Monitor Block for Docker Container
# Inside main monitrc
# Check that services are running and also define start and stop commands for them.
# You will need one of these for each container
# as well as working out a restarting and/or red
eploying workflow.
check process <container-name> with pidfile /var/run/monit/<container-name>.pid
start = "/path/to/pid/script start <container-name> '<docker-arguments>'"
stop = "/path/to/pid/script stop <container-name>"
if does not exist then alert
if cpu equal 0%
and memory equal 0kB
for 5 cycles then alert
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment