SlideShare a Scribd company logo
1 of 23
Download to read offline
http://bit.ly/olindata-galera-migration
Puppet Master
Puppet Code
(.git repository)
web01.olindata.com icinga.olindata.comdb01.olindata.com
Puppet Agent Puppet AgentPuppet Agent
●
●
○
○
●
○ mod 'icingaweb2',
■ :git => 'https://github.com/icinga/puppet-icingaweb2.git'
○ mod 'icinga2',
■ :git => 'https://github.com/icinga/puppet-icinga2.git',
■ :branch => 'develop'
○ mod 'puppetlabs/mysql', '3.6.2'
class opstheater::profile::icinga::db {
$icinga2_webdb_password = ‘mypw’
$icinga2_ido_password = ‘mypw’
$mysql_whitelist_range = ‘192.168.%’
mysql::db { 'icinga2_web':
user => 'icinga2_web',
password => $icinga2_webdb_password,
host => $mysql_whitelist_range,
grant => ['ALL'],
}
mysql::db { 'icinga2_data':
user => 'icinga2',
password => $icinga2_ido_password,
host => $mysql_whitelist_range,
grant => ['ALL'],
}
}
$icinga2_db_ipaddress = hiera('opstheater::icinga::mysql_ipaddress')
$icinga2_web_fqdn = hiera('opstheater::icingaweb::fqdn')
$icinga2_ido_password = hiera('opstheater::icinga::ido_password')
class { 'icinga2':
db_type => 'mysql',
db_host => $icinga2_db_ipaddress,
db_port => '3306',
db_name => 'icinga2_data',
db_user => 'icinga2',
db_pass => $icinga2_ido_password,
manage_database => true,
}
●
●
●
class opstheater::profile::icinga::web {
class { 'icingaweb2':
manage_repo => true,
install_method => 'package',
manage_apache_vhost => true,
apache_vhost_name => $icinga2_web_fqdn,
ido_db => 'mysql',
ido_db_host => $icinga2_db_ip,
ido_db_name => 'icinga2_data',
ido_db_user => 'icinga2',
ido_db_pass => $icinga2_ido_pass,
web_db => 'mysql',
web_db_name => 'icinga2_web',
web_db_host => $icinga2_db_ip,
web_db_user => 'icinga2_web',
web_db_pass => $icinga2_webdb_pass,
web_db_port => '3306',
}
class opstheater::profile::icinga::client {
include ::icinga2
include ::icinga2::feature::command
class { '::icinga2::feature::api':
accept_commands => true,
accept_config => true,
manage_zone => false,
}
# icinga2::pki::puppet class needs to be
declared
# after the icinga2::feature::api class in order
# to avoid resource duplication
contain ::icinga2::pki::puppet
}
$icinga2_web_fqdn = hiera('opstheater::
icingaweb::fqdn')
@@icinga2::object::zone { $::fqdn:
endpoints => {
$::fqdn => {
host => $::fqdn },
},
parent => 'master',
}
icinga2::object::zone { 'master':
endpoints => {
$icinga2_web_fqdn => {
host => $icinga2_web_fqdn },
},
}
Icinga2::Object::Zone <<| |>>
PuppetDB
Puppet
Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn:
ipv4_address => $::ipaddress,
}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
PuppetDB
Puppet
Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn:
ipv4_address => $::ipaddress,
}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
PuppetDB
Puppet
Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn:
ipv4_address => $::ipaddress,
}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
PuppetDB
Puppet
Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn:
ipv4_address => $::ipaddress,
}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
PuppetDB
Puppet
Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn:
ipv4_address => $::ipaddress,
}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
PuppetDB
Puppet
Master
ICINGAWEB01
@@icinga2::object::host { $::fqdn:
ipv4_address => $::ipaddress,
}
Icinga2::Object::Host <<| |>>
1. Puppet agent run
6. Send to node
5. Retrieve from PuppetDB3. Store in PuppetDB
2. Export to PM
4. Collect on ICINGA
node ‘icinga.olindata.com’ {
Icinga2::Object::Host <<| |>>
Icinga2::Object::Service <<| |>>
Icinga2::Object::Zone <<| |>>
@@icinga2::object::zone { $::fqdn:
endpoints => {
$::fqdn => { host => $::fqdn },
},
parent => 'master',
}
icinga2::object::zone { 'master':
endpoints => {
$icinga2_fqdn => {
host => $icinga2_ip,
},
},
}
}
node ‘web01.olindata.com’ {
@@icinga2::object::zone { $::fqdn:
endpoints => {
$::fqdn => { host => $::fqdn },
},
parent => 'master',
}
icinga2::object::zone { 'master':
endpoints => {
$icinga2_fqdn => {
host => $icinga2_ip,
},
},
}
Icinga2::Object::Zone <<| |>>
@@icinga2::object::host { $::fqdn:
ipv4_address => $::ipaddress,
}
}
Icinga2::Object::Apply_service {
assign_where => 'host.address && host.vars.remote == true && host.vars.remote_endpoint',
command_endpoint => 'host.vars.remote_endpoint',
}
icinga2::object::apply_service { 'user':
check_command => 'users',
}
icinga2::object::apply_service { 'load':
check_command => 'load',
}
icinga2::object::apply_service { 'process':
check_command => 'procs',
}
●
●
●
●
●
●
Icinga 2 and puppet: automate monitoring
Icinga 2 and puppet: automate monitoring

