SlideShare una empresa de Scribd logo
1 de 30
Descargar para leer sin conexión
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 others
http://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 Puppet's
              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!

Más contenido relacionado

La actualidad más candente

San Francisco Java User Group
San Francisco Java User GroupSan Francisco Java User Group
San Francisco Java User Group
kchodorow
 
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
Ryousei Takano
 
Huong dan cai dat hadoop
Huong dan cai dat hadoopHuong dan cai dat hadoop
Huong dan cai dat hadoop
Quỳnh Phan
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
Night Sailer
 
MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)
MongoSF
 

La actualidad más candente (19)

mdpress(MarkDown Press)を使ったプレゼンテーション作成
mdpress(MarkDown Press)を使ったプレゼンテーション作成mdpress(MarkDown Press)を使ったプレゼンテーション作成
mdpress(MarkDown Press)を使ったプレゼンテーション作成
 
Bash Scripting Workshop
Bash Scripting WorkshopBash Scripting Workshop
Bash Scripting Workshop
 
San Francisco Java User Group
San Francisco Java User GroupSan Francisco Java User Group
San Francisco Java User Group
 
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
高性能かつスケールアウト可能なHPCクラウド AIST Super Green Cloud
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at StripeBuilding Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
 
Mongo à la Resque
Mongo à la ResqueMongo à la Resque
Mongo à la Resque
 
Cache metadata
Cache metadataCache metadata
Cache metadata
 
DashProfiler 200807
DashProfiler 200807DashProfiler 200807
DashProfiler 200807
 
Huong dan cai dat hadoop
Huong dan cai dat hadoopHuong dan cai dat hadoop
Huong dan cai dat hadoop
 
Not Really PHP by the book
Not Really PHP by the bookNot Really PHP by the book
Not Really PHP by the book
 
Couchdb
CouchdbCouchdb
Couchdb
 
Webinar: Replication and Replica Sets
Webinar: Replication and Replica SetsWebinar: Replication and Replica Sets
Webinar: Replication and Replica Sets
 
Alexander Mostovenko "Modern approach to localization in javascript with the ...
Alexander Mostovenko "Modern approach to localization in javascript with the ...Alexander Mostovenko "Modern approach to localization in javascript with the ...
Alexander Mostovenko "Modern approach to localization in javascript with the ...
 
Laporan setting dns
Laporan setting dnsLaporan setting dns
Laporan setting dns
 
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
 
Parallel Computing With Dask - PyDays 2017
Parallel Computing With Dask - PyDays 2017Parallel Computing With Dask - PyDays 2017
Parallel Computing With Dask - PyDays 2017
 
MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)MongoDB Replication (Dwight Merriman)
MongoDB Replication (Dwight Merriman)
 
Redis for the Everyday Developer
Redis for the Everyday DeveloperRedis for the Everyday Developer
Redis for the Everyday Developer
 

Destacado

Estrategias de búsqueda y recopilación de información biomédica
Estrategias de búsqueda y recopilación de información biomédicaEstrategias de búsqueda y recopilación de información biomédica
Estrategias de búsqueda y recopilación de información biomédica
Diego Rivera
 

Destacado (6)

Diapositivas twitter
Diapositivas twitterDiapositivas twitter
Diapositivas twitter
 
Estrategias de búsqueda y recopilación de información biomédica
Estrategias de búsqueda y recopilación de información biomédicaEstrategias de búsqueda y recopilación de información biomédica
Estrategias de búsqueda y recopilación de información biomédica
 
Apresentacao Multiclick Brasil - Grupo Falcon
Apresentacao Multiclick Brasil - Grupo FalconApresentacao Multiclick Brasil - Grupo Falcon
Apresentacao Multiclick Brasil - Grupo Falcon
 
Herramientas
HerramientasHerramientas
Herramientas
 
Diapositivas twitter
Diapositivas twitterDiapositivas twitter
Diapositivas twitter
 
