Instalacja oprogramowania Icinga 2 w Ubuntu Server 14.04

Z Thomas-Krenn-Wiki
Przejdź do nawigacji Przejdź do wyszukiwania

W tym artykule znajdują się informacje na temat instalacji oprogramowania Icinga 2 w wersji 2.3.X w systemie Ubuntu 14.04 LTS. Poza tym opisana jest instalacja interfejsów Icinga Web 2 i Icinga Classic UI.

Źródło pakietów Icinga 2

Aby możliwe było zainstalowanie oprogramowania Icinga 2 należy w źródłach pakietów systemu Ubuntu Server 14.04 dodać repozytorium Icinga [1]:

# wget -O - http://packages.icinga.org/icinga.key | apt-key add -
# echo 'deb http://packages.icinga.org/ubuntu icinga-trusty main' > /etc/apt/sources.list.d/icinga-main-trusty.list

Następnie należy aktualizować listę pakietów:

# apt-get update

Instalacja oprogramowania Icinga 2

Podstawowa instalacja oprogramowania Icinga 2 odbywa się przez apt i pakiet icinga2:[2]

$ sudo apt-get install icinga2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  icinga2-bin icinga2-common icinga2-doc libboost-program-options1.54.0
  libboost-regex1.54.0 libboost-system1.54.0 libboost-thread1.54.0 libicu52
  libyajl2 nagios-plugins-basic nagios-plugins-common
Suggested packages:
  nagios3 icinga
The following NEW packages will be installed:
  icinga2 icinga2-bin icinga2-common icinga2-doc
  libboost-program-options1.54.0 libboost-regex1.54.0 libboost-system1.54.0
  libboost-thread1.54.0 libicu52 libyajl2 nagios-plugins-basic
  nagios-plugins-common
0 upgraded, 12 newly installed, 0 to remove and 3 not upgraded.
Need to get 10.1 MB of archives.
After this operation, 48.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
[...]
Setting up icinga2-doc (2.3.10~trusty) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up icinga2-bin (2.3.10~trusty) ...
enabling default icinga2 features
Enabling feature checker. Make sure to restart Icinga 2 for these changes to take effect.
Enabling feature notification. Make sure to restart Icinga 2 for these changes to take effect.
Enabling feature mainlog. Make sure to restart Icinga 2 for these changes to take effect.
Setting up icinga2 (2.3.10~trusty) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
$ dpkg -l | grep icinga
ii  icinga2                              2.3.10~trusty                    amd64        host and network monitoring system
ii  icinga2-bin                          2.3.10~trusty                    amd64        host and network monitoring system - daemon
ii  icinga2-common                       2.3.10~trusty                    all          host and network monitoring system - common files
ii  icinga2-doc                          2.3.10~trusty                    all          host and network monitoring system - documentation
$ sudo icinga2 feature list
Disabled features: api command compatlog debuglog gelf graphite icingastatus livestatus opentsdb perfdata statusdata syslog
Enabled features: checker mainlog notification

Icinga Web 2

Informacje na temat instalacji i konfiguracji Icinga Web 2 jako interfejsu webowego dla Icinga 2 znajdują się w artykule Korzystanie z Icinga 2 i Icinga Web 2.

Icinga Classic UI

Instalacja klasycznego interfejsu webowego przebiega następująco:

$ sudo apt-get install icinga2-classicui
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils fontconfig-config
  fonts-dejavu-core icinga-cgi-bin javascript-common libapr1 libaprutil1
  libaprutil1-dbd-sqlite3 libaprutil1-ldap libfontconfig1 libgd3 libjbig0
  libjpeg-turbo8 libjpeg8 libjs-jquery libjs-jquery-ui libtiff5 libvpx1
  libxpm4 nagios-images ssl-cert
Suggested packages:
  apache2-doc apache2-suexec-pristine apache2-suexec-custom libgd-tools
  libjs-jquery-ui-docs openssl-blacklist
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils fontconfig-config
  fonts-dejavu-core icinga-cgi-bin icinga2-classicui javascript-common libapr1
  libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libfontconfig1 libgd3
  libjbig0 libjpeg-turbo8 libjpeg8 libjs-jquery libjs-jquery-ui libtiff5
  libvpx1 libxpm4 nagios-images ssl-cert
0 upgraded, 25 newly installed, 0 to remove and 3 not upgraded.
Need to get 10.3 MB of archives.
After this operation, 31.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
[...]
apache2_invoke: Enable configuration icinga2-classicui
 * Reloading web server apache2
* Adding password for user icingaadmin

Od teraz jest dostępny interfejs Classic UI:

Icinga Classic UI

Włączenie rejestrowania

Aby otrzymywać szczegółowe informacje o błędach należy włączyć dla interfejsu webowego CGI funkcję rejestrowania:

  • Za pomocą edytora otworzyć cgi.cfg:
vi /etc/icinga2-classicui/cgi.cfg
  • Przy use_logging wprowadzić 1:
[...]
use_logging=1
cgi_log_file=/var/log/icinga/gui/icinga-cgi.log
[...]
  • Utworzyć plik, który ma zawierać logi:
# mkdir -p /var/log/icinga/gui/
# cd /var/log/icinga/gui/
# touch icinga-cgi.log
# chown -R www-data:www-data gui/
  • Następnie w utworzonym pliku są zapisywane logi:
# tailf /var/log/icinga/gui/icinga-cgi.log
[1404911013] Error: Invalid command object directive '_by_ssh_address'.
[1404911013] Error: Could not add object property in file '/var/cache/icinga2/objects.cache' on line 400

Wykorzystywane pakiety

Na koniec przegląd wykorzystywanych pakietów:

$ dpkg -l | grep icinga
ii  icinga-cgi-bin                       1.11.5-1~ubuntu14.04.1           amd64        host and network monitoring system - CGI scripts
ii  icinga2                              2.3.10~trusty                    amd64        host and network monitoring system
ii  icinga2-bin                          2.3.10~trusty                    amd64        host and network monitoring system - daemon
ii  icinga2-classicui                    2.3.10~trusty                    all          host and network monitoring system - classic UI
ii  icinga2-common                       2.3.10~trusty                    all          host and network monitoring system - common files
ii  icinga2-doc                          2.3.10~trusty                    all          host and network monitoring system - documentation

Dalsze informacje

Odnośniki

Autorzy: Thomas Niedermeier i Georg Schoenberger

Powiązane artykuły

Icinga 2 z interfejsem Icinga Web 2
Instalacja i konfiguracja NSClient++ w systemie Windows
Korzystanie z pluginów do monitoringu w check mk