Benutzer-Werkzeuge

Webseiten-Werkzeuge


tachtler:icinga2_-_director

Dies ist eine alte Version des Dokuments!


Icinga2 - Director

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.

Zur Einbindung von Icinga Director in Icinga, wird ein Modul namens

  • icingaweb2-module-director

benötigt.

Beschreibung Externer Link
Download https://github.com/Icinga/icingaweb2-module-director

Icinga Director ist eine grafische Möglichkeit die Konfiguration innerhalb von Icinga selbst durchzuführen. Hier werden durch die „restful API“ und über ein Web-Interface bzw. eine Web-Anwendung zur die Konfigurationsdateien verwaltet und auch auf die zu überwachenden Server übertragen.

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 sind folgende Komponenten erforderlich:

Vorbereitung

:!: WICHTIG - Nachfolgende Installation zeigt den Umstieg von einer Datei basierten Konfiguration von Icinga auf eine Konfiguration durch den Icinga Director!!!

Bevor mit der Installation und auch des Icinga Director begonnen werden soll, soll hier die Konfiguration von Icinga komplett zurück auf en Ursprungszustand durchgeführt werden.

Dazu sind nachfolgende Schritte notwendig!

Icinga stoppen

Nachfolgender Befehl stoppt den Icinga-Dienst/Daemon:

 # systemctl stop icinga2.service

Datenlöschung

Anschließend sollen nachfolgende Verzeichisse mit nachfolgenden Befehlen geleert werden:

 # rm /var/lib/icinga2/* -f
 # rm /var/lib/icinga2/api/zones/* -rf
 # rm /var/lib/icinga2/api/repository/* -f
 # rm /var/lib/icinga2/api/packages/* -rf
 # rm /var/lib/icinga2/api/log/* -f
 # rm /var/lib/icinga2/repository/* -f
 # rm /var/lib/icinga2/ca/* -f

und

# rm /var/cache/icinga2/* -f

und entfernen der berreist erzeugten Zertifikate:

# rm /etc/icinga2/pki/* -f

Konfigurationssicherung

Mit nachfolgenden Befehl kann die bisher durchgeführte Konfiguration gesichert werden:

# tar czfv icinga2-config-backup.tar.gz /etc/icinga2 -C /root
...

/etc/icinga2/zones.conf

Nachfolgender Inhalt solltein der Konfigurationsdatei /etc/icinga2/zones.conf stehen, falls nicht kann dieser auf nachfolgenden Inhalt zurückgesetzt werden:

/*
 * Endpoint and Zone configuration for a cluster setup
 * This local example requires `NodeName` defined in
 * constants.conf.
 */
 
object Endpoint NodeName {
  host = NodeName
}
 
object Zone ZoneName {
  endpoints = [ NodeName ]
}
 
/*
 * Defines a global zone containing templates,
 * etc. synced to all nodes, if they accept
 * configuration. All remote nodes need
 * this zone configured too.
 */
 
/*
object Zone "global-templates" {
  global = true
}
*/
 
/*
 * Read the documentation on how to configure
 * a cluster setup with multiple zones.
 */
 
/*
object Endpoint "master.example.org" {
  host = "master.example.org"
}
 
object Endpoint "satellite.example.org" {
  host = "satellite.example.org"
}
 
object Zone "master" {
  endpoints = [ "master.example.org" ]
}
 
object Zone "satellite" {
  parent = "master"
  endpoints = [ "satellite.example.org" ]
}
*/

/etc/icinga2/constants.conf

Nachfolgender Inhalt solltein der Konfigurationsdatei /etc/icinga2/constants.conf stehen, falls nicht kann dieser auf nachfolgenden Inhalt zurückgesetzt werden:

/**
 * This file defines global constants which can be used in
 * the other configuration files.
 */
 
/* The directory which contains the plugins from the Monitoring Plugins project. */
const PluginDir = "/usr/lib64/nagios/plugins"
 
/* The directory which contains the Manubulon plugins.
 * Check the documentation, chapter "SNMP Manubulon Plugin Check Commands", for details.
 */
const ManubulonPluginDir = "/usr/lib64/nagios/plugins"
 
/* The directory which you use to store additional plugins which ITL provides user contributed command definitions for.
 * Check the documentation, chapter "Plugins Contribution", for details.
 */
const PluginContribDir = "/usr/lib64/nagios/plugins"
 
/* Our local instance name. By default this is the server's hostname as returned by `hostname --fqdn`.
 * This should be the common name from the API certificate.
 */
//const NodeName = "localhost"
 
/* Our local zone name. */
const ZoneName = NodeName
 
/* Secret key for remote node tickets */
const TicketSalt = ""