More Related Content

What's hot

Real-time search in Drupal. Meet Elasticsearch
Real-time search in Drupal. Meet ElasticsearchReal-time search in Drupal. Meet Elasticsearch
Real-time search in Drupal. Meet Elasticsearch
Alexei Gorobets
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStack
ke4qqq
 
Real-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampReal-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @Moldcamp
Alexei Gorobets
 

What's hot (20)

Webscraping with asyncio
Webscraping with asyncioWebscraping with asyncio
Webscraping with asyncio
 
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
第3回Grails/Groovy勉強会名古屋「Grails名古屋座談会」
 
JavaScript in 2015
JavaScript in 2015JavaScript in 2015
JavaScript in 2015
 
Securing Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp VaultSecuring Prometheus exporters using HashiCorp Vault
Securing Prometheus exporters using HashiCorp Vault
 
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
第4回 g* ワークショップ はじめてみよう! Grailsプラグイン
 
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
 
Big Master Data PHP BLT #1
Big Master Data PHP BLT #1Big Master Data PHP BLT #1
Big Master Data PHP BLT #1
 
Deploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard WayDeploying Plone and Volto, the Hard Way
Deploying Plone and Volto, the Hard Way
 
The State of JavaScript (2015)
The State of JavaScript (2015)The State of JavaScript (2015)
The State of JavaScript (2015)
 
About Data::ObjectDriver
About Data::ObjectDriverAbout Data::ObjectDriver
About Data::ObjectDriver
 
Workshop Infrastructure as Code - Suestra
Workshop Infrastructure as Code - SuestraWorkshop Infrastructure as Code - Suestra
Workshop Infrastructure as Code - Suestra
 
Analyse Yourself
Analyse YourselfAnalyse Yourself
Analyse Yourself
 
How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server How to build a High Performance PSGI/Plack Server
How to build a High Performance PSGI/Plack Server
 
Hopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to anotherHopping in clouds: a tale of migration from one cloud provider to another
Hopping in clouds: a tale of migration from one cloud provider to another
 
Real-time search in Drupal. Meet Elasticsearch
Real-time search in Drupal. Meet ElasticsearchReal-time search in Drupal. Meet Elasticsearch
Real-time search in Drupal. Meet Elasticsearch
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStack
 
Devoxx france 2015 influx db
Devoxx france 2015 influx dbDevoxx france 2015 influx db
Devoxx france 2015 influx db
 
Icinga2 Hacking Session 2014-10-10
Icinga2 Hacking Session 2014-10-10Icinga2 Hacking Session 2014-10-10
Icinga2 Hacking Session 2014-10-10
 
Real-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampReal-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @Moldcamp
 
Ubic
UbicUbic
Ubic
 

Similar to Icinga 2 and puppet: automate monitoring

Integrate gitolite with mantis
Integrate gitolite with mantisIntegrate gitolite with mantis
Integrate gitolite with mantis
Johnson Chou
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
ronnywang_tw
 

Similar to Icinga 2 and puppet: automate monitoring (20)

Icinga Camp Amsterdam - Icinga2 and Puppet
Icinga Camp Amsterdam - Icinga2 and PuppetIcinga Camp Amsterdam - Icinga2 and Puppet
Icinga Camp Amsterdam - Icinga2 and Puppet
 
OSMC 2015:The road to lazy monitoring with Icinga 2 and Puppet by Tom de Vylder
OSMC 2015:The road to lazy monitoring with Icinga 2 and Puppet by Tom de VylderOSMC 2015:The road to lazy monitoring with Icinga 2 and Puppet by Tom de Vylder
OSMC 2015:The road to lazy monitoring with Icinga 2 and Puppet by Tom de Vylder
 
