namespace :monit do
desc <<-DESC
Restart (HUP) monit process.
HUP's the process from the pid file, if it exists.
- monit_pid_path
- Path to monit pid file
- Defaults to @/var/run/monit.pid@
"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.
- monit_bin_path
- Path to monit bin.
- Defaults to @monit@
"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.
- monit_bin_path
- Path to monit bin.
- Defaults to @monit@
"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