• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
PuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with Puppet
 

PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet

on

  • 1,007 views

Choon Ming, senior consultant at OlinData, gave an overview of how Puppet compliments Nagios, and how you can make Puppet work with Nagios in under 10 minutes.

Choon Ming, senior consultant at OlinData, gave an overview of how Puppet compliments Nagios, and how you can make Puppet work with Nagios in under 10 minutes.

Statistics

Views

Total Views
1,007
Views on SlideShare
973
Embed Views
34

Actions

Likes
1
Downloads
6
Comments
0

3 Embeds 34

http://www.olindata.com 16
http://olindata.com 14
http://drupal.olindata.com 4

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    PuppetCamp SEA @ Blk 71 -  Nagios in under 10 mins with Puppet PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet Presentation Transcript

    • Nagios in <10 mins with Puppet December 3rd, 2012 PuppetCamp SEA #2, Singapore Goh Choon Ming, OlinData
    • Setup difficulty?
    • Puppet made it simpler to setup
    • Puppet resource types
    • @@nagios_host { $::fqdn: ensure => present, address => $::fqdn, use => "generic-host", tag => $domain, }
    • @@nagios_service { "check_ping_$::fqdn" : host_name => $::fqdn, use => "generic-service", check_command => "check_ping!600,20%!1000,50%", service_description => "check_ping", tag => $::domain, }
    • nagios_command { check_http_alt: ensure => present, command_line => "/usr/lib/nagios/plugins/check_http -H $HOSTADDRESS$ -p $ARG1$ -u $ARG2$-e HTTP/1.1 200 OK", }
    • nagios_contact { choonming: ensure => present, alias => CM, email => choonming@olindata.com, host_notification_commands => notify-service-by-email, service_notification_commands => notify-service-by-email, host_notification_period => 24x7, service_notification_period => 24x7, host_notification_options => d,r, service_notification_options => w,c,u,r, }
    • And many many othershttp://docs.puppetlabs.com/references/stable/type. html
    • Yet there is another problem?What is it and how do we fix it?
    • Functions
    • Tagging
    • Exported resources
    • @@nagios_host { $::fqdn: address => $::fqdn, use => "generic-host", tag => $::domain, }Nagios_host <<| tag == olindata.com |>> { target => /etc/nagios3/conf.d/services.cfg, notify => Service[ nagios3 ], }
    • How to create a multi-environment Nagios setup?
    • Environments
    • if ($environment == "production" ) { Nagios_host <<| tag == "prod.olindata.com" |>> { target => "/etc/nagios3/conf.d/hosts.cfg", notify => Service[ nagios3 ], } Nagios_service <<| tag == "prod.olindata.com" |>> { target => "/etc/nagios3/conf.d/services.cfg", notify => Service[ nagios3 ], }else { Nagios_host <<| tag == "test.olindata.com" |>> { target => "/etc/nagios3/conf.d/hosts.cfg", notify => Service[ nagios3 ], } Nagios_service <<| tag == "test.olindata.com" |>> { target => "/etc/nagios3/conf.d/services.cfg", notify => Service[ nagios3 ], }
    • Taking another step further with Nagios
    • Executing plugins on remote machines with NRPE
    • Defined resource types
    • define nagios::nrpe($command, $sudo=false) { $sudo_command = $sudo ? { true => "/usr/bin/sudo ", False => , } file { "/etc/nagios/nrpe.d/$name.cfg": content => "command[$name]=$sudo_command/usr/lib/nagios/plugins/$commandn", require => Package["nagios-nrpe-server"], notify => Service["nagios-nrpe-server"], }}
    • @@nagios_service { "check_disk_${::fqdn}": check_command => "check_nrpe_1arg!check_disk", use => "generic-service", host_name => $f::qdn, service_description => "check_disk", tag => $::domain, }nagios::nrpe { "check_disk" : command => "check_disk -w 20% -c 10% -l" }
    • Taking another step further with Nagios and Puppets resources resource type
    • resources { nagios_host: purge => true, }resources { nagios_service: purge => true, }
    • DEMO
    • Questions?
    • How to find me? Email: ▫ choonming[at]olindata.com• Twitter: ▫ @choonming• Github: ▫ https://github.com/choonming ▫ https://github.com/tribily• Facebook: ▫ https://fb.me/olindata• IRC: ▫ Freenode - choonming
    • Thank you!