#
# Cookbook Name:: nagios
# Recipe:: default
#
# Copyright 2013, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
remote_file "/tmp/epel-release-6-8.noarch.rpm" do
source ""
end
package "epel-release" do
action :install
source "/tmp/epel-release-6-8.noarch.rpm"
provider Chef::Provider::Package::Rpm
end
package "nagios" do
action :install
end
service "nagios" do
action [ :start, :enable]
end
package "nagios-plugins" do
action :install
end
package "nagios-plugins-all" do
action :install
end
package "nrpe" do
action :install
end
package "rrdtool" do
action :install
end
package "gd" do
action :install
end
package "gd-devel" do
action :install
end
package "pnp4nagios" do
action :install
end
template "/etc/nagios/nagios.cfg" do
source "nagios.cfg.erb"
end
template "/etc/nagios/objects/commands.cfg" do
source "commands.cfg.erb"
end
template "/etc/nagios/objects/templates.cfg" do
source "templates.cfg.erb"
end
execute "echo" do
command "echo /usr/sbin/nrpe -c /etc/nagios/nrpe.cfg -d >>/etc/rc.local"
end
execute "htpasswd" do
command "htpasswd -bm /etc/nagios/passwd nagiosadmin ondemand"
end
阅读(1695) | 评论(0) | 转发(0) |