OSMC 2015 | The Road to Lazy Monitoring with Icinga 2 & Puppet by Tom De Vylder
OSMC 2015 | The Road to Lazy Monitoring with Icinga 2 & Puppet by Tom De VylderOSMC 2015 | The Road to Lazy Monitoring with Icinga 2 & Puppet by Tom De Vylder
OSMC 2015 | The Road to Lazy Monitoring with Icinga 2 & Puppet by Tom De Vylder
 
Puppet at GitHub
Puppet at GitHubPuppet at GitHub
Puppet at GitHub
 
Malcon2017
Malcon2017Malcon2017
Malcon2017
 
PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22PFIセミナー資料 H27.10.22
PFIセミナー資料 H27.10.22
 
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
 
Modern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in PerlModern Getopt for Command Line Processing in Perl
Modern Getopt for Command Line Processing in Perl
 
Sinatra for REST services
Sinatra for REST servicesSinatra for REST services
Sinatra for REST services
 
Integrate gitolite with mantis
Integrate gitolite with mantisIntegrate gitolite with mantis
Integrate gitolite with mantis
 
Automating complex infrastructures with Puppet
Automating complex infrastructures with PuppetAutomating complex infrastructures with Puppet
Automating complex infrastructures with Puppet
 
Ender
EnderEnder
Ender
 
What is systemd? Why use it? how does it work? - breizhcamp
What is systemd? Why use it? how does it work? - breizhcampWhat is systemd? Why use it? how does it work? - breizhcamp
What is systemd? Why use it? how does it work? - breizhcamp
 
Automating Complex Setups with Puppet
Automating Complex Setups with PuppetAutomating Complex Setups with Puppet
Automating Complex Setups with Puppet
 
ROS2勉強会@別府 第7章Pythonクライアントライブラリrclpy
ROS2勉強会@別府 第7章PythonクライアントライブラリrclpyROS2勉強会@別府 第7章Pythonクライアントライブラリrclpy
ROS2勉強会@別府 第7章Pythonクライアントライブラリrclpy
 
classes & objects in cpp overview
classes & objects in cpp overviewclasses & objects in cpp overview
classes & objects in cpp overview
 
2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
 
What is systemd? Why use it? how does it work? - devoxx france 2017
What is systemd? Why use it? how does it work? - devoxx france 2017What is systemd? Why use it? how does it work? - devoxx france 2017
What is systemd? Why use it? how does it work? - devoxx france 2017
 
How I hack on puppet modules
How I hack on puppet modulesHow I hack on puppet modules
How I hack on puppet modules
 
Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM  Relational Database Access with Python ‘sans’ ORM
Relational Database Access with Python ‘sans’ ORM
 

More from OlinData

More from 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
 
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
 
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
 
1 m+ qps on mysql galera cluster
1 m+ qps on mysql galera cluster1 m+ qps on mysql galera cluster
1 m+ qps on mysql galera cluster
 
Workshop puppet (dev opsdays ams 2015)
Workshop puppet (dev opsdays ams 2015)Workshop puppet (dev opsdays ams 2015)
Workshop puppet (dev opsdays ams 2015)
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
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...
 
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
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Icinga 2 and puppet: automate monitoring

  • 1.
  • 3.
  • 4.
  • 5. Puppet Master Puppet Code (.git repository) web01.olindata.com icinga.olindata.comdb01.olindata.com Puppet Agent Puppet AgentPuppet Agent
  • 7. ● ○ mod 'icingaweb2', ■ :git => 'https://github.com/icinga/puppet-icingaweb2.git' ○ mod 'icinga2', ■ :git => 'https://github.com/icinga/puppet-icinga2.git', ■ :branch => 'develop' ○ mod 'puppetlabs/mysql', '3.6.2'
  • 8. class opstheater::profile::icinga::db { $icinga2_webdb_password = ‘mypw’ $icinga2_ido_password = ‘mypw’ $mysql_whitelist_range = ‘192.168.%’ mysql::db { 'icinga2_web': user => 'icinga2_web', password => $icinga2_webdb_password, host => $mysql_whitelist_range, grant => ['ALL'], } mysql::db { 'icinga2_data': user => 'icinga2', password => $icinga2_ido_password, host => $mysql_whitelist_range, grant => ['ALL'], } }
  • 9. $icinga2_db_ipaddress = hiera('opstheater::icinga::mysql_ipaddress') $icinga2_web_fqdn = hiera('opstheater::icingaweb::fqdn') $icinga2_ido_password = hiera('opstheater::icinga::ido_password') class { 'icinga2': db_type => 'mysql', db_host => $icinga2_db_ipaddress, db_port => '3306', db_name => 'icinga2_data', db_user => 'icinga2', db_pass => $icinga2_ido_password, manage_database => true, }
  • 10. ● ● ● class opstheater::profile::icinga::web { class { 'icingaweb2': manage_repo => true, install_method => 'package', manage_apache_vhost => true, apache_vhost_name => $icinga2_web_fqdn, ido_db => 'mysql', ido_db_host => $icinga2_db_ip, ido_db_name => 'icinga2_data', ido_db_user => 'icinga2', ido_db_pass => $icinga2_ido_pass, web_db => 'mysql', web_db_name => 'icinga2_web', web_db_host => $icinga2_db_ip, web_db_user => 'icinga2_web', web_db_pass => $icinga2_webdb_pass, web_db_port => '3306', }
  • 11. class opstheater::profile::icinga::client { include ::icinga2 include ::icinga2::feature::command class { '::icinga2::feature::api': accept_commands => true, accept_config => true, manage_zone => false, } # icinga2::pki::puppet class needs to be declared # after the icinga2::feature::api class in order # to avoid resource duplication contain ::icinga2::pki::puppet } $icinga2_web_fqdn = hiera('opstheater:: icingaweb::fqdn') @@icinga2::object::zone { $::fqdn: endpoints => { $::fqdn => { host => $::fqdn }, }, parent => 'master', } icinga2::object::zone { 'master': endpoints => { $icinga2_web_fqdn => { host => $icinga2_web_fqdn }, }, } Icinga2::Object::Zone <<| |>>
  • 12. PuppetDB Puppet Master ICINGAWEB01 @@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress, } Icinga2::Object::Host <<| |>> 1. Puppet agent run 6. Send to node 5. Retrieve from PuppetDB3. Store in PuppetDB 2. Export to PM 4. Collect on ICINGA
  • 13. PuppetDB Puppet Master ICINGAWEB01 @@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress, } Icinga2::Object::Host <<| |>> 1. Puppet agent run 6. Send to node 5. Retrieve from PuppetDB3. Store in PuppetDB 2. Export to PM 4. Collect on ICINGA
  • 14. PuppetDB Puppet Master ICINGAWEB01 @@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress, } Icinga2::Object::Host <<| |>> 1. Puppet agent run 6. Send to node 5. Retrieve from PuppetDB3. Store in PuppetDB 2. Export to PM 4. Collect on ICINGA
  • 15. PuppetDB Puppet Master ICINGAWEB01 @@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress, } Icinga2::Object::Host <<| |>> 1. Puppet agent run 6. Send to node 5. Retrieve from PuppetDB3. Store in PuppetDB 2. Export to PM 4. Collect on ICINGA
  • 16. PuppetDB Puppet Master ICINGAWEB01 @@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress, } Icinga2::Object::Host <<| |>> 1. Puppet agent run 6. Send to node 5. Retrieve from PuppetDB3. Store in PuppetDB 2. Export to PM 4. Collect on ICINGA
  • 17. PuppetDB Puppet Master ICINGAWEB01 @@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress, } Icinga2::Object::Host <<| |>> 1. Puppet agent run 6. Send to node 5. Retrieve from PuppetDB3. Store in PuppetDB 2. Export to PM 4. Collect on ICINGA
  • 18. node ‘icinga.olindata.com’ { Icinga2::Object::Host <<| |>> Icinga2::Object::Service <<| |>> Icinga2::Object::Zone <<| |>> @@icinga2::object::zone { $::fqdn: endpoints => { $::fqdn => { host => $::fqdn }, }, parent => 'master', } icinga2::object::zone { 'master': endpoints => { $icinga2_fqdn => { host => $icinga2_ip, }, }, } } node ‘web01.olindata.com’ { @@icinga2::object::zone { $::fqdn: endpoints => { $::fqdn => { host => $::fqdn }, }, parent => 'master', } icinga2::object::zone { 'master': endpoints => { $icinga2_fqdn => { host => $icinga2_ip, }, }, } Icinga2::Object::Zone <<| |>> @@icinga2::object::host { $::fqdn: ipv4_address => $::ipaddress, } }
  • 19. Icinga2::Object::Apply_service { assign_where => 'host.address && host.vars.remote == true && host.vars.remote_endpoint', command_endpoint => 'host.vars.remote_endpoint', } icinga2::object::apply_service { 'user': check_command => 'users', } icinga2::object::apply_service { 'load': check_command => 'load', } icinga2::object::apply_service { 'process': check_command => 'procs', }