Icinga2 - Apify them all
-
Upload
icinga -
Category
Technology
-
view
8.303 -
download
1
Transcript of Icinga2 - Apify them all
![Page 1: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/1.jpg)
www.icinga.org
#icingacamp – Berlin – 03/01/2016
ICINGA 2 – APIFY THEM ALL
![Page 2: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/2.jpg)
• Michael Friedrich• Core developer, Vagrant boxes• Senior Developer @NETWAYS• ~7 years #icingalove• monitoring-portal.org
• @dnsmichi
![Page 3: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/3.jpg)
ICINGA2 - API
![Page 4: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/4.jpg)
We had “APIs”
![Page 5: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/5.jpg)
• HTTP with RESTful Url Schema • ApiUser config object• X.509 and/or Basic Auth
![Page 6: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/6.jpg)
ApiUser Object
# vim /etc/icinga2/conf.d/api-users.conf
object ApiUser "root" {
password = "icinga”
permissions = [ "*" ]
}
![Page 7: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/7.jpg)
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: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/8.jpg)
• create, modify and delete objects• retrieve information and run actions• subscribe to events• manage configuration packages
![Page 9: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/9.jpg)
• Configuration management• New standard config API • Support for Packages and Stages• Support for Zones• Used by the Icinga Director
![Page 10: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/10.jpg)
• Event Streams• Based on Types and Filters
CheckResult, StateChange, Notification, Acknowledgement*, Comment*, Downtime*
• Example/v1/events?queue=camp&types=CheckResult
![Page 11: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/11.jpg)
• 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: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/12.jpg)
Demo
![Page 13: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/13.jpg)
API CLIENTS
![Page 14: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/14.jpg)
Icinga Studio
![Page 15: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/15.jpg)
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: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/16.jpg)
Icinga 2 Dashing
![Page 17: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/17.jpg)
Icinga Director
Wait for Tom!
![Page 18: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/18.jpg)
ICINGA 2 API – WHAT’S NEXT?
![Page 19: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/19.jpg)
• Libraries• Foreman, Puppet Hook?• Logstash integration?• Nagstamon, NagVis, …?• Send a PR:
https://github.com/Icinga/icinga2-api-examples
![Page 20: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/20.jpg)
CONCLUSION
![Page 21: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/21.jpg)
• Download Icinga 2• Play with the Vagrant boxes• Check the API docs• Share your ideas & API clients
![Page 22: Icinga2 - Apify them all](https://reader033.fdocuments.net/reader033/viewer/2022061306/587249831a28ab852f8b54af/html5/thumbnails/22.jpg)
THANK YOU!www.icinga.orgdev.icinga.orggit.icinga.org
@icinga/icinga+icinga