by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 18 2017 22:37

    shoekstra on use_nginx

    (compare)

  • Sep 18 2017 22:37

    tas50 on master

    Depend on nginx instead of chef… Use nginx >= 7.0 Merge pull request #552 from so… (compare)

  • Sep 18 2017 22:37
    tas50 closed #552
  • Sep 18 2017 22:14
    shoekstra synchronize #552
  • Sep 18 2017 22:14

    shoekstra on use_nginx

    Use nginx >= 7.0 (compare)

  • Sep 18 2017 22:12
    shoekstra commented #551
  • Sep 18 2017 22:11
    shoekstra commented #552
  • Sep 18 2017 22:11
    shoekstra commented #552
  • Sep 18 2017 22:09
    shoekstra closed #546
  • Sep 18 2017 22:09
    shoekstra commented #546
  • Sep 18 2017 22:06
    shoekstra synchronize #552
  • Sep 18 2017 22:06

    shoekstra on use_nginx

    Depend on nginx instead of chef… (compare)

  • Sep 18 2017 22:03
    shoekstra review_requested #551
  • Sep 18 2017 22:01
    shoekstra synchronize #551
  • Sep 18 2017 22:01

    shoekstra on release_8.0.0

    Release 8.0.0 (compare)

  • Sep 18 2017 22:00
    shoekstra review_requested #552
  • Sep 18 2017 22:00
    shoekstra review_requested #552
  • Sep 18 2017 22:00
    shoekstra opened #552
  • Sep 18 2017 21:59

    shoekstra on use_nginx

    Depend on nginx instead of chef… (compare)

  • Sep 18 2017 21:57
    shoekstra review_requested #551
Deepak Kosaraju
@kkdk5535
belated Happy New Year to all
Sander Botman
@sbotman
Yes
Also this year we will try to support the nagios cookbook and you are right that it's was a bit quite, we enjoyed some holidays but we are back for action ..
Jose Olcese
@jolcese
Has anyone integrated LiveStatus with a chef recipe?
Deepak Kosaraju
@kkdk5535
We did ingerate but problem is we took different path than community version for installing & configuring nagios in our environment
So I am taking best logics and practices from community version and adding them to our existing version of in house nagios cookbook.
I can definetly share the code for livestatus integration - its around attributes, package, template resource.
Sander Botman
@sbotman
I have never used livestatus, but
I'm happy to merge any PR that supports it
Jose Olcese
@jolcese
@kkdk5535 , can you please share the code? I can then create a PR on the current code
Deepak Kosaraju
@kkdk5535
@jolcese sorry didn’t notice your message - I was busy with internal requests. I am going to put the code together for livestatus and share it here
Deepak Kosaraju
@kkdk5535
Attributes
default['nagios']['user'] = "nagios"
default['nagios']['group'] = "nagios"

default['nagios']['nagios3_version'] = '3.5.1-2.el6'
default['nagios']['nagios3_packages'] = %w{ nagios-common nagios }
default['nagios']['nagios3_livestatus_version'] = '1.2.4p2-2.el6'
set['nagios']['mklivestatus']['socket'] = "/var/lib/nagios/rw/livestatus"

default['nagios']['nagios4_version'] = '4.1.1-2.el6'
default['nagios']['nagios4_packages'] = %w{ nagios-contrib nagios-devel nagios }
default['nagios']['nagios4_livestatus_version'] = '1.2.6p15-1'

default['nagios']['plugins_version'] = '2.1.1.el6'

# Enable mklivestatus for Thruk?
set['nagios']['enable_mklivestatus'] = false
set['nagios']['mklivestatus']['port'] = 6557
Recipe code
if node['roles'].include?("monitoring_nagios4")
  package_list = node['nagios']['nagios4_packages']
  package_version = node['nagios']['nagios4_version']
  livestatus_pkg_name = 'mk-livestatus'
  livestatus_version = node['nagios']['nagios4_livestatus_version']
else
  package_list = node['nagios']['nagios3_packages']
  package_version = node['nagios']['nagios3_version']
  livestatus_pkg_name = 'check-mk-livestatus'
  livestatus_version = node['nagios']['nagios3_livestatus_version']
end
…

yum_package "#{livestatus_pkg_name}" do
  version livestatus_version