PuppetCamp SEA @ Blk 71 - Cloud Management with Puppet
PuppetCamp SEA @ Blk 71 - Cloud Management with PuppetPuppetCamp SEA @ Blk 71 - Cloud Management with Puppet
PuppetCamp SEA @ Blk 71 - Cloud Management with Puppet
 

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

Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Masahiro Nagano
 
Zendcon 2007 Api Design
Zendcon 2007 Api DesignZendcon 2007 Api Design
Zendcon 2007 Api Design
unodelostrece
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统
yiditushe
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook
guoqing75
 
Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012
Carlos Sanchez
 
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
Kar Juan
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
diego_k
 

Similar a PuppetCamp SEA @ Blk 71 - Nagios in under 10 mins with Puppet (20)

Version Control with Puppet
Version Control with PuppetVersion Control with Puppet
Version Control with Puppet
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with Puppet
 
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
Designing Opeation Oriented Web Applications / YAPC::Asia Tokyo 2011
 
Puppet @ Seat
Puppet @ SeatPuppet @ Seat
Puppet @ Seat
 
Zendcon 2007 Api Design
Zendcon 2007 Api DesignZendcon 2007 Api Design
Zendcon 2007 Api Design
 
Facebook的缓存系统
Facebook的缓存系统Facebook的缓存系统
Facebook的缓存系统
 
CakePHP workshop
CakePHP workshopCakePHP workshop
CakePHP workshop
 
4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook4069180 Caching Performance Lessons From Facebook
4069180 Caching Performance Lessons From Facebook
 
Burn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websitesBurn down the silos! Helping dev and ops gel on high availability websites
Burn down the silos! Helping dev and ops gel on high availability websites
 
Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012Puppet for Java developers - JavaZone NO 2012
Puppet for Java developers - JavaZone NO 2012
 
Drush. Secrets come out.
Drush. Secrets come out.Drush. Secrets come out.
Drush. Secrets come out.
 
ELK: a log management framework
ELK: a log management frameworkELK: a log management framework
ELK: a log management framework
 
The Zen of Lithium
The Zen of LithiumThe Zen of Lithium
The Zen of Lithium
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
 
How Kris Writes Symfony Apps
How Kris Writes Symfony AppsHow Kris Writes Symfony Apps
How Kris Writes Symfony Apps
 
Curscatalyst
CurscatalystCurscatalyst
Curscatalyst
 
Perl web frameworks
Perl web frameworksPerl web frameworks
Perl web frameworks
 
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
Nagios Conference 2014 - Rob Hassing - How To Maintain Over 20 Monitoring App...
 
Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014Understanding OpenStack Deployments - PuppetConf 2014
Understanding OpenStack Deployments - PuppetConf 2014
 
Bag Of Tricks From Iusethis
Bag Of Tricks From IusethisBag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
 

Más de OlinData

Más de OlinData (20)

AWS Cost Control: Cloud Custodian
AWS Cost Control: Cloud CustodianAWS Cost Control: Cloud Custodian
AWS Cost Control: Cloud Custodian
 
Introduction to 2FA on AWS
Introduction to 2FA on AWSIntroduction to 2FA on AWS
Introduction to 2FA on AWS
 
AWS Data Migration case study: from tapes to Glacier
AWS Data Migration case study: from tapes to GlacierAWS Data Migration case study: from tapes to Glacier
AWS Data Migration case study: from tapes to Glacier
 
Issuing temporary credentials for my sql using hashicorp vault
Issuing temporary credentials for my sql using hashicorp vaultIssuing temporary credentials for my sql using hashicorp vault
Issuing temporary credentials for my sql using hashicorp vault
 
Log monitoring with Logstash and Icinga
Log monitoring with Logstash and IcingaLog monitoring with Logstash and Icinga
Log monitoring with Logstash and Icinga
 
FOSDEM 2017: GitLab CI
FOSDEM 2017:  GitLab CIFOSDEM 2017:  GitLab CI
FOSDEM 2017: GitLab CI
 
