![Page 2: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/2.jpg)
Outline
1. VirtualBox
2. Installation
3. Features
4. Plugins
5. Configuration
6. Web GUI
![Page 3: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/3.jpg)
VirtualBox
• http://download.virtualbox.org/virtualbox
1. VirtualBox
![Page 4: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/4.jpg)
Virtual Machines (1)1. VirtualBox
![Page 5: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/5.jpg)
Virtual Machines (2)1. VirtualBox
![Page 6: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/6.jpg)
Virtual Machines (3)1. VirtualBox
![Page 7: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/7.jpg)
Virtual Networking
wuncawunca
1. VirtualBox
![Page 8: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/8.jpg)
Access the Machine
•username: root
•password: wunca30
1. VirtualBox
![Page 9: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/9.jpg)
Add Repositories
• Add Repositories• /etc/apt/sources.list.d/backports.list
deb http://ftp.th.debian.org/debian wheezy-backports main
• /etc/apt/sources.list.d/icinga.list
deb http://packages.icinga.org/debain icinga-wheezy main
deb-src http://packages.icinga.org/debian icinga-wheezy main
2. Installation
![Page 10: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/10.jpg)
Install packages
• wget -O - http://packages.icinga.org/icinga.key | apt-key add -
• apt-get update
• apt-get install bash-completion cpanminus perl-doc
• apt-get install mysql-server mysql-client
• apt-get -t icinga-wheezy install icinga2 icinga2-ido-mysql
2. Installation
![Page 11: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/11.jpg)
Features
• icinga2 feature list
• icinga2 feature enable ido-mysql command compatlog
• icinga2 feature enable perfdata
• service icinga2 restart
3. Features
![Page 12: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/12.jpg)
Livestatus
• apt-get install netcat-openbsd netcat6
• apt-get -t wheezy-backports install check-mk-livestatus
• cpanm Monitoring::Livestatus
• icinga2 feature enable livestatus
• service icinga2 restart
• echo -e 'GET services\n' | nc -U /var/run/icinga2/cmd/livestatus
3. Features
![Page 13: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/13.jpg)
Setting up Check Plugins• apt-get install libmysqlclient-dev libssl-dev
• apt-get -t wheezy-backports install monitoring-plugins
• cpanm Monitoring::Plugin
• /etc/icinga2/constants.conf
const PluginDir = “/usr/lib/nagios/plugins”
• https://www.monitoring-plugins.org
• https://exchange.icinga.org
4. Plugins
![Page 14: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/14.jpg)
Configurating Icinga 2
• /etc/icinga2/init.conf
const RunAsUser = "nagios"
const RunAsGroup = "nagios"
• /etc/icinga2/conf.d
5. Configuration
![Page 15: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/15.jpg)
Commands (1)
• /etc/icinga2/conf.d/commands.conf
object CheckCommand "ssh6" {
import "plugin-check-command"
command = PluginDir + "/check_ssh -6 $address6$"
}
5. Configuration
![Page 16: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/16.jpg)
Commands (2)
object CheckCommand "http6" {
import "http"
arguments += {
"-6" = {
skip_key = true
}
}
vars.http_address = "$address6$"
}
5. Configuration
![Page 17: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/17.jpg)
Templates
/etc/icinga2/conf.d/templates.conf
template Host "generic-host6" {
max_check_attempts = 5
check_interval = 1m
retry_interval = 30s
check_command = "ping6"
}
5. Configuration
![Page 18: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/18.jpg)
Hosts (1)
/etc/icinga2/conf.d/hosts.conf
object Host "localhost" {
import "generic-host6"
address = "::1"
}
5. Configuration
![Page 19: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/19.jpg)
Hosts (2)
object Host "server" {
import "generic-host6"
address = "2001:db8:c0e:0:192:168:0:5"
}
5. Configuration
![Page 20: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/20.jpg)
Services (1)
/etc/icinga2/conf.d/services.conf
object Service "http6" {
import "generic-service"
check_command = "http6"
host_name = "localhost"
}
5. Configuration
![Page 21: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/21.jpg)
Services (2)
object Service "ssh6" {
import "generic-service"
check_command = "ssh6"
host_name = "dns"
}
5. Configuration
![Page 22: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/22.jpg)
Validate the configuration
/etc/init.d/icinga2 checkconfig
• icinga2 daemon -c /etc/icinga2/icinga2.conf -C
• service icinga2 reload
5. Configuration
![Page 23: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/23.jpg)
Troubleshooting
• su - nagios -s /bin/bash
• /usr/lib/nagios/plugins/check_ping --help
5. Configuration
![Page 24: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/24.jpg)
Vim• ~/.bashrc
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS -l'
alias vi='vim'
• . .bashrc
• /etc/vim/vimrc
syntax on
• PREFIX=~/.vim
• mkdir -p $PREFIX/{syntax,ftdetect}
• cp /usr/share/icinga2-common/syntax/vim/ftdetect/icinga2.vim $PREFIX/ftdetect/
• cp /usr/share/icinga2-common/syntax/vim/syntax/icinga2.vim $PREFIX/syntax/
5. Configuration
![Page 25: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/25.jpg)
Icinga Web 2 (1)
• apt-get install apache2-mpm-itk git zendframework
• apt-get install php5 php5-gd php5-imagick php5-intl php5-ldap php5-mcrypt php5-mysql php5-pgsql php-gettext php-net-socket
• usermod -a -G nagios www-data
• (cd /etc/apache2/mods-enabled && ln -s ../mods-available/rewrite.load .)
6. Web GUI
![Page 26: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/26.jpg)
Icinga Web 2 (2)
• /etc/php5/apache2/php.ini
[Date]
date.timezone = Asia/Bangkok
6. Web GUI
![Page 27: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/27.jpg)
Icinga Web 2 (3)• cd /usr/local/src
• git clone git://git.icinga.org/icingaweb2.git
• cp -a icingaweb2 /usr/share/
• cd /usr/share/icingaweb2
• ./bin/icingacli setup config webserver apache --document-root /usr/share/icingaweb2/public > /etc/apache2/conf.d/icingaweb2.conf
• ./bin/icingacli setup config directory --group www-data
• ./bin/icingacli setup token create
• ./bin/icingacli setup token show
6. Web GUI
![Page 28: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/28.jpg)
Icinga Web 2 (4)
• service apache2 restart
• mkdir -p /etc/icingaweb2/modules/monitoring
• chown -R www-data:www-data /etc/icingaweb2/modules
• http://192.168.56.101/icingaweb2/
6. Web GUI
![Page 29: Icinga 2 - Uniuni.net.th/wunca_regis/wunca30_doc/23/009_Icinga.pdfFeatures •icinga2 feature list •icinga2 feature enable ido-mysql command compatlog •icinga2 feature enable perfdata](https://reader030.vdocuments.site/reader030/viewer/2022040921/5e9aeb72c03e1c1c4c1164e7/html5/thumbnails/29.jpg)
Icinga Classic UI
• apt-get -t wheezy-backports install icinga-cgi-bin
• apt-get -t icinga-wheezy install icinga2-classicui
• icinga2 feature enable statusdata
• service icinga2 restart
• htpasswd /etc/icinga2-classicui/htpasswd.users icingaadmin
• http://192.168.56.1/icinga2-classicui
6. Web GUI