[英]cap monit:setup failed
I'm using monit for monitoring my rails app. 我正在使用monit监视我的Rails应用程序。 This is my monit.rb file: 这是我的monit.rb文件:
namespace :monit do
desc "Install Monit"
task :install do
run "#{sudo} apt-get -y install monit"
end
after "deploy:install", "monit:install"
desc "Setup all Monit configuration"
task :setup do
#monit_config "monitrc", "/etc/monit/monitrc"
#nginx
#unicorn
monit_config "nginx"
syntax
reload
end
after "deploy:setup", "monit:setup"
task(:nginx, roles: :web) { monit_config "nginx" }
task(:unicorn, roles: :app) { monit_config "unicorn" }
%w[start stop restart syntax reload].each do |command|
desc "Run Monit #{command} script"
task command do
run "#{sudo} service monit #{command}"
end
end
end
def monit_config(name, destination = nil)
destination ||= "/etc/monit/conf.d/#{name}.conf"
template "monit/#{name}.erb", "/tmp/monit_#{name}"
run "#{sudo} mv /tmp/monit_#{name} #{destination}"
run "#{sudo} chown root #{destination}"
run "#{sudo} chmod 600 #{destination}"
end
When I run cap monit:setup
on the end of log when monit go to reload I get: 当我在重新加载日志时在日志末尾运行cap monit:setup
时,我得到:
** [out :: 11.111.1.11] Control file syntax OK
command finished in 1073ms
* executing `monit:reload'
* executing "sudo -p 'sudo password: ' service monit reload"
servers: ["11.111.1.11"]
[50.116.2.102] executing command
** [out :: 11.111.1.11] Usage: /etc/init.d/monit {start|stop|restart|force-reload|syntax}
command finished in 987ms
failed: "sh -c 'sudo -p '\\''sudo password: '\\'' service monit reload'" on 11.111.1.11
failed: "sh -c 'sudo -p '\\''sudo password: '\\'' service monit reload'" on 11.111.1.11 失败:11.111.1.11上的“ sh -c'sudo -p'\\''sudo密码:'\\''service monit reload'”
Where is my error? 我的错误在哪里?
The monit service daemon does not have a reload
command argument. monit服务守护程序没有reload
命令参数。 You can see the hint of the error here: 您可以在此处看到错误提示:
Usage: /etc/init.d/monit {start|stop|restart|force-reload|syntax}
So you have to choose one of the above arguments. 因此,您必须选择以上参数之一。 reload
does not exist. reload
不存在。
You probably want force-reload
or restart
instead. 您可能需要force-reload
或restart
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.