Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung Nächste ÜberarbeitungBeide Seiten der Revision |
centos:web_c7:icinga:director [09.08.2016 16:30. ] – [Benachrichtigungen] django | centos:web_c7:icinga:director [17.09.2016 20:50. ] – [Update] django |
---|
create mode 100644 test/php/library/Director/CustomVariable/CustomVariablesTest.php</code> | create mode 100644 test/php/library/Director/CustomVariable/CustomVariablesTest.php</code> |
| |
Hat sich an der MariaDB etwas geändert muss ein entsprechneder Update der mySQL-Definitionen erfolgen. Hierzu wechseln wir in Module Konfiguration des Icinga-Director und klicken auf den Reiter **Konfiguration**. | Hat sich an der MariaDB etwas geändert muss ein entsprechneder Update der mySQL-Definitionen erfolgen; in der WEB-GUI unseres Icinga 2 Director wir dazu ein entsprechender Hinweis angezeigt. |
| |
FIXME (//Bild einfügen, wenn ein Datenbankupdate nötig ist!//) | {{ :centos:web_c7:icinga:director_083.png?901 |Bild: Update Icinga 2 Director Datenbank Update}} |
| |
| Mit einem Klick auf die Schaltfläche **[ Schema-Migrations-Scripte anwenden ]** starten wir den Aktualisierungsvorgang. Wurden die Aktualisierungen erfolgreich beendet, wird uns dies am unteren Bildschirmrand entsprechend angezeigt. |
| |
| {{ :centos:web_c7:icinga:director_084.png?901 |Bild: Update Icinga 2 Director Datenbank Update}} |
| |
| |
# cd /etc/icinga2/scripts | # cd /etc/icinga2/scripts |
| |
# wget https://raw.githubusercontent.com/sysadmama/misc/master/icinga2/scripts/host-by-mail.sh -Odirector-mail-host-notifications.sh | # wget https://raw.githubusercontent.com/sysadmama/misc/master/icinga2/scripts/host-by-mail.sh -Odirector-mail-host-notification.sh |
| |
# wget https://raw.githubusercontent.com/sysadmama/misc/master/icinga2/scripts/service-by-mail.sh -Odirector-mail-service-notification.sh | # wget https://raw.githubusercontent.com/sysadmama/misc/master/icinga2/scripts/service-by-mail.sh -Odirector-mail-service-notification.sh |
| |
Diese Scripte passen wir nun unserer Monitoring-Umgebung und unseren Anforderungen entsprechend an, damit z.B. später links in der Nachricht auf den richtigen Monitoring Hosts enden. Ebenso beschneiden wir die **Subject/Betreffzeilen** da Nachrichten wenn diese an externe eMail-Adressen versandt werden zwar automatisch mit **[[centos:mail_c7:zeyple|Zeyple]]** verschlüsselt werden, die Headerzeile jedoch weiterhin unverschlüsselt für fremde Augen einsehbar ist. Schließlich geht keinem externen etwas an, welcher unserer Hosts oder Services eine Notification generiert hat. | Diese Scripte passen wir nun unserer Monitoring-Umgebung und unseren Anforderungen entsprechend an, damit z.B. später links in der Nachricht auf den richtigen Monitoring Hosts enden. Ebenso beschneiden wir die **Subject/Betreffzeilen** da Nachrichten wenn diese an externe eMail-Adressen versandt werden zwar automatisch mit **[[centos:mail_c7:zeyple|Zeyple]]** verschlüsselt werden, die Headerzeile jedoch weiterhin unverschlüsselt für fremde Augen einsehbar ist. Schließlich geht keinem externen etwas an, welcher unserer Hosts oder Services eine Notification generiert hat. |
# vim /etc/icinga2/scripts/director-mail-host-notifications.sh | # vim /etc/icinga2/scripts/director-mail-host-notification.sh |
| |
<file bash director-mail-host-notifications.sh>#!/bin/bash | <file bash director-mail-host-notifications.sh>#!/bin/bash |
</file> | </file> |
| |
# vim /etc/icinga2/scripts/director-mail-host-notifications.sh | # vim /etc/icinga2/scripts/director-mail-host-notification.sh |
| |
<file bash director-mail-service-notification.sh>#!/bin/bash | <file bash director-mail-service-notification.sh>#!/bin/bash |
Beim **Kommandotyp** wählen wir dabei aus dem **drop down** Menü die Option **//Notification Plugin Command//** aus und geben beim **Kommando** den vollen Pfad und den Namen des jeweiligen bash-Scriptes an. | Beim **Kommandotyp** wählen wir dabei aus dem **drop down** Menü die Option **//Notification Plugin Command//** aus und geben beim **Kommando** den vollen Pfad und den Namen des jeweiligen bash-Scriptes an. |
| |
{{ :centos:web_c7:icinga:director_064.png?direct&900 |Bild: Bildschirmhardcopy - Icinga 2 Director Anlegen eines neuen Kommandos Notification}} | {{ :centos:web_c7:icinga:director_064.png?direct&901 |Bild: Bildschirmhardcopy - Icinga 2 Director Anlegen eines neuen Kommandos Notification}} |
| |
Auf dem Reiter **Argumente** definieren wir nun noch die im Bash-Script von **[[https://www.spiller.me/|Marianne M. Spiller]]** definierten Optionen. | Auf dem Reiter **Argumente** definieren wir nun noch die im Bash-Script von **[[https://www.spiller.me/|Marianne M. Spiller]]** definierten Optionen. |
| |
{{ :centos:web_c7:icinga:director_065.png?direct&900 |Bild: Bildschirmhardcopy - Icinga 2 Director Anlegen eines neuen Kommandos Notification}} | {{ :centos:web_c7:icinga:director_065.png?direct&901 |Bild: Bildschirmhardcopy - Icinga 2 Director Anlegen eines neuen Kommandos Notification}} |
| |
Dank der //**icinga runtime macros**// werden dann zur Laufzeit jeweils die gewünschten Werte übertragen. Der Option **-a** im Bash-Script wird so z.B. über das //**runtime macro**// **$address$** die jeweilige IP-Adresse übermittelt. | Dank der //**icinga runtime macros**// werden dann zur Laufzeit jeweils die gewünschten Werte übertragen. Der Option **-a** im Bash-Script wird so z.B. über das //**runtime macro**// **$address$** die jeweilige IP-Adresse übermittelt. |
{{ :centos:web_c7:icinga:director_067.png?direct&900 |Bild: Bildschirmhardcopy - Icinga 2 Director Anlegen eines neuen Kommandos Notification}} | {{ :centos:web_c7:icinga:director_067.png?direct&900 |Bild: Bildschirmhardcopy - Icinga 2 Director Anlegen eines neuen Kommandos Notification}} |
| |
Die vollständige //**zones.d/director-global/commands.con**// Definition hat also folgenden Inhalt. | Die vollständige //**zones.d/director-global/commands.conf**// Definition hat also folgenden Inhalt. |
<code>object NotificationCommand "10_director-mail-host-notification" { | <code>object NotificationCommand "10_director-mail-host-notification" { |
execute = PluginNotification | execute = PluginNotification |
command = [ | command = [ |
"/etc/icinga2/scripts/director-mail-host-notifications.sh" | "/etc/icinga2/scripts/director-mail-host-notification.sh" |
] | ] |
arguments = { | arguments = { |
Wie beim Kommando für die Host-Notifications werden wir nun auch noch ein Kommando für die Service-Notifications anlegen. | Wie beim Kommando für die Host-Notifications werden wir nun auch noch ein Kommando für die Service-Notifications anlegen. |
| |
{{ :centos:web_c7:icinga:director_068.png?direct&900 |Bild: Bildschirmhardcopy - Icinga 2 Director Anlegen eines neuen Kommandos Notification}} | {{ :centos:web_c7:icinga:director_068.png?direct&898 |Bild: Bildschirmhardcopy - Icinga 2 Director Anlegen eines neuen Kommandos Notification}} |
| |
Auch hier legen wir dann für jede Option aus dem Bash-Script ein zugehöriges Argument an, damit die benötigten Daten zur Laufzeit dem Script übergeben werden können. | Auch hier legen wir dann für jede Option aus dem Bash-Script ein zugehöriges Argument an, damit die benötigten Daten zur Laufzeit dem Script übergeben werden können. |
| |
{{ :centos:web_c7:icinga:director_070.png?direct&900 |Bild: Bildschirmhardcopy - Icinga 2 Director Anlegen eines neuen Kommandos Notification}} | {{ :centos:web_c7:icinga:director_070.png?direct&899 |Bild: Bildschirmhardcopy - Icinga 2 Director Anlegen eines neuen Kommandos Notification}} |
| |
Die vollständige //**zones.d/director-global/commands.con**// Definition hat also folgenden Inhalt | Die vollständige //**zones.d/director-global/commands.conf**// Definition hat also folgenden Inhalt |
| |
<code>object NotificationCommand "10_director-mail-service-notification" { | <code>object NotificationCommand "10_director-mail-service-notification" { |
execute = PluginNotification | execute = PluginNotification |
command = [ | command = [ |
"/etc/icinga2/scripts/director-mail-service-notifications.sh" | "/etc/icinga2/scripts/director-mail-service-notification.sh" |
] | ] |
arguments = { | arguments = { |
| |
~~DISCUSSION~~ | ~~DISCUSSION~~ |
| ~~AUTOTWEET:~~ |