end

%w{ xinetd nsca }.each do |pkg| 
  package pkg 
end

service "xinetd" do
  supports :status => true, :restart => true, :reload => true
  action [:enable, :start]
end

# and the xinetd file
cookbook_file "/etc/xinetd.d/livestatus" do
  notifies :reload, "service[xinetd]"
end
Template Code
<% if node['nagios']['enable_mklivestatus'] -%>
# need mk-livestatus for thruk
event_broker_options=-1
broker_module=/usr/lib64/mk-livestatus/mk-livestatus/livestatus.o <%= node['nagios']['log_dir'] %>/rw/livestatus
<% end %>
Deepak Kosaraju
@kkdk5535
@jolcese - I hope above gives all ideas to start and community will be benefitied from it. Good luck. Happy to assist anything related to mk-livestatus integration in community cookbook. I am still new to nagios community cookbook for most of its offereing compared to our inhouse cookbook for nagios.
Jose Olcese
@jolcese
Thanks @kkdk5535 . I'll start integrating this idea into the community recipe
Ovais Tariq
@ovaistariq
@sbotman any suggestions on how to manage delaying monitoring of hosts
for example, we want to ignore hosts via tags, but if its a new node nagios happens to discover it before that node has run the recipe that sets the tags
i have modified the _load_default_config recipe as follows
nodes.each do |n|
  # Does the node need to have a particular recipe in the run_list for it to
  # be monitored? If so search the node's run_list
  next if (not node['nagios']['search_recipe_run_list'].nil? and not n.recipe?(node['nagios']['search_recipe_run_list']))

  if n.respond_to?('tags')
    Nagios.instance.push(n) unless nagios_array(n.tags).any? { |tag| exclude_tag.include?(tag) }
  else
    Nagios.instance.push(n)
  end
end
and then defined the following attribute
default['nagios']['search_recipe_run_list’] = ‘some_cookbook::some_recipe'
Sander Botman
@sbotman
Hmmmm
Sander Botman
@sbotman
so the attribute on the nagios server will be the name of a recipe that needs to be on the runlist of all nodes that you want to monitor with nagios..
Ovais Tariq
@ovaistariq
Yes that's what I am doing right now
I couldn't find a better way of doing it otherwise
The problem with ignoring by tags is that when a node is bootstrapped it registers with the chef server but hasn't run the recipe yet
So Nagios becomes aware of it, however no tags are set yet because the runlist is still being applied or hasn't been applied yet
@sbotman if you have any other ideas
Sander Botman
@sbotman
Well, we can also ignore the client within nagios if the chef client is unable to run, so we would need to check the last update attribute. But we are also entering dummy nodes within chef for monitoring, and these would also be ignored because they don't contain this attribute...
Ovais Tariq
@ovaistariq
So what do you think is the best way to tackle this problem ?
Jose Olcese
@joseolcese
Question, I'm installing nagios on ubuntu 14.04. I also install nrpe in clients and in server. If I install nrpe from source, I get check_nrpe installed on server and everything works. But if I install nrpe from packages (default in ubuntu), there's no /usr/lib/nagios/plugins/check_nrpe
Sander Botman
@sbotman
maybe you can use the provides option from apt-get to see which package provides check_nrpe
If apt-get has such option... because I normally use yum...
Jose Olcese
@joseolcese
it's provided by nagios-nrpe-plugin. But it will also install nagios itself...
and apache and...
Sander Botman
@sbotman
apt-file search check_nrpe
Oooh
So the package nagios-nrpe-plugin will also install other packages like nagios and apache?
Jose Olcese
@joseolcese
yes. nagios-nrpe-plugin has nagios, apache, etc as dependencies
So, when you install it, you end up with lost of things...
And I'm installing nagios server from source because we want 4.0.8.
On ubuntu the default package is 3 something
Sander Botman
@sbotman
oke, well that sucks..
sudo apt-get install nagios-nrpe-server nagios-plugins
so without the -nrpe- does that make any difference?
Jose Olcese
@joseolcese
Ok, seems that it's not a dependency and instead a recommended
And --no-install-recommends shall work on apt-get
Will let you know
Jose Olcese
@joseolcese
Yeap, that works.