icinga 2 - apify them all at icinga camp amsterdam 2016

28
www.icinga.org #icingacamp – Amsterdam – 06/28/2016 ICINGA 2 – APIFY THEM ALL

Upload: icinga

Post on 12-Jan-2017

534 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

www.icinga.org

#icingacamp – Amsterdam – 06/28/2016

ICINGA 2 – APIFY THEM ALL

Page 2: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

vs.

Page 3: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

•  Michael Friedrich

•  Core developer

•  Senior Developer @NETWAYS

•  ~7 years #icingalove

•  monitoring-portal.org

•  @dnsmichi

Page 4: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

ICINGA2 - API

Page 5: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

•  HTTP with RESTful Url Schema

•  ApiUser config object

•  X.509 and/or Basic Auth

Page 6: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

ApiUser Object

# vim /etc/icinga2/conf.d/api-users.conf

object ApiUser "root" {

password = "icinga”

permissions = [ "*" ]

}

Page 7: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

ApiUser Permissions

permissions = [

{

permission = "objects/query/Host"

filter = {{ regex("^Linux", host.vars.os) }}

},

{

permission = "objects/query/Service"

filter = {{ regex("^Linux", service.vars.os) }}

}

]

Page 8: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

•  create, modify and delete objects

•  retrieve information and run actions

•  subscribe to events

•  manage configuration packages

Page 9: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

•  Configuration management

•  New standard config API

•  Support for Packages and Stages

•  Support for Zones

•  Used by the Icinga Director

Page 10: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

•  Event Streams

•  Based on Types and Filters CheckResult, StateChange, Notification,

Acknowledgement*, Comment*, Downtime*

•  Example /v1/events?queue=camp&types=CheckResult

Page 11: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

•  Status, Objects, Actions and Events

•  Simple filter •  services?service=localhost!ping6

•  Advanced filter •  type=Service&filter=service.name==%22ping6%22

•  (Hint: assign where expressions)

Page 12: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

Demo

Page 13: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

API CLIENTS

Page 14: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

Icinga Studio

Page 15: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

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%"]

Page 16: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

Icinga 2 Dashing

Page 17: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

Icinga Director

WaitforTom!J

Page 18: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

Bitbar for OSX

Page 19: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

Paw for OSX

Page 20: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

ICINGA 2 API – COMMUNITY

Page 21: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

•  Libraries

•  python-icinga2api: https://pypi.python.org/pypi/python-icinga2api

•  Status

•  BitBar OSX: https://getbitbar.com/plugins/Dev/Icinga2/icinga2.24m.py

•  Event Streams

•  Logstash input: https://github.com/bobapple/logstash-input-icinga_eventstream

•  Flapjack events: https://github.com/sol1/flapjack-icinga2

Page 22: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

•  Actions

•  Lita handler: https://github.com/tuxmea/lita-icinga2

•  Sakuli Forwarder: http://sakuli.readthedocs.io/en/dev/forwarder-icinga2api/

•  mqttwarn: https://github.com/jpmens/mqttwarn#icinga2

•  OpsGenie actions: https://www.opsgenie.com/docs/integrations/icinga2-integration

Page 23: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

•  Articles

•  http://engineering.laterooms.com/taking-the-badger-to-icingard/

•  https://issues.geant.net/jira/browse/PSCMON-111

•  https://www.unixe.de/icinga2-dashing/

Page 24: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

ICINGA 2 API – WHAT’S NEXT?

Page 25: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

•  Libraries

•  Foreman, Puppet/Ansible/Chef Hook?

•  Elastic/Logstash integration?

•  Nagstamon, NagVis, …?

•  Send a PR: https://github.com/Icinga/icinga2-api-examples

Page 26: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

CONCLUSION

Page 27: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

•  Download Icinga 2

•  Play with the Vagrant boxes

•  Check the API docs

•  Share your ideas & API clients

Page 28: Icinga 2 - Apify them all at Icinga Camp Amsterdam 2016

THANK YOU! www.icinga.org

dev.icinga.org

git.icinga.org

@icinga

/icinga

+icinga