Icinga2
Jakub Novotný
▷ Server monitoring
▷ Complex tool
▷ Written in C++
▷ IcingaWeb2
What is Icinga2
▷ Nagios
▷ Icinga
▷ Icinga2
History
▷ Daemon
▷ Command icinga2 (as root)
o icinga2 … --help
o icinga2 feature list
o icinga2 feature enable feature_name
o icinga2 node wizard
How does it run?
▷ every specific functionality
▷ apt-get install nagios-plugins
▷ /usr/lib/nagios/plugins
Plugins
▷ any program which returns
o 0 - OK
o 1 - WARNING
o 2 - CRITICAL
▷ Message to STDOUT
▷ /usr/lib/nagios/plugins/plugin_name --help
▷ pass settings via parameters
Plugins
▷ ./check_http -H www.seznam.cz
(OK, 302)
▷ ./check_http -H www.seznam.cz -S
(OK, 200)
▷ ./check_http -H www.seznam.cz -S -s 'Najdu tam co neznám'
(CRITICAL)
check_http Plugin
Configuration
▷ domain-specific language
▷ http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/late
st/doc/module/icinga2/chapter/language-reference
▷ /etc/icinga2/icinga2.conf
▷ loads other conf files with the
same structure
▷ Host
▷ CheckCommand
▷ Service
▷ ServiceGroup
▷ User
▷ Notification
▷ ...
Configuration Objects
CheckCommand
object CheckCommand "https-check-string" {
import "plugin-check-command"
command = [PluginDir + "/check_http"]
arguments = {
"-H" = "$base_url$" // host
"-p" = "$port$" //
port
"-u" = "$path$" // context
path
"-s" = "$string$" // expected
string
"-e" = "$status$" // exp. resp.
status
"-S" = "" //
SSL
}
vars.status = "200" // default
Service Template
template Service "bluenomics-http-check" {
import "generic-service"
check_command = "http-check-string"
host_name = "bluenomics"
vars.base_url = "www.bluenomics.com"
}
Services - each for one
check
object Service "https-bluenomics-homepage" {
import "bluenomics-https-check"
vars.string = "Macroeconomic data in" //...
}
object Service "http-bluenomics-api-8080" {
import "bluenomics-http-check"
vars.path = "/api/"
vars.port = "8080"
vars.string = "bluenomics"
vars.status = "403"
}
Apply object
apply Service "ping4" {
import "generic-service"
check_command = "ping4"
assign where host.address
}
Service Status
▷ status
o OK,
o WARNING
o CRITICAL
o UNKNOWN
▷ status state
o Soft
o Hard
Service Status Settings
conf.d/templates.conf
template Service "generic-
service" {
max_check_attempts = 3
check_interval = 1m
retry_interval = 30s
}
Notifications
▷ email
▷ SMS
▷ user groups
▷ host groups
▷ service groups
▷ notification escalation
Icinga2 Web
▷ PHP frontend
▷ agavi framework
▷ bind with Icinga IDO
Icinga2 Web
▷ no settings
▷ dashboards and overviews
▷ accepting alerts
▷ http://icinga.keyup.eu/icinga
web2/
Díky za pozornost!
Otázky?
Jakub Novotný
jakub.novotny@keyup.eu

Icinga2

  • 1.
  • 2.
    ▷ Server monitoring ▷Complex tool ▷ Written in C++ ▷ IcingaWeb2 What is Icinga2
  • 3.
  • 4.
    ▷ Daemon ▷ Commandicinga2 (as root) o icinga2 … --help o icinga2 feature list o icinga2 feature enable feature_name o icinga2 node wizard How does it run?
  • 5.
    ▷ every specificfunctionality ▷ apt-get install nagios-plugins ▷ /usr/lib/nagios/plugins Plugins
  • 6.
    ▷ any programwhich returns o 0 - OK o 1 - WARNING o 2 - CRITICAL ▷ Message to STDOUT ▷ /usr/lib/nagios/plugins/plugin_name --help ▷ pass settings via parameters Plugins
  • 7.
    ▷ ./check_http -Hwww.seznam.cz (OK, 302) ▷ ./check_http -H www.seznam.cz -S (OK, 200) ▷ ./check_http -H www.seznam.cz -S -s 'Najdu tam co neznám' (CRITICAL) check_http Plugin
  • 8.
    Configuration ▷ domain-specific language ▷http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/late st/doc/module/icinga2/chapter/language-reference ▷ /etc/icinga2/icinga2.conf ▷ loads other conf files with the same structure
  • 9.
    ▷ Host ▷ CheckCommand ▷Service ▷ ServiceGroup ▷ User ▷ Notification ▷ ... Configuration Objects
  • 10.
    CheckCommand object CheckCommand "https-check-string"{ import "plugin-check-command" command = [PluginDir + "/check_http"] arguments = { "-H" = "$base_url$" // host "-p" = "$port$" // port "-u" = "$path$" // context path "-s" = "$string$" // expected string "-e" = "$status$" // exp. resp. status "-S" = "" // SSL } vars.status = "200" // default
  • 11.
    Service Template template Service"bluenomics-http-check" { import "generic-service" check_command = "http-check-string" host_name = "bluenomics" vars.base_url = "www.bluenomics.com" }
  • 12.
    Services - eachfor one check object Service "https-bluenomics-homepage" { import "bluenomics-https-check" vars.string = "Macroeconomic data in" //... } object Service "http-bluenomics-api-8080" { import "bluenomics-http-check" vars.path = "/api/" vars.port = "8080" vars.string = "bluenomics" vars.status = "403" }
  • 13.
    Apply object apply Service"ping4" { import "generic-service" check_command = "ping4" assign where host.address }
  • 14.
    Service Status ▷ status oOK, o WARNING o CRITICAL o UNKNOWN ▷ status state o Soft o Hard
  • 15.
    Service Status Settings conf.d/templates.conf templateService "generic- service" { max_check_attempts = 3 check_interval = 1m retry_interval = 30s }
  • 16.
    Notifications ▷ email ▷ SMS ▷user groups ▷ host groups ▷ service groups ▷ notification escalation
  • 17.
    Icinga2 Web ▷ PHPfrontend ▷ agavi framework ▷ bind with Icinga IDO
  • 18.
    Icinga2 Web ▷ nosettings ▷ dashboards and overviews ▷ accepting alerts ▷ http://icinga.keyup.eu/icinga web2/
  • 22.
    Díky za pozornost! Otázky? JakubNovotný jakub.novotny@keyup.eu