forked from phlipper/chef-monit
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update of ssh check for CentOS
- Loading branch information
Andriy SAMILYAK
committed
Oct 31, 2012
1 parent
9c0a3e4
commit 093c68d
Showing
5 changed files
with
59 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,13 +1,13 @@ | |||
define :monitrc, :name => nil, :variables => {} do | define :monitrc, :name => nil, :variables => {} do | ||
Chef::Log.info("Making monitrc for: #{params[:name]}") | Chef::Log.info("Making monitrc for: #{params[:name]}") | ||
|
|
||
template "/etc/monit/conf.d/#{params[:name]}.monitrc" do | template "#{node["monit"]["includes_dir"]}/#{params[:name]}.monitrc" do | ||
owner "root" | owner "root" | ||
group "root" | group "root" | ||
mode "0644" | mode "0644" | ||
source "#{params[:name]}.monitrc.erb" | source "#{params[:name]}.monitrc.erb" | ||
variables params[:variables] | variables params[:variables] | ||
notifies :run, resources(:execute => "restart-monit") | notifies :restart, resources(:service => "monit") | ||
action :create | action :create | ||
end | end | ||
end | end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,5 @@ | |||
check process sshd with pidfile /var/run/sshd.pid | |||
start program "/sbin/service sshd start" | |||
stop program "/sbin/service sshd stop" | |||
if failed port 22 protocol ssh then restart | |||
if 5 restarts within 5 cycles then timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters