icinga2
TRANSCRIPT
![Page 1: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/1.jpg)
Icinga2
Jakub Novotný
![Page 2: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/2.jpg)
▷ Server monitoring
▷ Complex tool
▷ Written in C++
▷ IcingaWeb2
What is Icinga2
![Page 3: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/3.jpg)
▷ Nagios
▷ Icinga
▷ Icinga2
History
![Page 4: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/4.jpg)
▷ 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?
![Page 5: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/5.jpg)
▷ every specific functionality
▷ apt-get install nagios-plugins
▷ /usr/lib/nagios/plugins
Plugins
![Page 6: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/6.jpg)
▷ any program which returnso 0 - OK
o 1 - WARNING
o 2 - CRITICAL
▷ Message to STDOUT
▷ /usr/lib/nagios/plugins/plugin_name
--help
▷ pass settings via parameters
Plugins
![Page 7: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/7.jpg)
▷ ./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
![Page 8: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/8.jpg)
Configuration
▷ domain-specific language▷ http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc#!/icinga2/latest
/doc/module/icinga2/chapter/language-reference
▷ /etc/icinga2/icinga2.conf▷ loads other conf files with the
same structure
![Page 9: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/9.jpg)
▷ Host
▷ CheckCommand
▷ Service
▷ ServiceGroup
▷ User
▷ Notification
▷ ...
Configuration Objects
![Page 10: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/10.jpg)
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 value }
![Page 11: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/11.jpg)
Service Template
template Service "bluenomics-http-check" { import "generic-service" check_command = "http-check-string" host_name = "bluenomics" vars.base_url = "www.bluenomics.com"}
![Page 12: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/12.jpg)
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"}
![Page 13: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/13.jpg)
Apply object
apply Service "ping4" { import "generic-service" check_command = "ping4" assign where host.address}
![Page 14: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/14.jpg)
Service Status
▷ statuso OK, o WARNINGo CRITICALo UNKNOWN
▷ status stateo Softo Hard
![Page 15: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/15.jpg)
Service Status Settings
conf.d/templates.conf
template Service "generic-service" { max_check_attempts = 3 check_interval = 1m retry_interval = 30s}
![Page 16: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/16.jpg)
Notifications
▷ email▷ SMS▷ user groups▷ host groups▷ service groups▷ notification escalation
![Page 17: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/17.jpg)
Icinga2 Web
▷ PHP frontend▷ agavi framework▷ bind with Icinga IDO
![Page 18: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/18.jpg)
Icinga2 Web
▷ no settings▷ dashboards and overviews▷ accepting alerts▷ http://icinga.keyup.eu/
icingaweb2/
![Page 19: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/19.jpg)
![Page 20: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/20.jpg)
![Page 21: Icinga2](https://reader031.vdocuments.us/reader031/viewer/2022013003/55baf16abb61eb5f0a8b4839/html5/thumbnails/21.jpg)