SlideShare a Scribd company logo
1 of 20
Download to read offline
WWW.ICINGA.ORGWWW.ICINGA.ORG
Icinga 2
Hacking Session
Icinga 2
Hacking Session
Icinga 2 Workshop
2014-10-10
Icinga 2 Workshop
2014-10-10
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
• Icinga Cluster VMs
• A look on the config
• Configuration & Practice
• Cluster reconfiguration
• Questions & Answers
AgendaAgenda
Icinga 2 Workshop
Cluster VMsCluster VMs
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
Cluster VMsCluster VMs
Icinga 2 Workshop
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
Cluster VMsCluster VMs
Icinga 2 Workshop
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
Cluster VMsCluster VMs
Icinga 2 Workshop
Icinga2a:
OpenSSH: ssh root@localhost -p 2085
PuTTy: root@localhost:2085
Icinga2b:
OpenSSH: ssh root@localhost -p 2086
PuTTy: root@localhost:2086
SSH Login:
root / vagrant
vagrant / vagrant
Web:
http://localhost:8085
User: icingaadmin
Password: icinga
See the docs for instructions for the VM source definitions
http://docs.icinga.org/icinga2 → Vagrant
ConfigurationConfiguration
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
Important PathsImportant Paths
Icinga 2 Workshop
/etc/icinga2 Main configuration
/usr/sbin/icinga2 Daemon
/usr/(s)bin/icinga2-* CLI tools
/usr/share/icinga2 ITL and plugin Commands
/var/run/icinga PID file and command pipe
/var/cache/icinga2 status.dat / objects.cache
/var/lib/icinga2 state file, cluster data
/var/spool/icinga2 performance data
/var/log/icinga2 logfiles
service icinga2 start|stop|restart|reload
service icinga2 checkconfig
icinga2-list-objects --color | less -R
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
Icinga 2 Workshop
DemoDemo
DEMO
Configuration & practiceConfiguration & practice
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
Host / Hostgroup / ServiceHost / Hostgroup / Service
Icinga 2 Workshop
object HostGroup "mysql-server" {
display_name = "MySQL Server"
assign where match("*mysql*", host.name)
assign where match("db-*", host.vars.prod_mysql_db)
ignore where host.vars.test_server == true
ignore where match("*internal", host.name)
}
object Host "mysql-db1" {
import "db-server"
import "mysql-server"
address = "192.168.70.10"
}
object Host "customer-db7" {
import "db-server"
import "mysql-server"
address = "192.168.71.30"
vars.prod_mysql_db = "db-customer-xy"
}
apply Service "mysql-health" {
import "mysql-service"
check_command = "mysql"
assign where "mysql-server" in host.groups
ignore where host.vars.no_health_check == true
}
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
Custom check commandsCustom check commands
Icinga 2 Workshop
object CheckCommand "training-mysql" {
import "training-mysql-common"
command = [ PluginDir + "/check_mysql" ]
arguments = {
"-H" = "$mysql_host$"
"-u" = "$mysql_user$"
"-p" = "$mysql_password$"
"-P" = "$mysql_port$"
"-s" = "$mysql_socket$"
"-a" = "$mysql_cert$"
"-k" = "$mysql_key$"
"-f" = "$mysql_optfile$"
"-g" = "$mysql_group$"
"-S" = {
set_if = "$mysql_check_slave$"
description = "Check if the slave thread is running properly."
}
"-l" = {
set_if = "$mysql_ssl$"
description = "Use ssl encryption"
}
}
vars.mysql_check_slave = false
vars.mysql_ssl = false
}
template CheckCommand "training-mysql-common" {
import "plugin-check-command"
vars.mysql_host = "$address$"
}
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
Custom check commandsCustom check commands
Icinga 2 Workshop
template Host "mysql-server" {
check_interval = 3m
vars.mysql_port = 3306
}
object Host "training-mysql-db1" {
import "mysql-server"
address = "127.0.0.1"
}
object Host "training-mysql-db2" {
import "mysql-server"
address = "127.0.0.1"
}
apply Service "mysql-connection" {
import "mysql-service"
check_command = "training-mysql"
vars.mysql_database = "mysql"
assign where "mysql-server" in host.groups
}
object HostGroup "mysql-server" {
display_name = "MySQL Server"
assign where match("*mysql*", host.name)
assign where match("db-*",
host.vars.prod_mysql_db)
ignore where host.vars.test_server == true
ignore where match("*internal", host.name)
}
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
PracticePractice
• Erstellen Sie die Hosts:
workshop-1 (192.168.33.10) und
workshop-2 (192.168.33.20)
mit der var customer = “icinga“
• Erstellen Sie eine Hostgroup „icinga“ die alle Hosts enthält, bei
denen customer auf „icinga“ gesetzt ist
assign where host.vars.customer == "icinga"
• Weisen Sie einen http Service (apply) für beide Hosts zu,
der die URI “/icingaweb” prüft
→ /usr/share/icinga2/include/command-plugins.conf
→ http_uri
→ assign where match("workshop*", host.name)
• Erstellen Sie eine ServiceGroup „icinga-http“ und setzen Sie
die eben erstellen Services in diese Gruppe
Icinga 2 Workshop
/etc/icinga2/zones.d/checker/workshop.conf
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
Practice solutionPractice solution
Icinga 2 Workshop
object Host "workshop-1" {
import "generic-host"
address = "192.168.33.10"
vars.customer = "icinga"
}
object Host "workshop-2" {
import "generic-host"
address = "192.168.33.20"
vars.customer = "icinga"
}
object HostGroup "icinga" {
assign where host.vars.customer == "icinga"
}
apply Service "http" {
check_command = "http"
vars.http_uri = "/icingaweb"
groups += [ "icinga-http" ]
assign where match("workshop*", host.name)
}
object ServiceGroup "icinga-http" {
}
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
NotificationNotification
Icinga 2 Workshop
template Notification "notify-mysql-users" {
command = "mail-service-notification"
states = [ OK, Warning, Critical, Unknown ]
types = [ Problem, Acknowledgement, Recovery, Custom,
FlappingStart, FlappingEnd,
DowntimeStart, DowntimeEnd, DowntimeRemoved ]
period = "24x7"
user_groups = [ "icingaadmins" ]
}
apply Notification "mysql-status" to Service {
import "notify-mysql-users"
assign where match("*mysql*", service.check_command)
ignore where services.vars.disable_mysql_notifications == true
}
apply Notification "notify-cust-icinga-mysql" to Service {
import "cust-icinga-notification"
assign where match("*mysql*", service.check_command) &&
host.vars.customer == "icinga"
ignore where match("*internal", host.name)
ignore where service.vars.sla != "24x7"
}
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
DependencyDependency
Icinga 2 Workshop
apply Service "nrpe-health" {
import "generic-service"
check_command = "nrpe"
assign where host.vars.agent == "nrpe"
}
apply Service "nrpe-load" {
import "generic-service"
check_command = "nrpe"
vars.nrpe_command = "check_load"
assign where host.vars.agent == "nrpe"
}
apply Service "nrpe-disk" {
import "generic-service"
check_command = "nrpe"
vars.nrpe_command = "check_disk"
assign where
host.vars.agent == "nrpe"
}
object Host "nrpe-server" {
import "generic-host"
address = "192.168.1.5"
vars.agent = "nrpe"
}
apply Dependency "disable-nrpe-checks" to Service
parent_service_name = "nrpe-health"
states = [ OK ]
disable_checks = true
disable_notifications = true
assign where service.check_command == "nrpe" &&
host.vars.agent == "nrpe"
ignore where service.name == "nrpe-health"
}
Reconfigure ClusterReconfigure Cluster
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
Reconfigure to Master-MasterReconfigure to Master-Master
• Wir lösen die Zone checker auf und nehmen icinga2b in die
Master Zone auf
• Icinga 2 auf beiden Seiten stoppen
• Gecachte Cluster Daten löschen (beide Seiten)
rm -rf /var/lib/icinga2/api/zones/*
• zones.conf auf beiden Servern editieren
• Inhalt von /etc/icinga2/zones.d/checker/ nach ../master/
verschieben
• IDO HA Funktion deaktivieren
• Icinga 2 wieder starten
Icinga 2 Workshop
# vim /etc/icinga2/features-enabled/ido-mysql.conf
object IdoMysqlConnection "ido-mysql" {
enable_ha = false
}
object Zone "master" {
endpoints = [ "icinga2a", "icinga2b" ]
}
DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG
QUESTIONS & ANSWERSQUESTIONS & ANSWERS
Icinga 2 Workshop
Web + Blog www.icinga.org
Docs docs.icinga.org
Development dev.icinga.org
Sourcecode git.icinga.org
Releases github.com/Icinga
Wiki wiki.icinga.org
IRC #icinga on FreeNode
Mailing lists lists.icinga.org
Support support.icinga.org
Twitter twitter.com/icinga
Facebook facebook.com/icinga
…….. Everywhere!
?
Questions & Answers

More Related Content

What's hot

What's hot (20)

OSMC 2014: Current state of Icinga | Icinga Team
OSMC 2014: Current state of Icinga | Icinga TeamOSMC 2014: Current state of Icinga | Icinga Team
OSMC 2014: Current state of Icinga | Icinga Team
 
Icinga2
Icinga2Icinga2
Icinga2
 
Rundeck: The missing tool
Rundeck: The missing toolRundeck: The missing tool
Rundeck: The missing tool
 
Icinga 2 and Puppet - Automate Monitoring
Icinga 2 and Puppet - Automate MonitoringIcinga 2 and Puppet - Automate Monitoring
Icinga 2 and Puppet - Automate Monitoring
 
Andrew Nelson - Zabbix and SNMP on Linux
Andrew Nelson - Zabbix and SNMP on LinuxAndrew Nelson - Zabbix and SNMP on Linux
Andrew Nelson - Zabbix and SNMP on Linux
 
Make your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalableMake your Ansible playbooks maintainable, flexible, and scalable
Make your Ansible playbooks maintainable, flexible, and scalable
 
Jesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture OverviewJesse Olson - Nagios Log Server Architecture Overview
Jesse Olson - Nagios Log Server Architecture Overview
 
RunDeck
RunDeckRunDeck
RunDeck
 
HTTPS and Ansible
HTTPS and AnsibleHTTPS and Ansible
HTTPS and Ansible
 
Automating Monitoring with Puppet
Automating Monitoring with PuppetAutomating Monitoring with Puppet
Automating Monitoring with Puppet
 
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud InfrastructureSCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
SCALE12X Build a Cloud Day: Chef: The Swiss Army Knife of Cloud Infrastructure
 
Puppetconf 2015 - Puppet Reporting with Elasticsearch Logstash and Kibana
Puppetconf 2015 - Puppet Reporting with Elasticsearch Logstash and KibanaPuppetconf 2015 - Puppet Reporting with Elasticsearch Logstash and Kibana
Puppetconf 2015 - Puppet Reporting with Elasticsearch Logstash and Kibana
 
Testing with Ansible
Testing with AnsibleTesting with Ansible
Testing with Ansible
 
Red Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with PuppetRed Hat Satellite 6 - Automation with Puppet
Red Hat Satellite 6 - Automation with Puppet
 
Ansible at work
Ansible at workAnsible at work
Ansible at work
 
How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2How to deploy spark instance using ansible 2.0 in fiware lab v2
How to deploy spark instance using ansible 2.0 in fiware lab v2
 
Securing Hadoop @eBay
Securing Hadoop @eBaySecuring Hadoop @eBay
Securing Hadoop @eBay
 
OpenStack Austin Meetup January 2014: Chef + OpenStack
OpenStack Austin Meetup January 2014: Chef + OpenStackOpenStack Austin Meetup January 2014: Chef + OpenStack
OpenStack Austin Meetup January 2014: Chef + OpenStack
 
Stop using Nagios (so it can die peacefully)
Stop using Nagios (so it can die peacefully)Stop using Nagios (so it can die peacefully)
Stop using Nagios (so it can die peacefully)
 
From pets to cattle - powered by CoreOS, docker, Mesos & nginx
From pets to cattle - powered by CoreOS, docker, Mesos & nginxFrom pets to cattle - powered by CoreOS, docker, Mesos & nginx
From pets to cattle - powered by CoreOS, docker, Mesos & nginx
 

Viewers also liked

Cebit 2015 icinga
Cebit 2015 icingaCebit 2015 icinga
Cebit 2015 icinga
Icinga
 

Viewers also liked (20)

Monitoring with Icinga2 at Adobe
Monitoring with Icinga2 at AdobeMonitoring with Icinga2 at Adobe
Monitoring with Icinga2 at Adobe
 
Performance Monitoring with Icinga2, Graphite und Grafana
Performance Monitoring with Icinga2, Graphite und GrafanaPerformance Monitoring with Icinga2, Graphite und Grafana
Performance Monitoring with Icinga2, Graphite und Grafana
 
Icinga Camp Antwerp - Icinga2 Cluster
Icinga Camp Antwerp - Icinga2 ClusterIcinga Camp Antwerp - Icinga2 Cluster
Icinga Camp Antwerp - Icinga2 Cluster
 
Cebit 2015 icinga
Cebit 2015 icingaCebit 2015 icinga
Cebit 2015 icinga
 
Icinga Camp San Diego: Apify them all
Icinga Camp San Diego: Apify them allIcinga Camp San Diego: Apify them all
Icinga Camp San Diego: Apify them all
 
Presentation about Icinga at Kiratech DevOps Day in Verona
Presentation about Icinga at Kiratech DevOps Day in VeronaPresentation about Icinga at Kiratech DevOps Day in Verona
Presentation about Icinga at Kiratech DevOps Day in Verona
 
Icinga Camp San Diego 2016 - Icinga Director
Icinga Camp San Diego 2016 - Icinga DirectorIcinga Camp San Diego 2016 - Icinga Director
Icinga Camp San Diego 2016 - Icinga Director
 
Icinga Camp Amsterdam - How to monitor Windows
Icinga Camp Amsterdam - How to monitor WindowsIcinga Camp Amsterdam - How to monitor Windows
Icinga Camp Amsterdam - How to monitor Windows
 
IcingaCamp Stockholm - NSClient++
IcingaCamp Stockholm - NSClient++IcingaCamp Stockholm - NSClient++
IcingaCamp Stockholm - NSClient++
 
Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016
Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016
Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016
 
IcingaCamp Stockholm - How to make your monitoring shut up
IcingaCamp Stockholm - How to make your monitoring shut upIcingaCamp Stockholm - How to make your monitoring shut up
IcingaCamp Stockholm - How to make your monitoring shut up
 
Icinga Camp Amsterdam - Infrastructure as Code
Icinga Camp Amsterdam - Infrastructure as CodeIcinga Camp Amsterdam - Infrastructure as Code
Icinga Camp Amsterdam - Infrastructure as Code
 
Icinga Camp Belgrade - ITAF Introduction
Icinga Camp Belgrade - ITAF IntroductionIcinga Camp Belgrade - ITAF Introduction
Icinga Camp Belgrade - ITAF Introduction
 
Icinga Camp Amsterdam - Monitoring – When to start
Icinga Camp Amsterdam - Monitoring – When to startIcinga Camp Amsterdam - Monitoring – When to start
Icinga Camp Amsterdam - Monitoring – When to start
 
Icinga Camp Amsterdam - Icinga, Graphite, Grafana
Icinga Camp Amsterdam - Icinga, Graphite, GrafanaIcinga Camp Amsterdam - Icinga, Graphite, Grafana
Icinga Camp Amsterdam - Icinga, Graphite, Grafana
 
Icinga Camp Amsterdam - Icinga Director
Icinga Camp Amsterdam - Icinga DirectorIcinga Camp Amsterdam - Icinga Director
Icinga Camp Amsterdam - Icinga Director
 
IcingaCamp Stockholm - Icinga Web2
IcingaCamp Stockholm - Icinga Web2IcingaCamp Stockholm - Icinga Web2
IcingaCamp Stockholm - Icinga Web2
 
Icinga Camp Amsterdam - Icinga2 and Ansible
Icinga Camp Amsterdam - Icinga2 and AnsibleIcinga Camp Amsterdam - Icinga2 and Ansible
Icinga Camp Amsterdam - Icinga2 and Ansible
 
Icinga Camp San Diego 2016 - Icinga Web 2
Icinga Camp San Diego 2016 - Icinga Web 2Icinga Camp San Diego 2016 - Icinga Web 2
Icinga Camp San Diego 2016 - Icinga Web 2
 
Icinga Camp San Diego 2016 - Opening
Icinga Camp San Diego 2016 - OpeningIcinga Camp San Diego 2016 - Opening
Icinga Camp San Diego 2016 - Opening
 

Similar to Icinga2 Hacking Session 2014-10-10

Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
ke4qqq
 
Spark summit2014 techtalk - testing spark
Spark summit2014 techtalk - testing sparkSpark summit2014 techtalk - testing spark
Spark summit2014 techtalk - testing spark
Anu Shetty
 

Similar to Icinga2 Hacking Session 2014-10-10 (20)

Icinga Workshop 2014 Icinga 2 Hacking Session
Icinga Workshop 2014 Icinga 2 Hacking SessionIcinga Workshop 2014 Icinga 2 Hacking Session
Icinga Workshop 2014 Icinga 2 Hacking Session
 
Icinga 2 at Icinga Camp San Francisco
Icinga 2 at Icinga Camp San FranciscoIcinga 2 at Icinga Camp San Francisco
Icinga 2 at Icinga Camp San Francisco
 
Why favour Icinga over Nagios - Rootconf 2015
Why favour Icinga over Nagios - Rootconf 2015Why favour Icinga over Nagios - Rootconf 2015
Why favour Icinga over Nagios - Rootconf 2015
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suite
 
Monitoring as code
Monitoring as codeMonitoring as code
Monitoring as code
 
OSDC 2015: Bernd Erk | Why favour Icinga over Nagios
OSDC 2015: Bernd Erk | Why favour Icinga over NagiosOSDC 2015: Bernd Erk | Why favour Icinga over Nagios
OSDC 2015: Bernd Erk | Why favour Icinga over Nagios
 
Cutting through the fog of cloud
Cutting through the fog of cloudCutting through the fog of cloud
Cutting through the fog of cloud
 
Why favor Icinga over Nagios @ DebConf15
Why favor Icinga over Nagios @ DebConf15Why favor Icinga over Nagios @ DebConf15
Why favor Icinga over Nagios @ DebConf15
 
State of Icinga - Linux Stammtisch München
State of Icinga - Linux Stammtisch MünchenState of Icinga - Linux Stammtisch München
State of Icinga - Linux Stammtisch München
 
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
 
Antons Kranga Building Agile Infrastructures
Antons Kranga   Building Agile InfrastructuresAntons Kranga   Building Agile Infrastructures
Antons Kranga Building Agile Infrastructures
 
Journey to the Cloud
Journey to the CloudJourney to the Cloud
Journey to the Cloud
 
Deploying OpenStack with Chef
Deploying OpenStack with ChefDeploying OpenStack with Chef
Deploying OpenStack with Chef
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!NGINX Can Do That? Test Drive Your Config File!
NGINX Can Do That? Test Drive Your Config File!
 
Software Defined Datacenter
Software Defined DatacenterSoftware Defined Datacenter
Software Defined Datacenter
 
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NYPuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
 
DevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office HoursDevOps for the Enterprise: Virtual Office Hours
DevOps for the Enterprise: Virtual Office Hours
 
Spark summit2014 techtalk - testing spark
Spark summit2014 techtalk - testing sparkSpark summit2014 techtalk - testing spark
Spark summit2014 techtalk - testing spark
 

More from Icinga

More from Icinga (20)

Upgrading Incident Management with Icinga - Icinga Camp Milan 2023
Upgrading Incident Management with Icinga - Icinga Camp Milan 2023Upgrading Incident Management with Icinga - Icinga Camp Milan 2023
Upgrading Incident Management with Icinga - Icinga Camp Milan 2023
 
Extending Icinga Web with Modules: powerful, smart and easily created - Icing...
Extending Icinga Web with Modules: powerful, smart and easily created - Icing...Extending Icinga Web with Modules: powerful, smart and easily created - Icing...
Extending Icinga Web with Modules: powerful, smart and easily created - Icing...
 
Infrastructure Monitoring for Cloud Native Enterprises - Icinga Camp Milan 2023
Infrastructure Monitoring for Cloud Native Enterprises - Icinga Camp Milan 2023Infrastructure Monitoring for Cloud Native Enterprises - Icinga Camp Milan 2023
Infrastructure Monitoring for Cloud Native Enterprises - Icinga Camp Milan 2023
 
Incident management: Best industry practices your team should know - Icinga C...
Incident management: Best industry practices your team should know - Icinga C...Incident management: Best industry practices your team should know - Icinga C...
Incident management: Best industry practices your team should know - Icinga C...
 
Monitoring Cooling Units in a pharmaceutical GxP regulated environment - Icin...
Monitoring Cooling Units in a pharmaceutical GxP regulated environment - Icin...Monitoring Cooling Units in a pharmaceutical GxP regulated environment - Icin...
Monitoring Cooling Units in a pharmaceutical GxP regulated environment - Icin...
 
SNMP Monitoring at scale - Icinga Camp Milan 2023
SNMP Monitoring at scale - Icinga Camp Milan 2023SNMP Monitoring at scale - Icinga Camp Milan 2023
SNMP Monitoring at scale - Icinga Camp Milan 2023
 
Monitoring Kubernetes with Icinga - Icinga Camp Milan 2023
Monitoring Kubernetes with Icinga - Icinga Camp Milan 2023Monitoring Kubernetes with Icinga - Icinga Camp Milan 2023
Monitoring Kubernetes with Icinga - Icinga Camp Milan 2023
 
Current State of Icinga - Icinga Camp Milan 2023
Current State of Icinga - Icinga Camp Milan 2023Current State of Icinga - Icinga Camp Milan 2023
Current State of Icinga - Icinga Camp Milan 2023
 
Efficient IT operations using monitoring systems and standardized tools - Ici...
Efficient IT operations using monitoring systems and standardized tools - Ici...Efficient IT operations using monitoring systems and standardized tools - Ici...
Efficient IT operations using monitoring systems and standardized tools - Ici...
 
Tornado Complex Event Processing Framework for Icinga - Icinga Camp Zurich 2019
Tornado Complex Event Processing Framework for Icinga - Icinga Camp Zurich 2019Tornado Complex Event Processing Framework for Icinga - Icinga Camp Zurich 2019
Tornado Complex Event Processing Framework for Icinga - Icinga Camp Zurich 2019
 
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019
 
Moving from Icinga 1 to Icinga 2 + Director - Icinga Camp Zurich 2019
Moving from Icinga 1 to Icinga 2 + Director - Icinga Camp Zurich 2019Moving from Icinga 1 to Icinga 2 + Director - Icinga Camp Zurich 2019
Moving from Icinga 1 to Icinga 2 + Director - Icinga Camp Zurich 2019
 
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019
 
Current State of Icinga - Icinga Camp Zurich 2019
Current State of Icinga - Icinga Camp Zurich 2019Current State of Icinga - Icinga Camp Zurich 2019
Current State of Icinga - Icinga Camp Zurich 2019
 
NetEye 4 based on Icinga 2 - Icinga Camp Milan 2019
NetEye 4 based on Icinga 2 - Icinga Camp Milan 2019NetEye 4 based on Icinga 2 - Icinga Camp Milan 2019
NetEye 4 based on Icinga 2 - Icinga Camp Milan 2019
 
Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019
Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019
Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019
 
DevOps monitoring: Best Practices using OpenShift combined with Icinga & Big ...
DevOps monitoring: Best Practices using OpenShift combined with Icinga & Big ...DevOps monitoring: Best Practices using OpenShift combined with Icinga & Big ...
DevOps monitoring: Best Practices using OpenShift combined with Icinga & Big ...
 
Current State of Icinga - Icinga Camp Milan 2019
Current State of Icinga - Icinga Camp Milan 2019Current State of Icinga - Icinga Camp Milan 2019
Current State of Icinga - Icinga Camp Milan 2019
 
Best of Icinga Modules - Icinga Camp Milan 2019
Best of Icinga Modules - Icinga Camp Milan 2019Best of Icinga Modules - Icinga Camp Milan 2019
Best of Icinga Modules - Icinga Camp Milan 2019
 
hallenges of Monitoring Big Infrastructure - Icinga Camp Milan 2019
hallenges of Monitoring Big Infrastructure - Icinga Camp Milan 2019hallenges of Monitoring Big Infrastructure - Icinga Camp Milan 2019
hallenges of Monitoring Big Infrastructure - Icinga Camp Milan 2019
 

Recently uploaded

+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@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

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?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 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
 
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...
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
+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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.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...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Icinga2 Hacking Session 2014-10-10

  • 1. WWW.ICINGA.ORGWWW.ICINGA.ORG Icinga 2 Hacking Session Icinga 2 Hacking Session Icinga 2 Workshop 2014-10-10 Icinga 2 Workshop 2014-10-10
  • 2. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG • Icinga Cluster VMs • A look on the config • Configuration & Practice • Cluster reconfiguration • Questions & Answers AgendaAgenda Icinga 2 Workshop
  • 4. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG Cluster VMsCluster VMs Icinga 2 Workshop
  • 5. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG Cluster VMsCluster VMs Icinga 2 Workshop
  • 6. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG Cluster VMsCluster VMs Icinga 2 Workshop Icinga2a: OpenSSH: ssh root@localhost -p 2085 PuTTy: root@localhost:2085 Icinga2b: OpenSSH: ssh root@localhost -p 2086 PuTTy: root@localhost:2086 SSH Login: root / vagrant vagrant / vagrant Web: http://localhost:8085 User: icingaadmin Password: icinga See the docs for instructions for the VM source definitions http://docs.icinga.org/icinga2 → Vagrant
  • 8. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG Important PathsImportant Paths Icinga 2 Workshop /etc/icinga2 Main configuration /usr/sbin/icinga2 Daemon /usr/(s)bin/icinga2-* CLI tools /usr/share/icinga2 ITL and plugin Commands /var/run/icinga PID file and command pipe /var/cache/icinga2 status.dat / objects.cache /var/lib/icinga2 state file, cluster data /var/spool/icinga2 performance data /var/log/icinga2 logfiles service icinga2 start|stop|restart|reload service icinga2 checkconfig icinga2-list-objects --color | less -R
  • 9. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG Icinga 2 Workshop DemoDemo DEMO
  • 11. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG Host / Hostgroup / ServiceHost / Hostgroup / Service Icinga 2 Workshop object HostGroup "mysql-server" { display_name = "MySQL Server" assign where match("*mysql*", host.name) assign where match("db-*", host.vars.prod_mysql_db) ignore where host.vars.test_server == true ignore where match("*internal", host.name) } object Host "mysql-db1" { import "db-server" import "mysql-server" address = "192.168.70.10" } object Host "customer-db7" { import "db-server" import "mysql-server" address = "192.168.71.30" vars.prod_mysql_db = "db-customer-xy" } apply Service "mysql-health" { import "mysql-service" check_command = "mysql" assign where "mysql-server" in host.groups ignore where host.vars.no_health_check == true }
  • 12. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG Custom check commandsCustom check commands Icinga 2 Workshop object CheckCommand "training-mysql" { import "training-mysql-common" command = [ PluginDir + "/check_mysql" ] arguments = { "-H" = "$mysql_host$" "-u" = "$mysql_user$" "-p" = "$mysql_password$" "-P" = "$mysql_port$" "-s" = "$mysql_socket$" "-a" = "$mysql_cert$" "-k" = "$mysql_key$" "-f" = "$mysql_optfile$" "-g" = "$mysql_group$" "-S" = { set_if = "$mysql_check_slave$" description = "Check if the slave thread is running properly." } "-l" = { set_if = "$mysql_ssl$" description = "Use ssl encryption" } } vars.mysql_check_slave = false vars.mysql_ssl = false } template CheckCommand "training-mysql-common" { import "plugin-check-command" vars.mysql_host = "$address$" }
  • 13. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG Custom check commandsCustom check commands Icinga 2 Workshop template Host "mysql-server" { check_interval = 3m vars.mysql_port = 3306 } object Host "training-mysql-db1" { import "mysql-server" address = "127.0.0.1" } object Host "training-mysql-db2" { import "mysql-server" address = "127.0.0.1" } apply Service "mysql-connection" { import "mysql-service" check_command = "training-mysql" vars.mysql_database = "mysql" assign where "mysql-server" in host.groups } object HostGroup "mysql-server" { display_name = "MySQL Server" assign where match("*mysql*", host.name) assign where match("db-*", host.vars.prod_mysql_db) ignore where host.vars.test_server == true ignore where match("*internal", host.name) }
  • 14. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG PracticePractice • Erstellen Sie die Hosts: workshop-1 (192.168.33.10) und workshop-2 (192.168.33.20) mit der var customer = “icinga“ • Erstellen Sie eine Hostgroup „icinga“ die alle Hosts enthält, bei denen customer auf „icinga“ gesetzt ist assign where host.vars.customer == "icinga" • Weisen Sie einen http Service (apply) für beide Hosts zu, der die URI “/icingaweb” prüft → /usr/share/icinga2/include/command-plugins.conf → http_uri → assign where match("workshop*", host.name) • Erstellen Sie eine ServiceGroup „icinga-http“ und setzen Sie die eben erstellen Services in diese Gruppe Icinga 2 Workshop /etc/icinga2/zones.d/checker/workshop.conf
  • 15. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG Practice solutionPractice solution Icinga 2 Workshop object Host "workshop-1" { import "generic-host" address = "192.168.33.10" vars.customer = "icinga" } object Host "workshop-2" { import "generic-host" address = "192.168.33.20" vars.customer = "icinga" } object HostGroup "icinga" { assign where host.vars.customer == "icinga" } apply Service "http" { check_command = "http" vars.http_uri = "/icingaweb" groups += [ "icinga-http" ] assign where match("workshop*", host.name) } object ServiceGroup "icinga-http" { }
  • 16. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG NotificationNotification Icinga 2 Workshop template Notification "notify-mysql-users" { command = "mail-service-notification" states = [ OK, Warning, Critical, Unknown ] types = [ Problem, Acknowledgement, Recovery, Custom, FlappingStart, FlappingEnd, DowntimeStart, DowntimeEnd, DowntimeRemoved ] period = "24x7" user_groups = [ "icingaadmins" ] } apply Notification "mysql-status" to Service { import "notify-mysql-users" assign where match("*mysql*", service.check_command) ignore where services.vars.disable_mysql_notifications == true } apply Notification "notify-cust-icinga-mysql" to Service { import "cust-icinga-notification" assign where match("*mysql*", service.check_command) && host.vars.customer == "icinga" ignore where match("*internal", host.name) ignore where service.vars.sla != "24x7" }
  • 17. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG DependencyDependency Icinga 2 Workshop apply Service "nrpe-health" { import "generic-service" check_command = "nrpe" assign where host.vars.agent == "nrpe" } apply Service "nrpe-load" { import "generic-service" check_command = "nrpe" vars.nrpe_command = "check_load" assign where host.vars.agent == "nrpe" } apply Service "nrpe-disk" { import "generic-service" check_command = "nrpe" vars.nrpe_command = "check_disk" assign where host.vars.agent == "nrpe" } object Host "nrpe-server" { import "generic-host" address = "192.168.1.5" vars.agent = "nrpe" } apply Dependency "disable-nrpe-checks" to Service parent_service_name = "nrpe-health" states = [ OK ] disable_checks = true disable_notifications = true assign where service.check_command == "nrpe" && host.vars.agent == "nrpe" ignore where service.name == "nrpe-health" }
  • 19. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG Reconfigure to Master-MasterReconfigure to Master-Master • Wir lösen die Zone checker auf und nehmen icinga2b in die Master Zone auf • Icinga 2 auf beiden Seiten stoppen • Gecachte Cluster Daten löschen (beide Seiten) rm -rf /var/lib/icinga2/api/zones/* • zones.conf auf beiden Servern editieren • Inhalt von /etc/icinga2/zones.d/checker/ nach ../master/ verschieben • IDO HA Funktion deaktivieren • Icinga 2 wieder starten Icinga 2 Workshop # vim /etc/icinga2/features-enabled/ido-mysql.conf object IdoMysqlConnection "ido-mysql" { enable_ha = false } object Zone "master" { endpoints = [ "icinga2a", "icinga2b" ] }
  • 20. DEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORGDEV. WIKI. BLOG. DOC. | WWW.ICINGA.ORG QUESTIONS & ANSWERSQUESTIONS & ANSWERS Icinga 2 Workshop Web + Blog www.icinga.org Docs docs.icinga.org Development dev.icinga.org Sourcecode git.icinga.org Releases github.com/Icinga Wiki wiki.icinga.org IRC #icinga on FreeNode Mailing lists lists.icinga.org Support support.icinga.org Twitter twitter.com/icinga Facebook facebook.com/icinga …….. Everywhere! ? Questions & Answers