Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| centos:web_c7:icinga:config_1 [10.04.2015 09:02. ] – [Client-Konfigurationsmodi] django | centos: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**: | + | - **[[centos: |
| - | - **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, | + | - **[[centos: |
| - | - **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: |
| + | - **[[centos: | ||
| + | - **[[centos: | ||
| + | - **[[centos: | ||
| ===== Konfiguration (Client/ | ===== Konfiguration (Client/ | ||
| Zeile 291: | Zeile 294: | ||
| ===== Client-Konfigurationsmodi ===== | ===== Client-Konfigurationsmodi ===== | ||
| + | ==== NRPE ==== | ||
| + | |||
| + | ==== SSH ==== | ||
| + | |||
| + | |||
| + | === Server-Konfiguration === | ||
| + | # grep nagios /etc/passwd | ||
| + | |||
| + | | ||
| + | |||
| + | |||
| + | |||
| + | # mkdir -m 700 / | ||
| + | |||
| + | # chown nagios.nagios / | ||
| + | |||
| + | # ssh-keygen -b 4096 -t rsa -f / | ||
| + | < | ||
| + | Enter passphrase (empty for no passphrase): | ||
| + | Enter same passphrase again: | ||
| + | Your identification has been saved in / | ||
| + | Your public key has been saved in / | ||
| + | The key fingerprint is: | ||
| + | ff: | ||
| + | The key's randomart image is: | ||
| + | +--[ RSA 4096]----+ | ||
| + | | O=++ | | ||
| + | | .Eo o .| | ||
| + | | | ||
| + | | . . . .| | ||
| + | | So . . . | | ||
| + | | ... . . | | ||
| + | | .. ....| | ||
| + | | . ...+| | ||
| + | | . ..| | ||
| + | +-----------------+ | ||
| + | </ | ||
| + | |||
| + | # chown nagios.nagios / | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | # yum install nagios-plugins-by_ssh | ||
| + | |||
| + | === Remotehost-Konfiguration === | ||
| + | |||
| + | # grep nagios /etc/passwd | ||
| + | |||
| + | | ||
| + | |||
| + | |||
| + | # mkdir -m 700 / | ||
| + | |||
| + | # chown nagios.nagios / | ||
| + | |||
| + | |||
| + | # ssh -i / | ||
| + | |||
| + | < | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | ############################################################################## | ||
| + | Last login: Tue May 5 20:53:23 2015 from vml000117.dmz.nausch.org | ||
| + | ############################################################################## | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | ############################################################################## | ||
| + | -bash-4.1$ | ||
| + | </ | ||
| + | |||
| + | # / | ||
| + | < | ||
| + | Copyright (c) 1999 Karl DeBisschop < | ||
| + | Copyright (c) 2000-2014 Nagios Plugin Development Team | ||
| + | < | ||
| + | |||
| + | This plugin uses SSH to execute commands on a remote host | ||
| + | |||
| + | Usage: | ||
| + | | ||
| + | [-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 | ||
| + | | ||
| + | Read options from an ini file. See | ||
| + | https:// | ||
| + | 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 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 ':' | ||
| + | -n, --name=NAME | ||
| + | short name of host in nagios configuration [optional] | ||
| + | -o, --ssh-option=OPTION | ||
| + | Call ssh with '-o OPTION' | ||
| + | -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 ' | ||
| + | | ||
| + | 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 | ||
| + | | ||
| + | | ||
| + | |||
| + | To use passive mode, provide multiple ' | ||
| + | all of -O, -s, and -n options (servicelist order must match ' | ||
| + | |||
| + | Examples: | ||
| + | $ check_by_ssh -H localhost -n lh -s c1:c2:c3 -C uptime -C uptime -C uptime -O /tmp/foo | ||
| + | $ cat /tmp/foo | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | Send email to help@nagios-plugins.org if you have questions regarding use | ||
| + | of this software. To submit patches or suggest improvements, | ||
| + | devel@nagios-plugins.org | ||
| + | </ | ||
| + | |||
| + | Auf dem Remote-Host: | ||
| + | # / | ||
| + | |||
| + | OK - load average: 0.13, 0.13, 0.09|load1=0.130; | ||
| + | |||
| + | # vim / | ||
| + | < | ||
| + | object CheckCommand " | ||
| + | import " | ||
| + | |||
| + | command = [ PluginDir + "/ | ||
| + | |||
| + | arguments = { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | | ||
| + | } | ||
| + | " | ||
| + | | ||
| + | } | ||
| + | " | ||
| + | | ||
| + | } | ||
| + | " | ||
| + | | ||
| + | } | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | | ||
| + | } | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | | ||
| + | } | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | |||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | |||
| + | # vim / | ||
| + | <file cc+ / | ||
| + | // Django: 2015-05-05 | ||
| + | |||
| + | apply Service for (by_ssh => config in host.vars.by_ssh) { | ||
| + | import " | ||
| + | |||
| + | check_command = " | ||
| + | command_endpoint = host.vars.remote_client | ||
| + | |||
| + | vars += config | ||
| + | |||
| + | assign where host.vars.remote_client | ||
| + | } | ||
| + | </ | ||
| + | |||
| ==== Bridging ==== | ==== 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 // | ||
| + | # vim / | ||
| + | |||
| + | <file c++ / | ||
| + | * The API listener is used for distributed monitoring setups. | ||
| + | */ | ||
| + | object ApiListener " | ||
| + | cert_path = SysconfDir + "/ | ||
| + | key_path = SysconfDir + "/ | ||
| + | ca_path = SysconfDir + "/ | ||
| + | |||
| + | // | ||
| + | // Django : 205-04-08 | ||
| + | // Befehle des Icinga 2 Master Nodes akzeptieren und ausführen | ||
| + | accept_commands = true | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Da auf dem Client Node keine Kommandos abgespeichert werden, kann dieser auch keine Checks von sich aus ausführen, es besteht auch keine Backup/ | ||
| ==== Slave zu Master ==== | ==== Slave zu Master ==== | ||
| ==== Master zu Slaves ==== | ==== Master zu Slaves ==== | ||
| + | |||
| + | |||
| + | |||
| + | ====== Links ====== | ||
| + | * **⇐ [[centos: | ||
| + | * **⇒ [[centos: | ||
| + | * **[[centos: | ||
| + | * **[[wiki: | ||
| + | * **[[http:// | ||
| + | |||