Sha256: 792ff1a253b9766ecc2003f762ec5af9463b891542033921aee9c4b0cb45587a

Contents?: true

Size: 1.4 KB

Versions: 31

Compression:

Stored size: 1.4 KB

Contents

# Monit configuration for THIN :  <%= fetch(:application) %>  (<%= fetch(:stage) %>)
<%  fetch(:app_instances, 1).times do |n| %>
  check process <%= fetch(:application) %>_<%= fetch(:stage) %>_thin_<%= n %> with pidfile <%= deploy_to %>/shared/pids/thin_<%= fetch(:application) %>_<%= fetch(:stage) %>.<%= n %>.pid
    group thin-<%= fetch(:application) %>-<%= fetch(:stage) %>
    start program = "/bin/su - <%= @role.user %> -c 'cd <%= current_path %> ;<% if fetch(:monit_thin_with_secret) %> export SECRET_KEY_BASE=<%= fetch(:secrets_key_base) %>; export <%= fetch(:secrets_key_name) %>=<%= fetch(:secrets_key_base) %>;<% end %> bundle exec thin start -C config/thin_app_<%= fetch(:stage) %>.yml -o <%= n %>' "
    stop program = "/bin/su - <%= @role.user %> -c 'cd <%= current_path %> ; bundle exec thin stop -C config/thin_app_<%= fetch(:stage) %>.yml -o <%= n %>' " 
    # if does not exist then start # (default)
    # if does not exist for 3 cycles then alert
    if 3 restarts within 5 cycles then alert
    if mem > <%= ( fetch( :monit_thin_totalmem_mb, 300 ).to_i * 0.75 ).to_i %> MB then alert
    if mem > <%= fetch( :monit_thin_totalmem_mb, 300 ) %> MB for 2 cycles then restart
    if cpu > 50% then alert
    if cpu > 50% for 3 cycles then restart
    if 5 restarts within 5 cycles then timeout
    # alert <%= fetch(:monit_mail_to) %> only on { pid }
    if changed pid 2 times within 20 cycles then alert
<% end %>

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
magic_recipes_two-0.0.74 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.73 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.72 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.71 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.70 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.69 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.68 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.67 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.66 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.65 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.64 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.63 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.62 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.61 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.60 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.59 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.58 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.57 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.56 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb
magic_recipes_two-0.0.55 lib/generators/capistrano/magic_recipes/templates/monit/thin.erb