Giter Site home page Giter Site logo

cookbook-mg_nagios's Introduction

Access the Nagios UI at http://localhost:30080/

nagiosadmin/nagiosadmin

What?

  • Wrapper cookbook around the Nagios Chef Cookbook
  • Multi node setup using test-kitchen
  • Can test monitoring of real servers all in your local env

How?

  • Vagrant, Virtualbox and TestKitchen FTW! (with private networking)
  • Using attributes with static private IPs (instead of chef search)
  • Dummy test user for passwordless ssh
  • Default check interval is set to 15 seconds for local dev (via .kitchen.yml)

Issues

  1. Converge twice on primary to get rid of primary1-bento-centos-67 in Nagios

Versions

$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.12.3
BuildVersion:	16D32

$ chef -v
Chef Development Kit Version: 1.2.22
chef-client version: 12.18.31
delivery version: master (0b746cafed65a9ea1a79de3cc546e7922de9187c)
berks version: 2017-03-19T21:01:16.449619 1924] 2017-03-19T21:01:16.449800 1924] 2017-03-19T21:01:16.449932 1924] 2017-03-19T21:01:16.450053 1924] 2017-03-19T21:01:16.484330 1924] 2017-03-19T21:01:16.484480 1924] 5.6.0
kitchen version: 1.15.0

$ VirtualBox -h
Oracle VM VirtualBox Manager 5.1.14

$ vagrant --version
Vagrant 1.9.1

Misc

  • Nagios comes with a very handy config checker. If you mess up your Nagios config, chef run will dump
        * service[nagios] action reload
           
           ================================================================================
           Error executing action `reload` on resource 'service[nagios]'
           ================================================================================
           
           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           Expected process to exit with [0], but received '1'
           ---- Begin output of /sbin/service nagios reload ----
           STDOUT: Running configuration check... CONFIG ERROR!  Reload aborted.  Check your Nagios configuration.
           STDERR: 
           ---- End output of /sbin/service nagios reload ----
           Ran /sbin/service nagios reload returned 1
           
           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/nagios/recipes/default.rb
           
           200: service 'nagios' do
           201:   service_name nagios_service_name
           202:   supports :status => true, :restart => true, :reload => true
           203:   action [:enable, :start]
           204: end
           
           Compiled Resource:
           ------------------
           # Declared in /tmp/kitchen/cache/cookbooks/nagios/recipes/default.rb:200:in `from_file'
           
           service("nagios") do
             action [:enable, :start]
             supports {:status=>true, :restart=>true, :reload=>true}

Its very handy to kitchen login primary1 and then run

$ nagios --verify-config /etc/nagios/conf.d/

cookbook-mg_nagios's People

Contributors

manasg avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.