Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
centos:web_c7:icinga:config_1 [09.04.2015 13:30. ] – [Master Node] djangocentos:web_c7:icinga:config_1 [20.04.2018 10:36. ] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 6: Zeile 6:
  
 Bei der Anbindung und Überwachung von Remote-Clients stehen uns folgende Varianten zur Verfügung: Bei der Anbindung und Überwachung von Remote-Clients stehen uns folgende Varianten zur Verfügung:
-  - **Bridging**: \\ Die zu überwachenden Hosts haben keinerlei lokal vorgehaltene Konfigurationsbestandteile. Der Master-Node (Icinga 2 Monitoring-Host) baut zu den Clients eine Verbindung auf und übermittelt die zu testenden Befehle und nimmt die Rückgabewerte über diese Verbindung auch entgegen. Im Grunde kann man hier von einem automatisierten gescripteten Überwachungsfunktionen via **SSH**((**S**ecure **SH**ell)) sprechen. +  - **[[centos:web_c7:icinga:config_1?&#bridging|Bridging]]**: 
-  - **Slave zu Master**: \\ Hier sind alle Services und Checks lokal auf den jeweiligen Hosts konfiguriert. Die Clients senden bei dieser Ankoppelungsvariante die Daten zum Master-Node, dem Monitoring-Server. +    - **[[centos:web_c7:nagios1#definition_nrpe|NRPE]]**: \\ Ähnlich wie beim Monitoring-Projekt **[[centos:web_c7:nagios1|Nagios]]** kann auch **[[centos:web_c7:icinga:start|Icinga 2]]** auf dem zu überwachenden Host Checks mit Hilfe des **[[http://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details|NRPE]]**((**N**agios**R**emote**P**lugin**E**xecutor)) anstoßen und die Monitoring-Ergebnisse entgegen nehmen und aufbereiten. Bei dieser Anbindungsvariante werden auf dem entfernten System, sowohl die Checks konfiguriert wie auch die Schwellwerte für die spätere Auswertung und ggf. Alamierung definiert. 
-  - **Master zu Slaves**: \\ Hier werden alle Konfigurationen auf dem Monitoring-Host (Icinga 2 Master) definiert und zu den betreffenden Clients übertragen. Man nennt diese Variante auch //**Cluster Configuration Synchroinistion**//.+    - **[[centos:ssh-install|SSH]]**: FIXME //[[centos:web_c7:icinga:config_1#ssh|SSH]]// FIXME 
 +    - **[[centos:web_c7:icinga:config_1?&#bridging|Icinga Client]]** \\ Die zu überwachenden Hosts haben keinerlei lokal vorgehaltene Konfigurationsbestandteile. Der Master-Node (Icinga 2 Monitoring-Host) baut zu den Clients eine Verbindung auf und übermittelt die zu testenden Befehle und nimmt die Rückgabewerte über diese Verbindung auch entgegen. Im Grunde kann man hier von einem automatisierten gescripteten Überwachungsfunktionen via **SSH**((**S**ecure **SH**ell)) sprechen. 
 +  - **[[centos:web_c7:icinga:config_1#slave_zu_master|Slave zu Master]]**: \\ Hier sind alle Services und Checks lokal auf den jeweiligen Hosts konfiguriert. Die Clients senden bei dieser Ankoppelungsvariante die Daten zum Master-Node, dem Monitoring-Server. 
 +  - **[[centos:web_c7:icinga:config_1#master_zu_slaves|Master zu Slaves]]**: \\ Hier werden alle Konfigurationen auf dem Monitoring-Host (Icinga 2 Master) definiert und zu den betreffenden Clients übertragen. Man nennt diese Variante auch //**Cluster Configuration Synchroinistion**//.
  
-===== Konfiguration =====+===== Konfiguration (Client/Server-Kommunikation) =====
 ==== Paketfilter/Firewall  ==== ==== Paketfilter/Firewall  ====
 Bei den beiden Varianten **Slave zu Master** sowie **Master zu Slaves** erfolgt die Kommunikation über TCP/Port **5665**. Die Kommunikation kann dabei sowohl vom Client/Slave zum Server/Maste erfolgen oder umgekehrt. Die Kommunikationsverbindung kann also bidirektional erfolgen; derjenige Host, der die Verbindung zu erst aufbaut, hat dan gewonnen. Somit werden wir diese Kommunikationsbeziehungen bei unseren Hosts entsprechend berücksichtigen. Bei den beiden Varianten **Slave zu Master** sowie **Master zu Slaves** erfolgt die Kommunikation über TCP/Port **5665**. Die Kommunikation kann dabei sowohl vom Client/Slave zum Server/Maste erfolgen oder umgekehrt. Die Kommunikationsverbindung kann also bidirektional erfolgen; derjenige Host, der die Verbindung zu erst aufbaut, hat dan gewonnen. Somit werden wir diese Kommunikationsbeziehungen bei unseren Hosts entsprechend berücksichtigen.
Zeile 62: Zeile 65:
   * Definition und Sichern des **NodeName**s und des **TicketSalt**s in der Konfigurationsdatei **/etc/icinga2/constants.conf**.   * Definition und Sichern des **NodeName**s und des **TicketSalt**s in der Konfigurationsdatei **/etc/icinga2/constants.conf**.
  
 +Da wir den Master-Node einrichten wollen, beantworten wir die erste Frage mit einem **n**!
    # icinga2 node wizard    # icinga2 node wizard
  
Zeile 104: Zeile 108:
  
 Die Kontrolle der Daten können wir z.B. mit folgendem Aufruf vornehmen. Die Kontrolle der Daten können wir z.B. mit folgendem Aufruf vornehmen.
-      # egrep 'NodeName|TicketSalt' /etc/icinga2/constants.conf+   # egrep 'NodeName|TicketSalt' /etc/icinga2/constants.conf
 <html><pre class="code"> <html><pre class="code">
 <font style="color: rgb(0, 0, 0)">const </font><font style="color: rgb(255, 54, 54)"><b>NodeName</b></font><font style="color: rgb(0, 0, 0)"> = "vml000117.dmz.nausch.org" <font style="color: rgb(0, 0, 0)">const </font><font style="color: rgb(255, 54, 54)"><b>NodeName</b></font><font style="color: rgb(0, 0, 0)"> = "vml000117.dmz.nausch.org"
Zeile 143: Zeile 147:
 const TicketSalt = "7140867f9d69de17141272294f1459f143" const TicketSalt = "7140867f9d69de17141272294f1459f143"
 </file> </file>
 +
 +Die Definition der Zone erfolgt über die gleichnamige Zonendatei.
 +   # vim /etc/icinga2/zones.conf
 +
 +<file c++ /etc/icinga2/zones.conf>/*
 + * Generated by Icinga 2 node setup commands
 + * on 2015-03-25 12:03:28 +0100
 + */
 +
 +object Endpoint "vml000117.dmz.nausch.org" {
 +}
 +
 +object Zone "master" {
 +        //this is the local node master named  = "master"
 +        endpoints = [ "vml000117.dmz.nausch.org" ]
 +}
 +
 +</file>
 +
 +Haben wir die Konfiguration unseren Vorstellungen nach angepasst steht der Aktivierung nichts mehr entgegen; hierzu führen wir einen Reload des Daemon durch.
 +   # systemctl reload icinga2
 +
 +Sofern die zu überwachenden Clients den Icinga-Master-Node direkt erreichen können und wir das **CSR auto-signing** Feature nutzen wollen, können wir die benötigten Tickets für die bereits bekannten **FQDN**s der Clients generieren.
 +Für unsere beiden Hosts generieren wir nun die benötigten Ticket-Nummern.
 +   # icinga2 pki ticket --cn vml000087.dmz.nausch.org
 +
 +   0ede0943e8d13771ee0814067cb3ce2f1412bde8
 +
 +   # icinga2 pki ticket --cn vml000097.dmz.nausch.org
 +
 +   0fdf0943e8d13771ee1412727cb3ce2f1408bdf8
 +
 +==== Client Node  ====
 +Nach der Konfiguration unseres Icinga 2 Master Nodes werden wir in diesem Abschnitt mit der Konfiguration der **Icinga 2 Client-Nodes** befassen. 
 +
 +Die Konfiguration des Clients selbst mit seinen Checks nehmen wir wie gewohnt vor. Was wir auf den Clients nicht installieren und konfigurieren brauchen, sind Funktionen wie z.B. **DB IDO** oder **Livestatus**. 
 +   # yum install icinga2 icinga2-bin icinga2-common -y
 +
 +Sofern die zu überwachenden Clients den Icinga-Master-Node direkt erreichen, können wir das **CSR auto-signing** Feature nutzen und den Icinga2-CLI-Befehl **node wizard** benutzen. Damit werden folgende relevanten Konfigurationsoptionen im Bezug auf die **Client**-Konfiguration und der **X.509**-Zertifikate abgehandelt:
 +  * Generierung eines self-signed Zertifikats und Speichern des Zertifikats im Verzeichnis //**/etc/icinga2/pki**//,
 +  * Herunterladen des Zertifikats vom Icinga2-Master-Node und speichern als [[centos:ca-trust|vertrauenswürdiges Zertifikat]] 
 +  * Beziehen eines von der CA des Icinga2-Master-Node signierten Zertifikats und Speichern des Zertifikats im Verzeichnis //**/etc/icinga2/pki**//,
 +  * Erstellen der Konfiguration für die lokale Zone und Endpunkt für den lokalen Client,
 +  * Erstellen der Icinga2-Master Daten basierend auf dem FQDN des Clients,
 +  * Deaktivieren des Benachrichtigujngsfunktionalitäten des lokalen Clients,
 +  * Aktivieren der Icinga2 CLI API Funktion des lokalen Clients,
 +  * optionales Festlegen der Host-IP und des Ports an dem der Client gebunden werden soll und
 +  * Setzen des **NodeName**s in der Konfigurationsdatei //**/etc/icinga2/constants.conf**//
 +
 +Da wir einen Client-Node einrichten wollen, beantworten wir die erste Frage mit einem **Y**, bzw. Bestätigen wir die erste Frage mit einem Druck auf die **Return-Taste**! 
 +   # icinga2 node wizard
 +
 +<html><pre class="code">
 +<font style="color: rgb(54, 54, 255)"><b>Welcome to the Icinga 2 Setup Wizard!
 +
 +We'll guide you through all required configuration details.
 +
 +
 +
 +</b></font><font style="color: rgb(0, 0, 0)"><b>Please specify if this is a satellite setup ('n' installs a master setup) </b>[Y/n]: n</font>
 +Starting the Master setup routine...
 +<b>Please specifiy the common name (CN) </b>[vml000097.dmz.nausch.org]:</font>
 +<b>Please specifiy the local zone name </b>[vml000097.dmz.nausch.org]:</font>
 +<b>Please specify the master endpoint(s) this node should connect to:
 +Master Common Name </b>(CN from your master setup): vml000117.dmz.nausch.org
 +<b>Please fill out the master connection information:
 +Master endpoint host </b>(optional, your master's IP address or FQDN): 10.0.0.117
 +<b>Master endpoint port </b>(optional) []:
 +<b>Add more master endpoints? </b>[y/N]
 +<b>Please specify the master connection for CSR auto-signing </b>(defaults to master endpoint host):
 +<b>Host </b>[10.0.0.117]:
 +<b>Port </b>[5665]:</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/base: Writing private key to '/etc/icinga2/pki/vml000097.dmz.nausch.org.key'.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/base: Writing X509 certificate to '/etc/icinga2/pki/vml000097.dmz.nausch.org.crt'.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Generating self-signed certifiate:</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Fetching public certificate from master (10.0.0.117, 5665):</font>
 +
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Writing trusted certificate to file '/etc/icinga2/pki/trusted-master.crt'.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Stored trusted master certificate in '/etc/icinga2/pki/trusted-master.crt'.</font>
 +
 +<b>Please specify the request ticket generated on your Icinga 2 master.</b>
 + (Hint: # icinga2 pki ticket --cn 'vml000097.dmz.nausch.org'): 0ede0943e8d13771ee1814067cb3ce2f1412bde8
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Processing self-signed certificate request. Ticket '0ede0943e8d13771ee1814067cb3ce2f1412bde8'.</font>
 +
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Created backup file '/etc/icinga2/pki/vml000097.dmz.nausch.org.crt.orig'.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Writing signed certificate to file '/etc/icinga2/pki/vml000097.dmz.nausch.org.crt'.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Writing CA certificate to file '/etc/icinga2/pki/ca.crt'.</font>
 +<b>Please specify the API bind host/port </b>(optional):
 +<b>Bind Host </b>[]:
 +<b>Bind Port </b>[]:
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Disabling the Notification feature.</font>
 +Disabling feature <font style="color: rgb(255, 54, 255)"><b>notification</b></font>. <font style="color: rgb(0, 0, 0)">Make sure to restart Icinga 2 for these changes to take effect.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Enabling the Apilistener feature.</font>
 +<font style="color: rgb(0, 0, 0)">Enabling feature <font style="color: rgb(255, 54, 255)"><b>api</b></font><font style="color: rgb(0, 0, 0)">. Make sure to restart Icinga 2 for these changes to take effect.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Created backup file '/etc/icinga2/features-available/api.conf.orig'.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Generating local zones.conf.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Dumping config items to file '/etc/icinga2/zones.conf'.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Created backup file '/etc/icinga2/zones.conf.orig'.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Updating constants.conf.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Created backup file '/etc/icinga2/constants.conf.orig'.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Updating constants file '/etc/icinga2/constants.conf'.</font>
 +<font style="color: rgb(29, 180, 29)">information</font><font style="color: rgb(0, 0, 0)">/cli: Updating constants file '/etc/icinga2/constants.conf'.</font>
 +<font style="color: rgb(0, 0, 0)">Done.
 +
 +Now restart your Icinga 2 daemon to finish the installation!
 +
 +</font>
 +</pre></html>
 +
 +Ob der **NodeName** des Client richtig gesetzt wurde können wir mit Hilfe des folgenden Befehls überprüfen.
 +
 +   # egrep 'NodeName' /etc/icinga2/constants.conf
 +
 +<html><pre class="code">
 +<font style="color: rgb(0, 0, 0)">const </font><font style="color: rgb(255, 54, 54)"><b>NodeName</b></font><font style="color: rgb(0, 0, 0)"> = "vml000097.dmz.nausch.org"</font>
 +</pre></html>
 +
 +Die definierten Parameter in der Zonen-Datei können wir mit einem Blick in die Konfigurationsdatei werfen.
 +   # cat /etc/icinga2/zones.conf
 +
 +<file c++ /etc/icinga2/zones.conf>/*
 + * Generated by Icinga 2 node setup commands
 + * on 2015-03-25 13:04:58 +0100
 + */
 +
 +object Endpoint "vml000117.dmz.nausch.org" {
 +        host = "10.0.0.117"
 +}
 +
 +object Zone "master" {
 +        endpoints = [ "vml000117.dmz.nausch.org" ]
 +}
 +
 +object Endpoint "vml000097.dmz.nausch.org" {
 +}
 +
 +object Zone "vml000097.dmz.nausch.org" {
 +        //this is the local node = "vml000097.dmz.nausch.org"
 +        endpoints = [ "vml000097.dmz.nausch.org" ]
 +        parent = "master"
 +}
 +</file>
 +
 +Sind wir mit der Konfiguration zufrieden, führen wir zur Aktivierung der Client-Konfiguration einen Reload des Icinga2-Daemon durch.
 +   # systemctl reload icinga2
 +
 +===== Client-Konfigurationsmodi =====
 +==== NRPE ====
 +
 +==== SSH ====
 +
 +
 +=== Server-Konfiguration ===
 +   # grep nagios /etc/passwd
 +
 +   nagios:x:996:994::/var/spool/nagios:/bin/bash
 +
 +
 +
 +   # mkdir -m 700 /var/spool/nagios/.ssh
 +
 +   # chown nagios.nagios /var/spool/nagios/.ssh
 +
 +   # ssh-keygen -b 4096 -t rsa -f /var/spool/nagios/.ssh/id_rsa
 +<code>Generating public/private rsa key pair.
 +Enter passphrase (empty for no passphrase): 
 +Enter same passphrase again: 
 +Your identification has been saved in /var/spool/nagios/.ssh/id_rsa.
 +Your public key has been saved in /var/spool/nagios/.ssh/id_rsa.pub.
 +The key fingerprint is:
 +ff:75:f3:09:d1:91:30:c8:14:cc:cc:a4:6e:1f:05:87 root@vml000117.dmz.nausch.org
 +The key's randomart image is:
 ++--[ RSA 4096]----+
 +|          O=++   |
 +|          .Eo o .|
 +|           . o |
 +|        .   . . .|
 +|        So . . . |
 +|        ... . .  |
 +|          .. ....|
 +|           . ...+|
 +|            .  ..|
 ++-----------------+
 +</code>
 +
 +   # chown nagios.nagios /var/spool/nagios/.ssh/*
 +
 +
 +
 +
 +   # yum install nagios-plugins-by_ssh
 +
 +=== Remotehost-Konfiguration ===
 +
 +   # grep nagios /etc/passwd
 +
 +   nagios:x:498:497::/var/spool/nagios:/sbin/nologin
 +
 +
 +   # mkdir -m 700 /var/spool/nagios/.ssh
 +
 +   # chown nagios.nagios /var/spool/nagios/.ssh
 +
 +
 +   # ssh -i /var/spool/nagios/.ssh/id_rsa nagios@10.0.0.50
 +
 +<code> ##############################################################################
 + #                                                                            #
 + #                       This is a private home server.                       #
 + #                                                                            #
 + #             Unauthorized access to this system is prohibited !             #
 + #                                                                            #
 + #    This system is actively monitored and all connections may be logged.    #
 + #         By accessing this system, you consent to this monitoring.          #
 + #                                                                            #
 + ##############################################################################
 +Last login: Tue May  5 20:53:23 2015 from vml000117.dmz.nausch.org
 + ##############################################################################
 + #                                                                            #
 + #                 This is the home server of Michael Nausch.                 #
 + #                                                                            #
 + #                           vml000050.dmz.nausch.org                         #
 + #                                                                            #
 + #             Unauthorized access to this system is prohibited !             #
 + #                                                                            #
 + #    This system is actively monitored and all connections may be logged.    #
 + #         By accessing this system, you consent to this monitoring.          #
 + #                                                                            #
 + ##############################################################################
 +-bash-4.1$
 +</code>
 +
 +   # /usr/lib64/nagios/plugins/check_by_ssh --help
 +<code>check_by_ssh v2.0.1 (nagios-plugins 2.0.1)
 +Copyright (c) 1999 Karl DeBisschop <kdebisschop@users.sourceforge.net>
 +Copyright (c) 2000-2014 Nagios Plugin Development Team
 +        <devel@nagios-plugins.org>
 +
 +This plugin uses SSH to execute commands on a remote host
 +
 +Usage:
 + check_by_ssh -H <host> -C <command> [-fqv] [-1|-2] [-4|-6]
 +       [-S [lines]] [-E [lines]] [-t timeout] [-i identity]
 +       [-l user] [-n name] [-s servicelist] [-O outputfile]
 +       [-p port] [-o ssh-option] [-F configfile]
 +
 +Options:
 + -h, --help
 +    Print detailed help screen
 + -V, --version
 +    Print version information
 + --extra-opts=[section][@file]
 +    Read options from an ini file. See
 +    https://www.nagios-plugins.org/doc/extra-opts.html
 +    for usage and examples.
 + -H, --hostname=ADDRESS
 +    Host name, IP Address, or unix socket (must be an absolute path)
 + -p, --port=INTEGER
 +    Port number (default: none)
 + -4, --use-ipv4
 +    Use IPv4 connection
 + -6, --use-ipv6
 +    Use IPv6 connection
 + -1, --proto1
 +    tell ssh to use Protocol 1 [optional]
 + -2, --proto2
 +    tell ssh to use Protocol 2 [optional]
 + -S, --skip-stdout[=n]
 +    Ignore all or (if specified) first n lines on STDOUT [optional]
 + -E, --skip-stderr[=n]
 +    Ignore all or (if specified) first n lines on STDERR [optional]
 + -f
 +    tells ssh to fork rather than create a tty [optional]. This will always return OK if ssh is executed
 + -C, --command='COMMAND STRING'
 +    command to execute on the remote machine
 + -l, --logname=USERNAME
 +    SSH user name on remote host [optional]
 + -i, --identity=KEYFILE
 +    identity of an authorized key [optional]
 + -O, --output=FILE
 +    external command file for nagios [optional]
 + -s, --services=LIST
 +    list of nagios service names, separated by ':' [optional]
 + -n, --name=NAME
 +    short name of host in nagios configuration [optional]
 + -o, --ssh-option=OPTION
 +    Call ssh with '-o OPTION' (may be used multiple times) [optional]
 + -F, --configfile
 +    Tell ssh to use this configfile [optional]
 + -q, --quiet
 +    Tell ssh to suppress warning and diagnostic messages [optional]
 + -w, --warning=DOUBLE
 +    Response time to result in warning status (seconds)
 + -c, --critical=DOUBLE
 +    Response time to result in critical status (seconds)
 + -t, --timeout=INTEGER
 +    Seconds before connection times out (default: 10)
 + -v, --verbose
 +    Show details for command-line debugging (Nagios may truncate output)
 +
 + The most common mode of use is to refer to a local identity file with
 + the '-i' option. In this mode, the identity pair should have a null
 + passphrase and the public key should be listed in the authorized_keys
 + file of the remote host. Usually the key will be restricted to running
 + only one command on the remote server. If the remote SSH server tracks
 + invocation arguments, the one remote program may be an agent that can
 + execute additional commands as proxy
 +
 + To use passive mode, provide multiple '-C' options, and provide
 + all of -O, -s, and -n options (servicelist order must match '-C'options)
 +
 +Examples:
 + $ check_by_ssh -H localhost -n lh -s c1:c2:c3 -C uptime -C uptime -C uptime -O /tmp/foo
 + $ cat /tmp/foo
 + [1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c1;0; up 2 days
 + [1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c2;0; up 2 days
 + [1080933700] PROCESS_SERVICE_CHECK_RESULT;flint;c3;0; up 2 days
 +
 +Send email to help@nagios-plugins.org if you have questions regarding use
 +of this software. To submit patches or suggest improvements, send email to
 +devel@nagios-plugins.org
 +</code>
 +
 +Auf dem Remote-Host:
 +   # /usr/lib64/nagios/plugins/check_load -w 15,10,5 -c 30,25,20
 +
 +   OK - load average: 0.13, 0.13, 0.09|load1=0.130;15.000;30.000;0; load5=0.130;10.000;25.000;0; load15=0.090;5.000;20.000;0;
 +
 +   # vim /etc/icinga2/conf.d/commands/by_ssh.conf
 +<code>//Django : 2015-05-05
 +object CheckCommand "by_ssh" {
 +  import "plugin-check-command"
 +
 +  command = [ PluginDir + "/check_by_ssh" ]
 +
 +  arguments = {
 +    "-H" = "$by_ssh_host$"
 +    "-p" = "$by_ssh_port$"
 +    "-4" = {
 +             set_if = "$by_ssh_ipv4$"
 +           }
 +    "-6" = {
 +             set_if = "$by_ssh_ipv6$"
 +           }
 +    "-1" = {
 +             set_if = "$by_ssh_version1$"
 +           }
 +    "-2" = {
 +             set_if = "$by_ssh_version2$"
 +           }
 +    "-S" = "$by_ssh_skip_stdout$"
 +    "-E" = "$by_ssh_skip_stderr$"
 +    "-f" = {
 +             set_if = "$by_ssh_fork$"
 +           }
 +    "-C" = "$by_ssh_command$"
 +    "-l" = "$by_ssh_user$"
 +    "-i" = "$by_ssh_keyfile$"
 +    "-O" = "$by_ssh_output$"
 +    "-s" = "$by_ssh_services$"
 +    "-n" = "$by_ssh_name$"
 +    "-o" = "$by_ssh_option$"
 +    "-F" = "$by_ssh_configfile$"
 +    "-q" = {
 +             set_if = "$by_ssh_quiet$"
 +           }
 +    "-w" = "$by_ssh_warn$"
 +    "-c" = "$by_ssh_crit$"
 +    "-t" = "$by_ssh_timeout$"
 +
 +  }
 +}
 +</code>
 +
 +
 +   # vim /etc/icinga2/conf.d/nausch.org/services/by_ssh.conf
 +<file cc+ /etc/icinga2/conf.d/nausch.org/services/by_ssh.conf>
 +// Django: 2015-05-05
 +
 +apply Service for (by_ssh => config in host.vars.by_ssh) {
 +  import "generic-service"
 +
 +  check_command = "by_ssh"
 +  command_endpoint = host.vars.remote_client
 +
 +  vars += config
 +
 +  assign where host.vars.remote_client
 +}
 +</file>
 +
 +==== Bridging ====
 +Bei diesem Betriebsmodus werden bis auf die **check command** Definitionen keine Konfigurationsinformationen auf dem Client selbst benötigt und vorgehalten. Der Remote-Client führt lediglich die Befehle aus, die die **Master Node**-Instanz an den **Client Node** überträgt. Damit der Client diese Befehle auch akzeptieren kann, __müssen__ wir dies auch in der Konfigurationsdatei //**/etc/icinga2/features-enabled/api.conf**// definieren.
 +   # vim /etc/icinga2/features-enabled/api.conf
 +
 +<file c++ /etc/icinga2/features-enabled/api.conf>/**
 + * The API listener is used for distributed monitoring setups.
 + */
 +object ApiListener "api" {
 +  cert_path = SysconfDir + "/icinga2/pki/" + NodeName + ".crt"
 +  key_path = SysconfDir + "/icinga2/pki/" + NodeName + ".key"
 +  ca_path = SysconfDir + "/icinga2/pki/ca.crt"
 +
 +  //ticket_salt = TicketSalt
 +  // Django : 205-04-08
 +  //          Befehle des Icinga 2 Master Nodes akzeptieren und ausführen
 +  accept_commands = true
 +}
 +</file>
 +
 +Da auf dem Client Node keine Kommandos abgespeichert werden, kann dieser auch keine Checks von sich aus ausführen, es besteht auch keine Backup/Fallback-Konfiguration. Der Client wartet lediglich auf entsprechende Steuerkommandos des Icinga 2 Master Nodes.
 +
 +==== Slave zu Master ====
 +
 +==== Master zu Slaves ====
 +
 +
 +
 +====== Links ======
 +  * **⇐ [[centos:web_c7:icinga:web2|Zurück zum Kapitel "Icinga Web 2 - Installation und Konfiguration unter CentOS 7.x"]]**
 +  * **⇒ [[centos:web_c7:icinga:graphite|Weiter zum Kapitel "Icinga Einbinden von Graphite zur graphischen Visualisierung - Installation und Konfiguration unter CentOS 7.x"]]**
 +  * **[[centos:web_c7:start|Zurück zum Kapitel >>Webserverinstallation unter CentOS 7.x<<]]**
 +  * **[[wiki:start|Zurück zu >>Projekte und Themenkapitel<<]]**
 +  * **[[http://dokuwiki.nausch.org/doku.php/|Zurück zur Startseite]]**
 +
 +
  • centos/web_c7/icinga/config_1.1428586225.txt.gz
  • Zuletzt geändert: 09.04.2015 13:30.
  • von django