monitoring as code

38
Cfgmgmt Camp | Gent | 07.02.2017 Monitoring as Code Icinga 2 07.02.2017

Upload: icinga

Post on 13-Apr-2017

891 views

Category:

Presentations & Public Speaking


0 download

TRANSCRIPT

Page 1: Monitoring as code

Cfgmgmt Camp | Gent | 07.02.2017

Monitoring as CodeIcinga 2

07.02.2017

Page 2: Monitoring as code

• Blerim Sheqa• Product Manager Partners & Integration• Working @netways• @bobapple

Page 3: Monitoring as code
Page 4: Monitoring as code

Introduction to Icinga 2

Page 5: Monitoring as code

Icinga is a scalable and extensible monitoring system which checks the availability of your resources, notifies users of outages and provides extensive metrics.

availability notifiesmetrics

Page 6: Monitoring as code

Checker

Notify

Gelf

Perfdata Graphite

IDO

InfluxDB

Livestatus

• Multithreaded• Modular

Features• Zone support• Secure Agent

Page 7: Monitoring as code

• Availability and scaling zones• Automatic redistribution of

checks• Zones for multitenancy

environments

zonesredistribution

multitenancy

Page 8: Monitoring as code

Automation

Page 9: Monitoring as code
Page 10: Monitoring as code

Configuration

Page 11: Monitoring as code

• Objects• Rule based• Conditions• Loops• Custom Functions

Rule

Page 12: Monitoring as code

object Host "demo.icinga.com" { import "generic-host"

address = "127.0.0.1" address6 = "::1"

vars.os = "Linux }

vars.os = "Linux"

Page 13: Monitoring as code

Rules

Page 14: Monitoring as code

apply Service "ssh" { import "generic-service"

check_command = "ssh"

assign where host.vars.os == "Linux" ignore where host.vars.dev == true }

assign

Page 15: Monitoring as code
Page 16: Monitoring as code

More Rules

Page 17: Monitoring as code

object Host "demo.icinga.com" { import "generic-host"

address = "127.0.0.1" address6 = "::1"

vars.http_vhosts["Icinga Web 2" http_uri = "/icingaweb2" }

vars.http_vhosts["Grafana"] = { http_port = 3000 }}

vars.http_vhosts["Icinga Web 2"] = { http_uri = "/icingaweb2" }

Page 18: Monitoring as code

apply Service for ( ){ import "generic-service"

display_name = "http " + http_vhost check_command = "http"

}vars += config

http_vhost => config in host.vars_http_vhosts

Page 19: Monitoring as code
Page 20: Monitoring as code

object Host "demo.icinga.com" { import "generic-host"

address = "127.0.0.1" address6 = "::1"

vars.mysql_instance["instance-1"] = { mysql_health_port = 3306 mysql_health_username = "user1” mysql_health_password = "supersecret” }

vars.mysql_instance["instance-2"] = { mysql_health_port = 3307 mysql_health_username = "user2” mysql_health_password = "verysecret" }}

Page 21: Monitoring as code

Conditions

Page 22: Monitoring as code

apply Service "dummy" { import "generic-service"

check_command = "dummy"

if (host.vars.environment == "dev { check_interval = 30m } else { check_interval = 5m }

assign where match("srv-*", host.name)}

if (host.vars.environment == "dev")

Page 23: Monitoring as code

Functions

Page 24: Monitoring as code

object Service ”Load" { check_command = "load” host_name = ”backup.abc.com”

vars.load_warning = {{ { return 20 } else { return 5 } }}

}

if (get_time_period("backup").is_inside)

Page 25: Monitoring as code

API

Page 26: Monitoring as code

• HTTP with RESTful Url Schema • X.509 and/or Basic Auth• Create, Modify and Delete objects• Event Stream based on Types and

Filters

RESTful

Page 27: Monitoring as code

Director

Page 28: Monitoring as code

• Config via Webinterface• Config Import• Versioning• API

Page 29: Monitoring as code

• Import Sources• AWS• SQL• LDAP• PuppetDB• Files

Page 30: Monitoring as code

object Host "demo.icinga.com" { import "generic-host"

address = "127.0.0.1" address6 = "::1"

vars.kernel = ”linux” vars.osfamily = “debian” vars.domain = “example.com” vars.manufacturer = “Dill” vars.is_virtual = false}

Page 31: Monitoring as code
Page 32: Monitoring as code

• Periodic Imports• Hands-Free Config Deployments

Page 33: Monitoring as code
Page 34: Monitoring as code

• Versioning• Full Audit Log• Fast Config Reverts

Page 35: Monitoring as code
Page 36: Monitoring as code

Conclusion

Page 37: Monitoring as code

• Download Icinga 2 and Icinga Web 2

• Play with the Vagrant boxes• Rethink your configuration• Give us feedback

Vagrant boxes

Page 38: Monitoring as code

www.icinga.orgdev.icinga.orggit.icinga.org

Thank You!@icinga/icinga+icinga