/etc/icinga2/icinga2.conf

Nachfolgender Inhalt solltein der Konfigurationsdatei /etc/icinga2/icinga2.conf stehen, falls nicht kann dieser auf nachfolgenden Inhalt zurückgesetzt werden:

/**
 * Icinga 2 configuration file
 * - this is where you define settings for the Icinga application including
 * which hosts/services to check.
 *
 * For an overview of all available configuration options please refer
 * to the documentation that is distributed as part of Icinga 2.
 */
 
/**
 * The constants.conf defines global constants.
 */
include "constants.conf"
 
/**
 * The zones.conf defines zones for a cluster setup.
 * Not required for single instance setups.
 */
include "zones.conf"
 
/**
 * The Icinga Template Library (ITL) provides a number of useful templates
 * and command definitions.
 * Common monitoring plugin command definitions are included separately.
 */
include <itl>
include <plugins>
include <plugins-contrib>
include <manubulon>
 
/**
 * This includes the Icinga 2 Windows plugins. These command definitions
 * are required on a master node when a client is used as command endpoint.
 */
include <windows-plugins>
 
/**
 * This includes the NSClient++ check commands. These command definitions
 * are required on a master node when a client is used as command endpoint.
 */
include <nscp>
 
/**
 * The features-available directory contains a number of configuration
 * files for features which can be enabled and disabled using the
 * icinga2 feature enable / icinga2 feature disable CLI commands.
 * These commands work by creating and removing symbolic links in
 * the features-enabled directory.
 */
include "features-enabled/*.conf"
 
/**
 * The repository.d directory contains all configuration objects
 * managed by the 'icinga2 repository' CLI commands.
 */
include_recursive "repository.d"
 
/**
 * Although in theory you could define all your objects in this file
 * the preferred way is to create separate directories and files in the conf.d
 * directory. Each of these files must have the file extension ".conf".
 */
include_recursive "conf.d"

API-Feature dekativieren

Nachfolgender Befehl dekativiert vorübergehend das API Feature, da sonst nicht gestartet werdeb kann:

# icinga2 feature disable api

Eine Überprüfung, ob dies erfolgreich durchgeführt wurde, kann mit nachfolgendem Befehl durchgeführt werden:

# icinga2 feature list
Disabled features: api debuglog gelf influxdb livestatus opentsdb perfdata syslog
Enabled features: checker command compatlog graphite ido-mysql mainlog notification statusdata

Icinga starten

Nachfolgender Befehl startet den Icinga-Dienst/Daemon:

 # systemctl start icinga2.service

Herunterladen

icingaweb2-module-director

Mit nachfolgendem Befehl kann direkt von GitHub eine gepackte Datei als Archiv direkt in das temporäre Verzeichnis /tmp heruntergeladen werden:

# wget -P /tmp https://github.com/Icinga/icingaweb2-module-director/archive/master.zip
--2016-09-23 12:12:01--  https://github.com/Icinga/icingaweb2-module-director/archive/master.zip
Resolving github.com (github.com)... 192.30.253.113
Connecting to github.com (github.com)|192.30.253.113|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/Icinga/icingaweb2-module-director/zip/master [following]
--2016-09-23 12:12:02--  https://codeload.github.com/Icinga/icingaweb2-module-director/zip/master
Resolving codeload.github.com (codeload.github.com)... 192.30.253.120
Connecting to codeload.github.com (codeload.github.com)|192.30.253.120|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1578803 (1.5M) [application/zip]
Saving to: ‘/tmp/master.zip’

100%[======================================>] 1,578,803   1.05MB/s   in 1.4s   

2016-09-23 12:12:04 (1.05 MB/s) - ‘/tmp/master.zip’ saved [1578803/1578803]

Installation

icingaweb2-module-director

Mit nachfolgendem Befehl kann die zuvor, wie unter nachfolgendem internen Link beschrieben

heruntergeladene Datei, in das Zielverzeichnis

  • /usr/share/icingaweb2/modules

entpackt werden:

# unzip /tmp/master.zip -d /usr/share/icingaweb2/modules

Abschließend muss nun noch das durch das entpacken neu entstandene Verzeichnis mit nachfolgendem Befehl umbenannt werden:

# mv /usr/share/icingaweb2/modules/icingaweb2-module-director-master /usr/share/icingaweb2/modules/director

Icinga neu starten

Nachfolgender Befehl startet den Icinga-Dienst/Daemon neu:

 # systemctl restart icinga2.service

Grund-Konfiguration

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
tachtler/icinga2_-_director.1474628876.txt.gz · Zuletzt geändert: 2016/09/23 13:07 von klaus