SlideShare a Scribd company logo
1 of 11
Download to read offline
Ansible & Icinga 2 API
Configuration management and monitoring
@dan_vaida Berlin Ansible Meetup
Ansible & Icinga 2 API
Configuration management and monitoring
@dan_vaida Berlin Ansible Meetup
Icinga 2
• Advanced open-source monitoring solution
(forked from Nagios)
• Comes with rich CLI, REST API
• Encrypted cluster communication
• Supports MySQL or Postgres databases
@dan_vaida Berlin Ansible Meetup
Icinga 2 getting started
resources
• Ansible, Puppet & Chef provisioning
• Vagrant boxes (provisioned with Puppet)
• Docker container
• Great docs, active development and support
• Icinga Exchange: directory for Modules, Addons
and Plugins (i.e. Graphite & Grafana). Sort of like
Ansible Galaxy for roles.
@dan_vaida Berlin Ansible Meetup
My learnings from this
integration - pt. 1
• Ansible* can talk to the API through the shell or
uri modules (depends on the auth type)
• You’re still gonna have to do templating of some
of the .conf files
• The API is creating separate .conf files that are
merged in-memory upon service (re)start with
the “normal” .conf files
* Ansible 2+ is required for some nice params of the uri module
@dan_vaida Berlin Ansible Meetup
My learnings from this
integration - pt. 2
• The merging of the templated .conf files with the ones
resulting from the API calls is sometimes acting weird
• The API cannot handle configuration objects that
weren’t created through the API
• It’s production-ready but it’s still WIP (i.e. consistent
response structure, response code meaning, empty
response objects(!), value format checks)
• Don’t confuse Icinga API Users, Icinga Contacts/
Users and Icinga Web 2 Users
@dan_vaida Berlin Ansible Meetup
My learnings from this
integration - pt. 3
• Idempotence: consistent API response structure
and Ansible from_json filter make it easy to work
with changed_when and when conditionals
• Ansible makes it really easy to reuse the Icinga
API tasks by changing the HTTP Request Verb
(for example through —extra-vars)
• Incentivized to write an Ansible module for
interacting with the Icinga API
@dan_vaida Berlin Ansible Meetup
My learnings from this
integration - pt. 4
• With the help of Ansible and the Icinga RESTful
API, the Devs can and are finally coding
monitoring :)
• With just a few tasks in your deployment
playbooks one can simply and proactively ready
the monitoring system
• It’s easy to go crazy (HipChat -> Hubot -> Icinga
API -> PagerDuty)
@dan_vaida Berlin Ansible Meetup
Demo
https://git.io/vwlq4
@dan_vaida Berlin Ansible Meetup
Questions?
@dan_vaida Berlin Ansible Meetup
Thanks for watching!
@dan_vaida Berlin Ansible Meetup

More Related Content

Viewers also liked

Icinga2 - Upcoming API for Icinga2
Icinga2 - Upcoming API for Icinga2Icinga2 - Upcoming API for Icinga2
Icinga2 - Upcoming API for Icinga2Icinga
 
Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrate
Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrateToshaan Bharvani – Icinga2 and Ansible, how to manage and migrate
Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrateIcinga
 
Afpified Monitoring with Icinga2
Afpified Monitoring with Icinga2Afpified Monitoring with Icinga2
Afpified Monitoring with Icinga2Icinga
 
Icinga2 api use cases
Icinga2 api use casesIcinga2 api use cases
Icinga2 api use casesroy peter
 
Icinga Camp Berlin 2017 - Integrations all the way
Icinga Camp Berlin 2017 - Integrations all the wayIcinga Camp Berlin 2017 - Integrations all the way
Icinga Camp Berlin 2017 - Integrations all the wayIcinga
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 

Viewers also liked (6)

Icinga2 - Upcoming API for Icinga2
Icinga2 - Upcoming API for Icinga2Icinga2 - Upcoming API for Icinga2
Icinga2 - Upcoming API for Icinga2
 
Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrate
Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrateToshaan Bharvani – Icinga2 and Ansible, how to manage and migrate
Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrate
 
Afpified Monitoring with Icinga2
Afpified Monitoring with Icinga2Afpified Monitoring with Icinga2
Afpified Monitoring with Icinga2
 
Icinga2 api use cases
Icinga2 api use casesIcinga2 api use cases
Icinga2 api use cases
 
Icinga Camp Berlin 2017 - Integrations all the way
Icinga Camp Berlin 2017 - Integrations all the wayIcinga Camp Berlin 2017 - Integrations all the way
Icinga Camp Berlin 2017 - Integrations all the way
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Recently uploaded

CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...Akihiro Suda
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROmotivationalword821
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 

Recently uploaded (20)

CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTRO
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 

Ansible & Icinga 2 API

  • 1. Ansible & Icinga 2 API Configuration management and monitoring @dan_vaida Berlin Ansible Meetup
  • 2. Ansible & Icinga 2 API Configuration management and monitoring @dan_vaida Berlin Ansible Meetup
  • 3. Icinga 2 • Advanced open-source monitoring solution (forked from Nagios) • Comes with rich CLI, REST API • Encrypted cluster communication • Supports MySQL or Postgres databases @dan_vaida Berlin Ansible Meetup
  • 4. Icinga 2 getting started resources • Ansible, Puppet & Chef provisioning • Vagrant boxes (provisioned with Puppet) • Docker container • Great docs, active development and support • Icinga Exchange: directory for Modules, Addons and Plugins (i.e. Graphite & Grafana). Sort of like Ansible Galaxy for roles. @dan_vaida Berlin Ansible Meetup
  • 5. My learnings from this integration - pt. 1 • Ansible* can talk to the API through the shell or uri modules (depends on the auth type) • You’re still gonna have to do templating of some of the .conf files • The API is creating separate .conf files that are merged in-memory upon service (re)start with the “normal” .conf files * Ansible 2+ is required for some nice params of the uri module @dan_vaida Berlin Ansible Meetup
  • 6. My learnings from this integration - pt. 2 • The merging of the templated .conf files with the ones resulting from the API calls is sometimes acting weird • The API cannot handle configuration objects that weren’t created through the API • It’s production-ready but it’s still WIP (i.e. consistent response structure, response code meaning, empty response objects(!), value format checks) • Don’t confuse Icinga API Users, Icinga Contacts/ Users and Icinga Web 2 Users @dan_vaida Berlin Ansible Meetup
  • 7. My learnings from this integration - pt. 3 • Idempotence: consistent API response structure and Ansible from_json filter make it easy to work with changed_when and when conditionals • Ansible makes it really easy to reuse the Icinga API tasks by changing the HTTP Request Verb (for example through —extra-vars) • Incentivized to write an Ansible module for interacting with the Icinga API @dan_vaida Berlin Ansible Meetup
  • 8. My learnings from this integration - pt. 4 • With the help of Ansible and the Icinga RESTful API, the Devs can and are finally coding monitoring :) • With just a few tasks in your deployment playbooks one can simply and proactively ready the monitoring system • It’s easy to go crazy (HipChat -> Hubot -> Icinga API -> PagerDuty) @dan_vaida Berlin Ansible Meetup
  • 11. Thanks for watching! @dan_vaida Berlin Ansible Meetup