Sha256: 708a92c1dd136afb018cd9fc591c0b0c63e9ca979cef6f006eaa6243bb2745df

Contents?: true

Size: 1.1 KB

Versions: 8

Compression:

Stored size: 1.1 KB

Contents

namespace :monit do
  
  desc <<-DESC
  Restart (HUP) monit process.
  
  HUP's the process from the pid file, if it exists.
  
  <dl>
  <dt>monit_pid_path</dt>
  <dd>Path to monit pid file</dd>
  <dd class="default">Defaults to @/var/run/monit.pid@</dd>
  </dl>
  "Source":#{link_to_source(__FILE__)}
  DESC
  task :restart do    
    fetch_or_default(:monit_pid_path, "/var/run/monit.pid")
    
    run_via %{sh -c "[ ! -e '#{monit_pid_path}' ] || kill -HUP `cat #{monit_pid_path}`"}
    
  end
  
  desc <<-DESC
  Unmonitor all.
  
  <dl>
  <dt>monit_bin_path</dt>
  <dd>Path to monit bin.</dd>
  <dd>Defaults to @monit@</dd>
  </dl>
  "Source":#{link_to_source(__FILE__)}
  DESC
  task :unmonitor_all do
    fetch_or_default(:monit_bin_path, "monit")
    
    run_via "#{monit_bin_path} unmonitor all"
  end
  
  desc <<-DESC
  Monitor all.
  
  <dl>
  <dt>monit_bin_path</dt>
  <dd>Path to monit bin.</dd>
  <dd>Defaults to @monit@</dd>
  </dl>
  "Source":#{link_to_source(__FILE__)}
  DESC
  task :monitor_all do
    fetch_or_default(:monit_bin_path, "monit")
    
    run_via "#{monit_bin_path} monitor all"
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
capitate-0.2.14 lib/recipes/monit.rb
capitate-0.2.13 lib/recipes/monit.rb
capitate-0.2.15 lib/recipes/monit.rb
capitate-0.3.4 lib/recipes/monit.rb
capitate-0.3.5 lib/recipes/monit.rb
capitate-0.3.2 lib/recipes/monit.rb
capitate-0.3.1 lib/recipes/monit.rb
capitate-0.3.3 lib/recipes/monit.rb