Skip to content

Instantly share code, notes, and snippets.

@arion
Created July 6, 2016 08:52
Show Gist options
  • Save arion/a1950c329e4ece00f69fd4ef0073660b to your computer and use it in GitHub Desktop.
Save arion/a1950c329e4ece00f69fd4ef0073660b to your computer and use it in GitHub Desktop.
check process puma_web
with pidfile /home/deploy/rails_apps/store/shared/tmp/pids/puma_web.pid
if totalmem is greater than 1024 MB for 1 cycles then alert
if totalmem is greater than 1024 MB for 2 cycles then
exec "/bin/bash -c '/sbin/restart store-puma-web'" as uid root and gid root
check process puma_api
with pidfile /home/deploy/rails_apps/store/shared/tmp/pids/puma_api.pid
if totalmem is greater than 512 MB for 1 cycles then alert
if totalmem is greater than 512 MB for 2 cycles then
exec "/bin/bash -c '/sbin/restart store-puma-api'" as uid root and gid root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment