[chef] Re: Re: Re: Community input needed on the Nagios cookbook


Chronological Thread 
  • From: Mat Davies < >
  • To:
  • Subject: [chef] Re: Re: Re: Community input needed on the Nagios cookbook
  • Date: Mon, 13 Aug 2012 16:24:45 +0100



On 13 August 2012 15:57, Tim Smith < " target="_blank"> > wrote:
Any chance you could share that clientless code?  I was about to whip something up to handle that exact scenario.  I have a lot of old systems that aren't managed with Chef and probably never will be that I still need to monitor in some fashion.


I think this is all the additions I made to cover it.

templates/default/hosts.cfg.erb
#############
#clientless nodes from databag
<% @clientless.each do |c| -%>
define host {
  use server
  address <%= c['ipaddress'] %>
  host_name <%= c['id'] %>
  hostgroups <%= c['hostgroup_name'] %>
}
<% end -%>
#############

templates/default/hostgroups.cfg.erb
#############
#from databag clientless in chef
<% hostgroup_unique_array = Array.new
@hostgroup.each do | h|
hostgroup_unique_array << h['hostgroup_name']
hostgroup_unique_array = hostgroup_unique_array.uniq
end
hostgroup_unique_array.each do |q|
-%>
define hostgroup {
  hostgroup_name <%= q %>
  alias <%= q %>
}

<% end -%>
#############

recipes/server.rb
#############
hostgroup = search(:clientless, 'hostgroup_name:*')

if hostgroup.empty?
  Chef::Log.info("No hostgroups in databag for clientless nodes returned from search, using this node so hostgroups.cfg has data")
  hostgroup = Array.new
  hostgroup << hostgroup
end

if clientless.empty?
  Chef::Log.info("No clientless nodes returned from search, using this node so hosts.cfg has data")
  clientless = Array.new
  clientless << clientless
end
#############

Databag named clientless contain items with ipaddress, id, hostgroup_name
items limits can only be in one hostgroup
services are defined against that homegroup default to a basic host-alive ping check might be good standard.


 
On 13 August 2012 00:48, Tim Smith < " target="_blank"> > wrote:
I'd love to get feedback from the community on the current state of the Nagios cookbook.  Automated monitoring of systems is in my opinion probably the coolest feature of a configuration management systems, and a large number of people are using Nagios.  The Nagios cookbook needed / needs some love though.  I've been doing a lot of work on the cookbook lately since it was lacking functionality I needed and was outright broken in a lot of ways.  I know there's a lot left to do and hopefully you guys can provide some input on what's necessary.

If you used the cookbook and it didn't work for you what problems did you run into?
If you had to modify the cookbook with hard coded values (my biggest issue) for your environment what was lacking that forced you to do this?
In general what would you like to see that isn't there yet?
 
The main problem I have with the nagios cookbook was monitoring systems not covered by chef without hard coding them into recipes or templates for things like firewalls, routers, switches, printers, etc. I ended up hacking the code to support a data_bag "clientless" which I could list items in there and the nagios checks that apply to them.
 

What I've added that hopefully should get merged in the next release cycle:
  • Defining Event handlers from data bags
  • Optional support for monitoring hosts in multiple environments
  • Support for environments with Windows hosts without applying Linux checks that will always fail
  • Support for defining nagios host groups from chef search queries stored in data bags
  • Install Nagios 3.4.1 not 3.2.3 when installing from source
  • Support for installing the server from source, while installing the client from package (if you just want a newer server than Ubuntu packages)
  • Fixed source installs of the server to actually work
Look forward to this alot of these are why I am stilled force to run my pre-chef nagios solution as well to cover them.
 
What I still need to get pushed upstream
  • Support for installing NRPE via EPEL packages on RHEL distros instead of compiling from source
  • Ability to define blacklisted chef environments (preprod/dev) where host/service alerting is disabled
  • The Nagios user needs passwordless sudo out of the box to perform most NRPE checks
So if you have some time let me know your experiences

Tim Smith

Operations Engineer, SaaS Operations

M: +1 707.738.8132

TW: @tas50

webtrends

Real-Time Relevance. Remarkable ROI.™

London | Portland | San Francisco | Melbourne | Tokyo






Archive powered by MHonArc 2.6.16.

§