@verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests...

22
Icinga na steroidech (poznámky z migrace menší sítě) Věroš Kaplan @verosk http://veroskaplan.cz/

Transcript of @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests...

Page 1: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Icinga na steroidech

(poznámky z migrace menší sítě)

Věroš Kaplan@verosk

http://veroskaplan.cz/

Page 2: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Icinga

https://www.icinga.com/2010/11/03/a-lesson-in-zulu-icinga/

Page 3: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Icinga Classic UI

Page 4: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Nagios Icinga Architecture

● hooks

monitoring core+

tests scheduler

checks(plug-ins)

webGUIarbitrary add-ons

Page 5: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Icinga Web

Page 6: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Templates

template Host "linux-server" {

icon_image = "penguin.png"

...

}

object Host "server-prague" {

import "linux"

address = "192.168.99.99"

}

Page 7: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Use variables

object Host "www.root.cz" {

import "generic-host"

address = "91.213.160.118"

vars.location = "prague-dc1"

vars.website_name = "www.root.cz"

vars.os = "Linux"}

Page 8: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Apply commandapply Service "dns" {

import "3rd-class"

check_command = "dns"

vars.dns_lookup = "www.na-mytince.cz"

vars.dns_expected_answer = "185.8.165.113"

assign where host.vars.os == "Linux"

}

Page 9: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Another apply command

object Host "www.root.cz" {

...

vars.website_name = "www.root.cz"}

apply Service "check_website" {

...

assign where (host.vars.website_name)

}

Page 10: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Structured variables

object Host "www.root.cz" {

...

vars.websites = [

"www.root.cz",

"root.cz"

]}

Page 11: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Structured variablesobject Host "www.root.cz" {

...

vars.websites = ["www.root.cz", "root.cz" ]}

apply Service "web" for (name in host.vars.websites) {

...

command = "http"

vars.http_host = name

}

Page 12: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Structured variables - vol.#2object Host "windows-host" {

...

vars.win_service["mswndxx"] = {

state = "started"

command = "42"

Description = "Service I don’t understand"

}

vars.win_service["msloginxx2"] = {

state = "stopped"

}}

Page 13: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Structured variables - vol.#2object Host "windows-host" {

...

vars.win_service["mswndxx"] = { }

}

apply service "win_svc" for

(name => config in host.vars.win_service) {

...

command = "win_service"

vars.service_name = name

vars.service_state = config["state"]

}

Page 14: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

API - the boring parts

$ icinga2 feature enable api

https://www.icinga.com/docs/icinga2/latest/doc/12-icinga2-api/

● observe monitoring status● objects modification(hosts, services, …)● run actions

○ enforce checks○ schedule downtimes…

Page 15: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

API - the nice parts

No more command pipe permission issues!

Page 16: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

API - the nice parts

No more command pipe permission issues!

Page 17: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

API - the nice parts

No more command pipe permission issues!

Page 18: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

API - the best parts

Page 19: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Icinga director

Page 20: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Distributed monitoring

Page 21: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

EOF

Page 22: @verosk Věroš Kaplan - LinuxDays · Nagios Icinga Architecture hooks monitoring core + tests scheduler checks (plug-ins) web GUI arbitrary add-ons

Icinga on Windows