Dies ist eine alte Version des Dokuments!


Artikel ist g'rad' in der Bearbeitung!

IT Infrastruktur und System Monitoring mit Icinga 2 unter CentOS 7.x

Bild: ICINGA Logo Mit Icinga kann man sehr leicht und einfach umfangreiche und komplexe IT-Infrastrukturen und Dienste überwachen. Icinga bietet umfassende Überwachungs- und Alarmfunktionen für Server, Switches, Anwendungen und Dienste, so dass also Störungen im Betrieb frühestmöglich erkannt und Abhilfe geschaffen werden kann. Icinga wurde im Mai 2009 von einer Gruppe von Nagios-Entwicklern als ein Fork von Nagios ins Leben gerufen und seit dem rasant weiterentwickelt.

Tiefergehende Informationen zu Icinga selbst findet man auf der Icinga 2 - Features Seite im WWW. Eine detaillierte Installations- und Konfigurationsbeschreibung, die bei der Erstellung dieser Installationsdokumentation wertvolle Hilfe geleistet hat, ist dort ebenfalls zu finden!

Die Installation von ICINGA selbst gestaltet sich relativ einfach, da die Entwickler unter anderem für CentOS 7 ein eigenes Repository vorgehalten wird.

Als Vorbereitung vor der Installation von icinga2 müssen wir erst einmal das benötigte Repository einbinden. Hierzu holen wir uns die Konfigurationsdatei erst einmal auf unseren Server.

 # wget http://packages.icinga.org/epel/ICINGA-release.repo -O /etc/yum.repos.d/ICINGA-release.repo

Anschließend tragen wir noch die Priorität in der Konfigurationsdatei nach; in unserer Installationsumgebung wählen wir dazu einen nachrangigen wert, z.B. 15

 # vim /etc/yum.repos.d/ICINGA-release.repo
/etc/yum.repos.d/ICINGA-release.repo
[icinga-stable-release]
name=ICINGA (stable release for epel)
baseurl=http://packages.icinga.org/epel/$releasever/release/
enabled=1
# Django : 2015-03-07 Priorität 15 nachgetragen
# default: unset
priority=15
gpgcheck=1
gpgkey=http://packages.icinga.org/icinga.key

Anschließend weisen wir yum an, alle Metadaten des neuen Repositorys zu laden.

 # yum makecache

Zu guter Letzt holen wir uns noch den PGP-Schlüssel des ICINGA-Repositorys, damit später bei der Installation der einzelnen Pakete diese überprüft werden können.

 # rpm --import http://packages.icinga.org/icinga.key

Nachdem die Vorbereitungen abgeschlossen sind, können wir nun mit der Installation von ICINGA2 starten, indem wir den Befehl yum bemühen.

 # yum install icinga2 -y

Neben dem Paket icinga2, werden auch noch die Pakete icinga2-common und icinga2-bin installiert.

Welche Verzeichnisse und Dateien das Paket installierte, erfahren wir mit dem nachfolgendem Aufruf.

 # rpm -qil icinga2
Name        : icinga2
Version     : 2.3.2
Release     : 1.el7.centos
Architecture: x86_64
Install Date: Fri 13 Mar 2015 08:44:31 AM CET
Group       : Applications/System
Size        : 17986
License     : GPL-2.0+
Signature   : DSA/SHA1, Thu 12 Mar 2015 04:17:20 PM CET, Key ID c6e319c334410682
Source RPM  : icinga2-2.3.2-1.el7.centos.src.rpm
Build Date  : Thu 12 Mar 2015 04:17:05 PM CET
Build Host  : jenkins-build-5c74b3d4-776
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.3.2

Wie schon zuvor prüfen wir, welchen Inhalt das RPM mitbrachte.

 # rpm -qil icinga2-common
Name        : icinga2-common               
Version     : 2.3.2                        
Release     : 1.el7.centos                 
Architecture: x86_64                       
Install Date: Fri 13 Mar 2015 08:44:29 AM CET
Group       : Applications/System            
Size        : 188359                         
License     : GPL-2.0+                       
Signature   : DSA/SHA1, Thu 12 Mar 2015 04:17:20 PM CET, Key ID c6e319c334410682
Source RPM  : icinga2-2.3.2-1.el7.centos.src.rpm                                
Build Date  : Thu 12 Mar 2015 04:17:05 PM CET                                   
Build Host  : jenkins-build-5c74b3d4-776                                        
Relocations : (not relocatable)                                                 
URL         : https://www.icinga.org/                                           
Summary     : Common Icinga 2 configuration                                     
Description :                                                                   
Provides common directories, uid and gid among Icinga 2 related                 
packages.                                                                       
/etc/bash_completion.d/icinga2                                                  
/etc/icinga2                                                                    
/etc/icinga2/conf.d                                                             
/etc/icinga2/conf.d/commands.conf                                               
/etc/icinga2/conf.d/downtimes.conf                                              
/etc/icinga2/conf.d/groups.conf                                                 
/etc/icinga2/conf.d/hosts.conf                                                  
/etc/icinga2/conf.d/notifications.conf                                          
/etc/icinga2/conf.d/satellite.conf                                              
/etc/icinga2/conf.d/services.conf                                               
/etc/icinga2/conf.d/templates.conf                                              
/etc/icinga2/conf.d/timeperiods.conf                                            
/etc/icinga2/conf.d/users.conf                                                  
/etc/icinga2/constants.conf                                                     
/etc/icinga2/features-available                                                 
/etc/icinga2/features-available/api.conf                                        
/etc/icinga2/features-available/checker.conf                                    
/etc/icinga2/features-available/command.conf                                    
/etc/icinga2/features-available/compatlog.conf                                  
/etc/icinga2/features-available/debuglog.conf                                   
/etc/icinga2/features-available/gelf.conf                                       
/etc/icinga2/features-available/graphite.conf                                   
/etc/icinga2/features-available/icingastatus.conf                               
/etc/icinga2/features-available/livestatus.conf                                 
/etc/icinga2/features-available/mainlog.conf                                    
/etc/icinga2/features-available/notification.conf                               
/etc/icinga2/features-available/opentsdb.conf                                   
/etc/icinga2/features-available/perfdata.conf                                   
/etc/icinga2/features-available/statusdata.conf
/etc/icinga2/features-available/syslog.conf
/etc/icinga2/features-enabled
/etc/icinga2/icinga2.conf
/etc/icinga2/init.conf
/etc/icinga2/repository.d
/etc/icinga2/repository.d/README
/etc/icinga2/scripts
/etc/icinga2/scripts/mail-host-notification.sh
/etc/icinga2/scripts/mail-service-notification.sh
/etc/icinga2/zones.conf
/etc/icinga2/zones.d
/etc/icinga2/zones.d/README
/etc/logrotate.d/icinga2
/etc/sysconfig/icinga2
/usr/lib/icinga2
/usr/lib/icinga2/prepare-dirs
/usr/lib/icinga2/safe-reload
/usr/lib/systemd/system/icinga2.service
/usr/share/doc/icinga2-common-2.3.2
/usr/share/doc/icinga2-common-2.3.2/AUTHORS
/usr/share/doc/icinga2-common-2.3.2/COPYING
/usr/share/doc/icinga2-common-2.3.2/COPYING.Exceptions
/usr/share/doc/icinga2-common-2.3.2/ChangeLog
/usr/share/doc/icinga2-common-2.3.2/NEWS
/usr/share/doc/icinga2-common-2.3.2/README.md
/usr/share/doc/icinga2-common-2.3.2/syntax
/usr/share/doc/icinga2-common-2.3.2/syntax/README
/usr/share/doc/icinga2-common-2.3.2/syntax/nano
/usr/share/doc/icinga2-common-2.3.2/syntax/nano/README
/usr/share/doc/icinga2-common-2.3.2/syntax/nano/icinga2.nanorc
/usr/share/doc/icinga2-common-2.3.2/syntax/vim
/usr/share/doc/icinga2-common-2.3.2/syntax/vim/README
/usr/share/doc/icinga2-common-2.3.2/syntax/vim/ftdetect
/usr/share/doc/icinga2-common-2.3.2/syntax/vim/ftdetect/icinga2.vim
/usr/share/doc/icinga2-common-2.3.2/syntax/vim/syntax
/usr/share/doc/icinga2-common-2.3.2/syntax/vim/syntax/icinga2.vim
/usr/share/icinga2/include
/usr/share/icinga2/include/command-icinga.conf
/usr/share/icinga2/include/command-nscp-local.conf
/usr/share/icinga2/include/command-plugins-manubulon.conf
/usr/share/icinga2/include/command-plugins.conf
/usr/share/icinga2/include/command.conf
/usr/share/icinga2/include/hangman
/usr/share/icinga2/include/itl
/usr/share/icinga2/include/manubulon
/usr/share/icinga2/include/nscp
/usr/share/icinga2/include/plugins
/usr/share/icinga2/include/plugins-contrib
/usr/share/icinga2/include/plugins-contrib.d
/usr/share/icinga2/include/plugins-contrib.d/ipmi.conf
/usr/share/icinga2/include/plugins-contrib.d/network-components.conf
/usr/share/icinga2/include/plugins-contrib.d/operating-system.conf
/usr/share/icinga2/include/plugins-contrib.d/virtualization.conf
/usr/share/icinga2/include/plugins-contrib.d/vmware.conf
/usr/share/icinga2/include/timeperiod.conf
/var/log/icinga2
/var/spool/icinga2
/var/spool/icinga2/perfdata
/var/spool/icinga2/tmp

Zum Schluß werfen wir dann noch einen Blick in das Paket icinga2-bin.

 # rpm -qil icinga2-bin
Name        : icinga2-bin
Version     : 2.3.2
Release     : 1.el7.centos
Architecture: x86_64
Install Date: Fri 13 Mar 2015 08:44:30 AM CET
Group       : Applications/System
Size        : 11691943
License     : GPL-2.0+
Signature   : DSA/SHA1, Thu 12 Mar 2015 04:17:20 PM CET, Key ID c6e319c334410682
Source RPM  : icinga2-2.3.2-1.el7.centos.src.rpm
Build Date  : Thu 12 Mar 2015 04:17:05 PM CET
Build Host  : jenkins-build-5c74b3d4-776
Relocations : (not relocatable)
URL         : https://www.icinga.org/
Summary     : Icinga 2 binaries and libraries
Description :
Icinga 2 is a general-purpose network monitoring application.
Provides binaries and libraries for Icinga 2 Core.
/usr/lib64/icinga2
/usr/lib64/icinga2/libbase.so
/usr/lib64/icinga2/libchecker.so
/usr/lib64/icinga2/libcli.so
/usr/lib64/icinga2/libcompat.so
/usr/lib64/icinga2/libconfig.so
/usr/lib64/icinga2/libdb_ido.so
/usr/lib64/icinga2/libexecvpe.so
/usr/lib64/icinga2/libicinga.so
/usr/lib64/icinga2/liblivestatus.so
/usr/lib64/icinga2/libmethods.so
/usr/lib64/icinga2/libmmatch.so
/usr/lib64/icinga2/libnotification.so
/usr/lib64/icinga2/libperfdata.so
/usr/lib64/icinga2/libremote.so
/usr/lib64/icinga2/libsocketpair.so
/usr/lib64/icinga2/libyajl.so
/usr/lib64/icinga2/libyajl.so.2
/usr/lib64/icinga2/libyajl.so.2.1.0
/usr/sbin/icinga2
/usr/share/doc/icinga2-bin-2.3.2
/usr/share/doc/icinga2-bin-2.3.2/AUTHORS
/usr/share/doc/icinga2-bin-2.3.2/COPYING
/usr/share/doc/icinga2-bin-2.3.2/COPYING.Exceptions
/usr/share/doc/icinga2-bin-2.3.2/ChangeLog
/usr/share/doc/icinga2-bin-2.3.2/NEWS
/usr/share/doc/icinga2-bin-2.3.2/README.md
/usr/share/icinga2
/usr/share/man/man8/icinga2.8.gz
/var/cache/icinga2
/var/lib/icinga2
/var/lib/icinga2/api
/var/lib/icinga2/api/log
/var/lib/icinga2/api/repository
/var/lib/icinga2/api/zones
/var/log/icinga2
/var/log/icinga2/compat
/var/log/icinga2/compat/archives
/var/log/icinga2/crash
/var/run/icinga2
/var/run/icinga2/cmd

Nun können wir den Icinga2-Daemon das erste mal starten.

 # systemctl start icinga2.service

Im Syslog wird der Start entsprechend dokumentiert.

 # less /var/log/messages
Mar 12 10:09:42 vml000117 systemd: Starting Icinga host/service/network monitoring system...
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/cli: Icinga application loader (version: v2.3.0)
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/cli: Loading application type: icinga/IcingaApplication
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/Utility: Loading library 'libicinga.so'
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/icinga2.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/constants.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/zones.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/itl
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/plugins
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/checker.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/mainlog.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/features-enabled/notification.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/commands.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/downtimes.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/groups.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/hosts.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/notifications.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/satellite.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/services.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/templates.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/timeperiods.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /etc/icinga2/conf.d/users.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/Utility: Loading library 'libchecker.so'
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/Utility: Loading library 'libnotification.so'
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/command.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/command-icinga.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/timeperiod.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigCompiler: Compiling config file: /usr/share/icinga2/include/command-plugins.conf
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/Utility: Loading library 'libmethods.so'
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigItem: Committing config items
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] warning/ApplyRule: Apply rule 'satellite-host' (in /etc/icinga2/conf.d/satellite.conf: 29:1-29:41) for type 'Dependency' does not match anywhere!
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigItem: Checked 1 Endpoint(s).
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigItem: Checked 1 Zone(s).
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigItem: Checked 45 CheckCommand(s).
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigItem: Checked 2 NotificationCommand(s).
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigItem: Checked 3 TimePeriod(s).
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigItem: Checked 1 CheckerComponent(s).
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigItem: Checked 1 FileLogger(s).
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigItem: Checked 1 NotificationComponent(s).
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigItem: Checked 2 HostGroup(s).
Mar 12 10:09:42 vml000117 icinga2: [2015-03-12 10:09:42 +0100] information/ConfigItem: Checked 3 ServiceGroup(s).
Mar 12 10:09:42 vml000117 systemd: Started Icinga host/service/network monitoring system.

Wollen wir den Daemon beim Hochfahren des Systems automatisch starten, greifen wir auf den Befehl systemctl zurück.

 # systemctl enable icinga2.service
 # ln -s '/usr/lib/systemd/system/icinga2.service' '/etc/systemd/system/multi-user.target.wants/icinga2.service'
 

Möchten wir uns vergewissern, ob der Daemon beim Systemstart gestartet wird oder nicht, erfahren wir ebenfalls mit dem Befehl systemctl.

 # systemctl is-enabled icinga2.service
 enabled

Startet der Server nicht automatisch, wird uns ein „disabled“ zurückgemeldet.

Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information
  • centos/web_c7/icinga/start.1426257370.txt.gz
  • Zuletzt geändert: 13.03.2015 14:36.
  • von django