Cfgmgmtcamp 2017 docker is the new tarball
Cfgmgmtcamp 2017  docker is the new tarballCfgmgmtcamp 2017  docker is the new tarball
Cfgmgmtcamp 2017 docker is the new tarball
 
Icinga 2 and Puppet - Automate Monitoring
Icinga 2 and Puppet - Automate MonitoringIcinga 2 and Puppet - Automate Monitoring
Icinga 2 and Puppet - Automate Monitoring
 
Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and OscarWebinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
Webinar - Auto-deploy Puppet Enterprise: Vagrant and Oscar
 
Webinar - High Availability and Distributed Monitoring with Icinga2
Webinar - High Availability and Distributed Monitoring with Icinga2Webinar - High Availability and Distributed Monitoring with Icinga2
Webinar - High Availability and Distributed Monitoring with Icinga2
 
Webinar - Windows Application Management with Puppet
Webinar - Windows Application Management with PuppetWebinar - Windows Application Management with Puppet
Webinar - Windows Application Management with Puppet
 
Webinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLabWebinar - Continuous Integration with GitLab
Webinar - Continuous Integration with GitLab
 
Webinar - Centralising syslogs with the new beats, logstash and elasticsearch
Webinar - Centralising syslogs with the new beats, logstash and elasticsearchWebinar - Centralising syslogs with the new beats, logstash and elasticsearch
Webinar - Centralising syslogs with the new beats, logstash and elasticsearch
 
Icinga 2 and puppet: automate monitoring
Icinga 2 and puppet: automate monitoringIcinga 2 and puppet: automate monitoring
Icinga 2 and puppet: automate monitoring
 
Webinar - Project Management for DevOps
Webinar - Project Management for DevOpsWebinar - Project Management for DevOps
Webinar - Project Management for DevOps
 
Using puppet in a traditional enterprise
Using puppet in a traditional enterpriseUsing puppet in a traditional enterprise
Using puppet in a traditional enterprise
 
Webinar - PuppetDB
Webinar - PuppetDBWebinar - PuppetDB
Webinar - PuppetDB
 
Webinar - Scaling your Puppet infrastructure
Webinar - Scaling your Puppet infrastructureWebinar - Scaling your Puppet infrastructure
Webinar - Scaling your Puppet infrastructure
 
Webinar - Managing your Docker containers and AWS cloud with Puppet
Webinar - Managing your Docker containers and AWS cloud with PuppetWebinar - Managing your Docker containers and AWS cloud with Puppet
Webinar - Managing your Docker containers and AWS cloud with Puppet
 
Webinar - Manage user, groups, packages in windows using puppet
Webinar - Manage user, groups, packages in windows using puppetWebinar - Manage user, groups, packages in windows using puppet
Webinar - Manage user, groups, packages in windows using puppet
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

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

  • 1. Nagios in <10 mins with Puppet December 3rd, 2012 PuppetCamp SEA #2, Singapore Goh Choon Ming, OlinData
  • 2.
  • 3.
  • 5. Puppet made it simpler to setup
  • 7. @@nagios_host { $::fqdn: ensure => present, address => $::fqdn, use => "generic-host", tag => $domain, }
  • 8. @@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, }
  • 9. 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'", }
  • 10. 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', }
  • 11. And many many others http://docs.puppetlabs.com/references/stable/type. html
  • 12. Yet there is another problem? What is it and how do we fix it?
  • 16. @@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' ], }
  • 17. How to create a multi-environment Nagios setup?
  • 19. 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' ], }
  • 20. Taking another step further with Nagios
  • 21. Executing plugins on remote machines with NRPE
  • 23. 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"], } }
  • 24. @@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" }
  • 25. Taking another step further with Nagios and Puppet's resources resource type
  • 26. resources { 'nagios_host': purge => true, } resources { 'nagios_service': purge => true, }
  • 27. DEMO
  • 29. 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