Sha256: ce3df30321b17d35207a21f5c3424a5cfc2eb0d74fc004282db9c5f62261942c

Contents?: true

Size: 1.07 KB

Versions: 46

Compression:

Stored size: 1.07 KB

Contents

namespace :rubber do
  
  namespace :monit do
  
    rubber.allow_optional_tasks(self)
    
    # monit needs to get stopped first and started last so that it doesn't
    # mess with us restarting everything as part of a deploy.
    before "rubber:pre_stop", "rubber:monit:stop"
    before "rubber:pre_restart", "rubber:monit:stop"
    after "rubber:post_start", "rubber:monit:start"
    after "rubber:post_restart", "rubber:monit:start"

    desc "Start monit daemon monitoring"
    task :start, :roles => :monit do
      rsudo "service monit status || service monit start"
    end
    
    desc "Stop monit daemon monitoring"
    task :stop, :roles => :monit do
      rsudo "service monit stop || true"
    end
    
    desc "Restart monit daemon monitoring"
    task :restart, :roles => :monit do
      stop
      start
    end

    desc "Display status of monit daemon monitoring"
    task :status, :roles => :monit do
      rsudo "service monit status || true"
      rsudo "ps -eopid,user,fname | grep [m]onit || true"
      rsudo "netstat -tulpn | grep monit || true"
    end

  end

end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
rubber-3.2.2 templates/monit/config/rubber/deploy-monit.rb
rubber-3.2.1 templates/monit/config/rubber/deploy-monit.rb
rubber-3.2.0 templates/monit/config/rubber/deploy-monit.rb
rubber-3.1.0 templates/monit/config/rubber/deploy-monit.rb
rubber-3.0.1 templates/monit/config/rubber/deploy-monit.rb
rubber-3.0.0 templates/monit/config/rubber/deploy-monit.rb
rubber-2.16.0 templates/monit/config/rubber/deploy-monit.rb
rubber-2.15.2 templates/monit/config/rubber/deploy-monit.rb
rubber-2.15.1 templates/monit/config/rubber/deploy-monit.rb
rubber-2.15.0 templates/monit/config/rubber/deploy-monit.rb
rubber-2.14.0 templates/monit/config/rubber/deploy-monit.rb
rubber-2.13.1 templates/monit/config/rubber/deploy-monit.rb
rubber-2.13.0 templates/monit/config/rubber/deploy-monit.rb
rubber-2.12.2 templates/monit/config/rubber/deploy-monit.rb
rubber-2.12.1 templates/monit/config/rubber/deploy-monit.rb
rubber-2.12.0 templates/monit/config/rubber/deploy-monit.rb
rubber-2.11.0 templates/monit/config/rubber/deploy-monit.rb
rubber-2.10.2 templates/monit/config/rubber/deploy-monit.rb
rubber-2.10.1 templates/monit/config/rubber/deploy-monit.rb
rubber-2.10.0 templates/monit/config/rubber/deploy-monit.rb