Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
www.icinga.org
#icingacamp – Berlin – 03/01/2016
ICINGA 2 – APIFY THEM ALL
• Michael Friedrich
• Core developer, Vagrant boxes
• Senior Developer @NETWAYS
• ~7 years #icingalove
• monitoring-portal...
ICINGA2 - API
We had “APIs”
• HTTP with RESTful Url Schema
• ApiUser config object
• X.509 and/or Basic Auth
ApiUser Object
# vim /etc/icinga2/conf.d/api-users.conf
object ApiUser "root" {
password = "icinga”
permissions = [ "*" ]
}
ApiUser Permissions
permissions = [
{
permission = "objects/query/Host"
filter = {{ regex("^Linux", host.vars.os) }}
},
{
...
• create, modify and delete objects
• retrieve information and run actions
• subscribe to events
• manage configuration pa...
• Configuration management
• New standard config API
• Support for Packages and Stages
• Support for Zones
• Used by the I...
• Event Streams
• Based on Types and Filters
CheckResult, StateChange, Notification,
Acknowledgement*, Comment*, Downtime*...
• Status, Objects, Actions and Events
• Simple filter
• services?service=localhost!ping6
• Advanced filter
• type=Service&...
Demo
API CLIENTS
Icinga Studio
Icinga2 console
# ICINGA2_API_PASSWORD=icinga icinga2 console --connect
'https://root@localhost:5665/' --eval
'get_host(No...
Icinga 2 Dashing
Icinga Director
Wait for Tom! 
ICINGA 2 API – WHAT’S NEXT?
• Libraries
• Foreman, Puppet Hook?
• Logstash integration?
• Nagstamon, NagVis, …?
• Send a PR:
https://github.com/Icinga...
CONCLUSION
• Download Icinga 2
• Play with the Vagrant boxes
• Check the API docs
• Share your ideas & API clients
THANK YOU!
www.icinga.org
dev.icinga.org
git.icinga.org
@icinga
/icinga
+icinga
Upcoming SlideShare
Loading in …5
×

Icinga2 - Apify them all

11,719 views

Published on

Talk by Michael Friedrich at Icinga Camp Berlin 2016. Talk covers the latest development in the Icinga 2 core, especially the API

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Icinga2 - Apify them all

  1. 1. www.icinga.org #icingacamp – Berlin – 03/01/2016 ICINGA 2 – APIFY THEM ALL
  2. 2. • Michael Friedrich • Core developer, Vagrant boxes • Senior Developer @NETWAYS • ~7 years #icingalove • monitoring-portal.org • @dnsmichi
  3. 3. ICINGA2 - API
  4. 4. We had “APIs”
  5. 5. • HTTP with RESTful Url Schema • ApiUser config object • X.509 and/or Basic Auth
  6. 6. ApiUser Object # vim /etc/icinga2/conf.d/api-users.conf object ApiUser "root" { password = "icinga” permissions = [ "*" ] }
  7. 7. ApiUser Permissions permissions = [ { permission = "objects/query/Host" filter = {{ regex("^Linux", host.vars.os) }} }, { permission = "objects/query/Service" filter = {{ regex("^Linux", service.vars.os) }} } ]
  8. 8. • create, modify and delete objects • retrieve information and run actions • subscribe to events • manage configuration packages
  9. 9. • Configuration management • New standard config API • Support for Packages and Stages • Support for Zones • Used by the Icinga Director
  10. 10. • Event Streams • Based on Types and Filters CheckResult, StateChange, Notification, Acknowledgement*, Comment*, Downtime* • Example /v1/events?queue=camp&types=CheckResult
  11. 11. • Status, Objects, Actions and Events • Simple filter • services?service=localhost!ping6 • Advanced filter • type=Service&filter=service.name==%22ping6%22 • (Hint: assign where expressions)
  12. 12. Demo
  13. 13. API CLIENTS
  14. 14. Icinga Studio
  15. 15. Icinga2 console # ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/' --eval 'get_host(NodeName).last_check_result.command' | python -m json.tool [ "/usr/lib64/nagios/plugins/check_ping", "-H", "127.0.0.1", "-c", "5000,100%", "-w", "3000,80%" ]
  16. 16. Icinga 2 Dashing
  17. 17. Icinga Director Wait for Tom! 
  18. 18. ICINGA 2 API – WHAT’S NEXT?
  19. 19. • Libraries • Foreman, Puppet Hook? • Logstash integration? • Nagstamon, NagVis, …? • Send a PR: https://github.com/Icinga/icinga2-api- examples
  20. 20. CONCLUSION
  21. 21. • Download Icinga 2 • Play with the Vagrant boxes • Check the API docs • Share your ideas & API clients
  22. 22. THANK YOU! www.icinga.org dev.icinga.org git.icinga.org @icinga /icinga +icinga

×