Chinaunix首页 | 论坛 | 博客
  • 博客访问: 362307
  • 博文数量: 36
  • 博客积分: 570
  • 博客等级: 中士
  • 技术积分: 1042
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-08 20:53
文章分类
文章存档

2015年(1)

2014年(1)

2013年(14)

2012年(10)

2011年(10)

分类: 系统运维

2013-03-18 10:25:38

#
# 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) |
给主人留下些什么吧!~~