Dies ist eine alte Version des Dokuments!
Inhaltsverzeichnis
Icinga2 -Client
Icinga ist eine vollständig auf Open-Source-Basis basierende, skalierbare und erweiterbare Monitoring-Lösung welche die Verfügbarkeit von definierten Ressource überprüft und über eine Benachrichtigungssystem verfügt.
Beschreibung | Externer Link |
---|---|
Homepage | https://www.icinga.org/ |
Dokumentation | http://docs.icinga.org/icinga2/latest/doc/module/icinga2/toc |
Download | http://packages.icinga.org/ |
Ab hier werden zur Ausführung nachfolgender Befehle root
-Rechte benötigt. Um der Benutzer root
zu werden, melden Sie sich bitte als root
-Benutzer am System an, oder wechseln mit nachfolgendem Befehl zum Benutzer root
:
$ su - Password:
Voraussetzungen
Als Voraussetzung für die Installation von Icinga-Client sind folgende Komponenten erforderlich:
- Lauffähiger Icinga-Master-Server
- Siehe auch den internen Link: Icinga2
- Siehe auch den internen Link: Icinga2 - Grundkonfiguration
Vorbereitung
Zur Installation von Icinga als rpm
-Paket, müssen nachfolgende Repositories genutzt bzw. eingebunden werden:
Repository: EPEL
Nachfolgende Beschreibung bindet das Drittanbieter-Repository von EPEL ein, damit darüber die Installation von MongoDB erfolgen kann.
- Siehe nachfolgenden internen Link: EPEL CentOS 7
Repository: Icinga
Nachfolgende Beschreibung bindet das Drittanbieter-Repository von Icinga ein, damit darüber die Installation von Icinga erfolgen kann.
Mit nachfolgendem Befehl muss in nachfolgendem Verzeichnis mit nachfolgendem Namen eine Konfigurationsdatei erstellt werden
/etc/yum.repos.d/ICINGA-release.repo
# wget -P /etc/yum.repos.d http://packages.icinga.org/epel/ICINGA-release.repo --2015-11-17 10:16:55-- http://packages.icinga.org/epel/ICINGA-release.repo Resolving packages.icinga.org (packages.icinga.org)... 185.11.254.83 Connecting to packages.icinga.org (packages.icinga.org)|185.11.254.83|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 189 Saving to: ‘/etc/yum.repos.d/ICINGA-release.repo’ 100%[======================================>] 189 --.-K/s in 0s 2015-11-17 10:16:55 (9.41 MB/s) - ‘/etc/yum.repos.d/ICINGA-release.repo’ saved [189/189]
welche nachfolgenden Inhalt aufweisen sollte:
[icinga-stable-release] name=ICINGA (stable release for epel) baseurl=http://packages.icinga.org/epel/$releasever/release/ enabled=1 gpgcheck=1 gpgkey=http://packages.icinga.org/icinga.key
Zur Absicherung der Installation aus den richtigen Quellen, sollte mit nachfolgendem Befehl der GPG-Schlüssel heruntergeladen werden
# wget -P /etc/pki/rpm-gpg http://packages.icinga.org/icinga.key --2015-11-17 10:19:00-- http://packages.icinga.org/icinga.key Resolving packages.icinga.org (packages.icinga.org)... 185.11.254.83 Connecting to packages.icinga.org (packages.icinga.org)|185.11.254.83|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1723 (1.7K) [application/pgp-keys] Saving to: ‘/etc/pki/rpm-gpg/icinga.key’ 100%[======================================>] 1,723 --.-K/s in 0s 2015-11-17 10:19:01 (65.8 MB/s) - ‘/etc/pki/rpm-gpg/icinga.key’ saved [1723/1723]
und anschließend mit nachfolgendem Befehl importiert werden
# rpm --import /etc/pki/rpm-gpg/icinga.key
* Es erfolgt keine Ausgabe, falls der Befehl ohne Fehler ausgeführt wurde!
Anschließend sollten gespeicherte Informationen über die Installationsquellen zurückgesetzt werden, indem nachfolgender Befehl diese Informationen löscht:
# yum clean all Loaded plugins: changelog, priorities Cleaning repos: base epel extras icinga-stable-release updates Cleaning up everything
Eine Überprüfung mit nachfolgendem Befehl, sollte die korrekte Einbindung des Repositorys bestätigen und in etwa eine Ausgabe wie die nachfolgende zur Anzeige bringen:
# yum list icinga2 Loaded plugins: changelog, priorities 121 packages excluded due to repository priority protections Available Packages icinga2.x86_64 2.4.0-1.el7.centos icinga-stable-release
Installation: icinga2
Nachdem das Drittanbieter-Repository
erfolgreich eingebunden wurde, kann mit nachfolgendem Befehl, das rpm
-Pakete - icinga2
installiert werden:
# yum install icinga2 Loaded plugins: changelog, priorities 121 packages excluded due to repository priority protections Resolving Dependencies --> Running transaction check ---> Package icinga2.x86_64 0:2.4.0-1.el7.centos will be installed --> Processing Dependency: icinga2-bin = 2.4.0-1.el7.centos for package: icinga2-2.4.0-1.el7.centos.x86_64 --> Running transaction check ---> Package icinga2-bin.x86_64 0:2.4.0-1.el7.centos will be installed --> Processing Dependency: icinga2-common = 2.4.0-1.el7.centos for package: icinga2-bin-2.4.0-1.el7.centos.x86_64 --> Processing Dependency: libboost_regex-mt.so.1.53.0()(64bit) for package: icinga2-bin-2.4.0-1.el7.centos.x86_64 --> Running transaction check ---> Package boost-regex.x86_64 0:1.53.0-23.el7 will be installed --> Processing Dependency: libicuuc.so.50()(64bit) for package: boost-regex-1.53.0-23.el7.x86_64 --> Processing Dependency: libicui18n.so.50()(64bit) for package: boost-regex-1.53.0-23.el7.x86_64 --> Processing Dependency: libicudata.so.50()(64bit) for package: boost-regex-1.53.0-23.el7.x86_64 ---> Package icinga2-common.x86_64 0:2.4.0-1.el7.centos will be installed --> Running transaction check ---> Package libicu.x86_64 0:50.1.2-11.el7 will be installed --> Finished Dependency Resolution Changes in packages about to be updated: Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: icinga2 x86_64 2.4.0-1.el7.centos icinga-stable-release 9.1 k Installing for dependencies: boost-regex x86_64 1.53.0-23.el7 base 294 k icinga2-bin x86_64 2.4.0-1.el7.centos icinga-stable-release 2.5 M icinga2-common x86_64 2.4.0-1.el7.centos icinga-stable-release 84 k libicu x86_64 50.1.2-11.el7 base 6.9 M Transaction Summary ================================================================================ Install 1 Package (+4 Dependent packages) Total download size: 9.8 M Installed size: 39 M Is this ok [y/d/N]: y Downloading packages: (1/5): icinga2-2.4.0-1.el7.centos.x86_64.rpm | 9.1 kB 00:00 (2/5): icinga2-common-2.4.0-1.el7.centos.x86_64.rpm | 84 kB 00:00 (3/5): icinga2-bin-2.4.0-1.el7.centos.x86_64.rpm | 2.5 MB 00:00 (4/5): boost-regex-1.53.0-23.el7.x86_64.rpm | 294 kB 00:00 (5/5): libicu-50.1.2-11.el7.x86_64.rpm | 6.9 MB 00:00 -------------------------------------------------------------------------------- Total 13 MB/s | 9.8 MB 00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : libicu-50.1.2-11.el7.x86_64 1/5 Installing : boost-regex-1.53.0-23.el7.x86_64 2/5 Installing : icinga2-common-2.4.0-1.el7.centos.x86_64 3/5 Installing : icinga2-bin-2.4.0-1.el7.centos.x86_64 4/5 Installing : icinga2-2.4.0-1.el7.centos.x86_64 5/5 Verifying : icinga2-common-2.4.0-1.el7.centos.x86_64 1/5 Verifying : icinga2-2.4.0-1.el7.centos.x86_64 2/5 Verifying : libicu-50.1.2-11.el7.x86_64 3/5 Verifying : boost-regex-1.53.0-23.el7.x86_64 4/5 Verifying : icinga2-bin-2.4.0-1.el7.centos.x86_64 5/5 Installed: icinga2.x86_64 0:2.4.0-1.el7.centos Dependency Installed: boost-regex.x86_64 0:1.53.0-23.el7 icinga2-bin.x86_64 0:2.4.0-1.el7.centos icinga2-common.x86_64 0:2.4.0-1.el7.centos libicu.x86_64 0:50.1.2-11.el7 Complete!
Mit nachfolgendem Befehl kann überprüft werden, welche Inhalte mit den Paket icinga2
installiert wurden.
# rpm -qil icinga2 Name : icinga2 Version : 2.4.0 Release : 1.el7.centos Architecture: x86_64 Install Date: Tue 17 Nov 2015 11:04:10 AM CET Group : Applications/System Size : 17986 License : GPL-2.0+ Signature : DSA/SHA1, Mon 16 Nov 2015 12:38:53 PM CET, Key ID c6e319c334410682 Source RPM : icinga2-2.4.0-1.el7.centos.src.rpm Build Date : Mon 16 Nov 2015 12:38:42 PM CET Build Host : jenkins-build-5c74b3d4-1936 Relocations : (not relocatable) URL : https://www.icinga.org/ Summary : Network monitoring application Description : Meta package for Icinga 2 Core, DB IDO and Web. /usr/share/doc/icinga2-2.4.0 /usr/share/doc/icinga2-2.4.0/COPYING
Nach der erfolgreichen Installation sind nur einige der Features (Möglichkeiten) von Icinga aktiviert, welche mit nachfolgendem Befehl abfragt werden können und nachfolgende Liste zurück geben sollte:
# icinga2 feature list Disabled features: api command compatlog debuglog gelf graphite icingastatus livestatus opentsdb perfdata statusdata syslog Enabled features: checker mainlog notification
icinga2.service: Dienst/Deamon-Start einrichten
Um das Monitoring-System Icinga, welches als Dienst/Deamon als Hintergrundprozess läuft, auch nach einem Neustart des Servers zur Verfügung zu haben, soll der Dienst/Daemon mit dem Server mit gestartet werden, was mit nachfolgendem Befehl realisiert werden kann:
# systemctl enable icinga2.service ln -s '/usr/lib/systemd/system/icinga2.service' '/etc/systemd/system/multi-user.target.wants/icinga2.service'
Eine Überprüfung, ob beim Neustart des Server der icinga2.service
-Dienst/Deamon wirklich mit gestartet wird, kann mit nachfolgendem Befehl erfolgen und sollte eine Anzeige, wie ebenfalls nachfolgend dargestellt ausgeben:
# systemctl list-unit-files --type=service | grep -e icinga2.service icinga2.service enabled
bzw.
# systemctl is-enabled icinga2.service enabled
Installation: nagios-plugins-(all)
Nachdem das Drittanbieter-Repository
erfolgreich eingebunden wurde, kann mit nachfolgendem Befehl, das rpm
-Pakete - nagios-plugins-all
installiert werden:
# yum install nagios-plugins-all
oder nur die Plugins die auf dem entsprechenden zu überprüfenden Host benötigt werden.
Nachfolgend eine Beispiel für das Plugin nagios-plugins-icmp
# yum install nagios-plugins-icmp