tachtler:icinga2_-_grundkonfiguration
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
tachtler:icinga2_-_grundkonfiguration [2015/12/03 13:26] – [Konfiguration: Monitoring: /etc/icinga2/conf.d/] klaus | tachtler:icinga2_-_grundkonfiguration [2021/08/04 20:13] (aktuell) – [/etc/icinga2/features-available/api.conf] klaus | ||
---|---|---|---|
Zeile 20: | Zeile 20: | ||
eine **Kopie der originalen Konfigurationsdatei, | eine **Kopie der originalen Konfigurationsdatei, | ||
< | < | ||
- | # for i in `ls / | + | # for i in `ls / |
</ | </ | ||
Zeile 343: | Zeile 343: | ||
* Das **ROOT-Zertifikat** | * Das **ROOT-Zertifikat** | ||
zur verschlüsselten Kommunikation befinden und welcher " | zur verschlüsselten Kommunikation befinden und welcher " | ||
+ | |||
+ | :!: **WICHTIG** - **Falls __KEIN__ IPv6 zum Einsatz kommt, ist nachfolgender Konfiguratrionsparameter** | ||
+ | < | ||
+ | bind_host = " | ||
+ | </ | ||
+ | **zwingend erforderlich!** | ||
(**Komplette Konfigurationsdatei: | (**Komplette Konfigurationsdatei: | ||
Zeile 355: | Zeile 361: | ||
key_path = SysconfDir + "/ | key_path = SysconfDir + "/ | ||
ca_path = SysconfDir + "/ | ca_path = SysconfDir + "/ | ||
+ | |||
+ | bind_host = " | ||
ticket_salt = TicketSalt | ticket_salt = TicketSalt | ||
Zeile 546: | Zeile 554: | ||
Please specify the request ticket generated on your Icinga 2 master. | Please specify the request ticket generated on your Icinga 2 master. | ||
- | | + | |
information/ | information/ | ||
Zeile 601: | Zeile 609: | ||
Nachfolgende Konfigurationsdatei wurden **neu** erstellt oder angepasst: | Nachfolgende Konfigurationsdatei wurden **neu** erstellt oder angepasst: | ||
- | * ''/ | ||
* ''/ | * ''/ | ||
* ''/ | * ''/ | ||
* ''/ | * ''/ | ||
* ''/ | * ''/ | ||
+ | |||
+ | :!: **HINWEIS** - **Möglicherweise ist das __Feature__ '' | ||
+ | < | ||
+ | # icinga2 feature enable notification | ||
+ | Enabling feature notification. Make sure to restart Icinga 2 for these changes to take effect. | ||
+ | </ | ||
Nachfolgender Befehl zeigt an, das das **Feature** (Möglichkeit) - **'' | Nachfolgender Befehl zeigt an, das das **Feature** (Möglichkeit) - **'' | ||
Zeile 623: | Zeile 636: | ||
* Das **ROOT-Zertifikat** | * Das **ROOT-Zertifikat** | ||
zur verschlüsselten Kommunikation befinden und welcher " | zur verschlüsselten Kommunikation befinden und welcher " | ||
+ | |||
+ | :!: **WICHTIG** - **Falls __KEIN__ IPv6 zum Einsatz kommt, ist nachfolgender Konfiguratrionsparameter** | ||
+ | < | ||
+ | bind_host = " | ||
+ | </ | ||
+ | **zwingend erforderlich!** | ||
(**Komplette Konfigurationsdatei: | (**Komplette Konfigurationsdatei: | ||
Zeile 634: | Zeile 653: | ||
key_path = SysconfDir + "/ | key_path = SysconfDir + "/ | ||
ca_path = SysconfDir + "/ | ca_path = SysconfDir + "/ | ||
+ | |||
+ | bind_host = " | ||
accept_config = false | accept_config = false | ||
Zeile 981: | Zeile 1002: | ||
:!: **HINWEIS** - **Diese Konfigurationsdatei sollte __sehr individuell__ angepasst werden!** | :!: **HINWEIS** - **Diese Konfigurationsdatei sollte __sehr individuell__ angepasst werden!** | ||
- | |||
Nachfolgend der Inhalt der Konfigurationsdatei. **Es sind __sehr individuelle__ Anpassungen erforderlich, | Nachfolgend der Inhalt der Konfigurationsdatei. **Es sind __sehr individuelle__ Anpassungen erforderlich, | ||
Zeile 1023: | Zeile 1043: | ||
==== hosts.conf ==== | ==== hosts.conf ==== | ||
+ | |||
+ | :!: **HINWEIS** - **__Nur__ der Einsatz in einem Unterverzeichnis z.B. ''/ | ||
+ | |||
+ | Die Konfigurationsdatei | ||
+ | * ''/ | ||
+ | beinhaltet " | ||
+ | |||
+ | Nachfolgend der Inhalt der Konfigurationsdatei. **Es werden nachfolgende Anpassungen durchgeführt!**: | ||
+ | |||
+ | :!: **HINWEIS** - **Diese Konfigurationsdatei sollte __sehr individuell__ angepasst werden!** | ||
+ | |||
+ | Nachfolgend der Inhalt der Konfigurationsdatei. **Es sind __sehr individuelle__ Anpassungen erforderlich, | ||
+ | <code c> | ||
+ | /* | ||
+ | * Host definitions with object attributes | ||
+ | * used for apply rules for Service, Notification, | ||
+ | * Dependency and ScheduledDowntime objects. | ||
+ | * | ||
+ | * Tip: Use `icinga2 object list --type Host` to | ||
+ | * list all host objects after running | ||
+ | * configuration validation (`icinga2 daemon -C`). | ||
+ | */ | ||
+ | |||
+ | /* | ||
+ | * This is an example host based on your | ||
+ | * local host's FQDN. Specify the NodeName | ||
+ | * constant in `constants.conf` or use your | ||
+ | * own description, | ||
+ | */ | ||
+ | |||
+ | object Host NodeName { | ||
+ | /* Import the default host template defined in `templates.conf`. */ | ||
+ | import " | ||
+ | |||
+ | /* Specify the address attributes for checks e.g. `ssh` or `http`. */ | ||
+ | address = " | ||
+ | address6 = ":: | ||
+ | |||
+ | /* Set custom attribute `os` for hostgroup assignment in `groups.conf`. */ | ||
+ | vars.os = " | ||
+ | |||
+ | /* Define http vhost attributes for service apply rules in `services.conf`. */ | ||
+ | / | ||
+ | http_uri = "/" | ||
+ | }*/ | ||
+ | /* Uncomment if you've sucessfully installed Icinga Web 2. */ | ||
+ | // | ||
+ | // http_uri = "/ | ||
+ | //} | ||
+ | |||
+ | /* Define disks and attributes for service apply rules in `services.conf`. */ | ||
+ | / | ||
+ | /* No parameters. */ | ||
+ | /*}*/ | ||
+ | / | ||
+ | disk_partitions = "/" | ||
+ | }*/ | ||
+ | |||
+ | /* Define notification mail attributes for notification apply rules in `notifications.conf`. */ | ||
+ | vars.notification[" | ||
+ | /* The UserGroup `icingaadmins` is defined in `users.conf`. */ | ||
+ | /* Tachtler */ | ||
+ | /* default: groups = [ " | ||
+ | groups = [ " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
==== notifications.conf ==== | ==== notifications.conf ==== | ||
Zeile 1141: | Zeile 1229: | ||
==== services.conf ==== | ==== services.conf ==== | ||
+ | |||
+ | :!: **HINWEIS** - **__Nur__ der Einsatz in einem Unterverzeichnis z.B. ''/ | ||
+ | |||
+ | Die Konfigurationsdatei | ||
+ | * ''/ | ||
+ | beinhaltet " | ||
+ | |||
+ | Nachfolgend der Inhalt der Konfigurationsdatei. **Es werden nachfolgende Anpassungen durchgeführt!**: | ||
+ | |||
+ | :!: **HINWEIS** - **Diese Konfigurationsdatei sollte __sehr individuell__ angepasst werden!** | ||
+ | |||
+ | Nachfolgend der Inhalt der Konfigurationsdatei. **Es sind __sehr individuelle__ Anpassungen erforderlich, | ||
+ | <code c> | ||
+ | /* | ||
+ | * Service apply rules. | ||
+ | * | ||
+ | * The CheckCommand objects `ping4`, `ping6`, etc | ||
+ | * are provided by the plugin check command templates. | ||
+ | * Check the documentation for details. | ||
+ | * | ||
+ | * Tip: Use `icinga2 object list --type Service` to | ||
+ | * list all service objects after running | ||
+ | * configuration validation (`icinga2 daemon -C`). | ||
+ | */ | ||
+ | |||
+ | /* | ||
+ | * This is an example host based on your | ||
+ | * local host's FQDN. Specify the NodeName | ||
+ | * constant in `constants.conf` or use your | ||
+ | * own description, | ||
+ | */ | ||
+ | |||
+ | /* | ||
+ | * These are generic `ping4` and `ping6` | ||
+ | * checks applied to all hosts having the | ||
+ | * `address` resp. `address6` attribute | ||
+ | * defined. | ||
+ | */ | ||
+ | apply Service " | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | |||
+ | assign where host.address | ||
+ | } | ||
+ | |||
+ | /*apply Service " | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | |||
+ | assign where host.address6 | ||
+ | }*/ | ||
+ | |||
+ | /* | ||
+ | * Apply the `ssh` service to all hosts | ||
+ | * with the `address` attribute defined and | ||
+ | * the custom attribute `os` set to `Linux`. | ||
+ | */ | ||
+ | apply Service " | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | |||
+ | assign where (host.address || host.address6) && host.vars.os == " | ||
+ | } | ||
+ | |||
+ | |||
+ | |||
+ | /*apply Service for (http_vhost => config in host.vars.http_vhosts) { | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | |||
+ | vars += config | ||
+ | } | ||
+ | |||
+ | apply Service for (disk => config in host.vars.disks) { | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | |||
+ | vars += config | ||
+ | }*/ | ||
+ | |||
+ | apply Service " | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | |||
+ | assign where host.name == NodeName | ||
+ | } | ||
+ | |||
+ | apply Service " | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | |||
+ | /* Used by the ScheduledDowntime apply rule in `downtimes.conf`. */ | ||
+ | vars.backup_downtime = " | ||
+ | |||
+ | assign where host.name == NodeName | ||
+ | } | ||
+ | |||
+ | apply Service " | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | |||
+ | assign where host.name == NodeName | ||
+ | } | ||
+ | |||
+ | apply Service " | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | |||
+ | assign where host.name == NodeName | ||
+ | } | ||
+ | |||
+ | apply Service " | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | |||
+ | assign where host.name == NodeName | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | Bei der Überprüfung von **Services** auf einem **Client**, welche **__durch__ den [[https:// | ||
+ | |||
+ | Nachfolgendes Beispiel, soll dies für die Überprüfung der Laufwerke mittels **'' | ||
+ | |||
+ | (**Nur relevanter Ausschnitt**): | ||
+ | |||
+ | <code c> | ||
+ | apply Service for (disk => config in host.vars.disks) { | ||
+ | import " | ||
+ | |||
+ | check_command = " | ||
+ | |||
+ | command_endpoint = host.name | ||
+ | |||
+ | vars += config | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **__Erklärung__**: | ||
+ | |||
+ | * <code c> | ||
+ | |||
+ | Die Definition des **'' | ||
==== templates.conf ==== | ==== templates.conf ==== | ||
Zeile 1341: | Zeile 1582: | ||
</ | </ | ||
gekennzeichnet. | gekennzeichnet. | ||
+ | |||
+ | ===== Konfiguration: | ||
+ | |||
+ | Nachdem die Konfiguration der [[https:// | ||
+ | * [[tachtler: | ||
+ | * [[tachtler: | ||
+ | ist nachfolgende Konfiguration des [[https:// | ||
+ | |||
+ | :!: **WICHTIG** - **Die Konfiguration der Checks für den [[https:// | ||
+ | |||
+ | ==== / | ||
+ | |||
+ | Die Konfigurationsdatei | ||
+ | * ''/ | ||
+ | ist nun nach dem **" | ||
+ | |||
+ | Die Konfigurationsdatei hat **nun** nachfolgenden Inhalt und **muss __zwingend__ angepasst werden**! | ||
+ | |||
+ | (**Komplette Konfigurationsdatei: | ||
+ | |||
+ | <code c> | ||
+ | /* | ||
+ | * Generated by Icinga 2 node setup commands | ||
+ | * on 2015-12-01 15:19:13 +0100 | ||
+ | */ | ||
+ | |||
+ | object Endpoint " | ||
+ | host = " | ||
+ | port = " | ||
+ | } | ||
+ | |||
+ | object Zone " | ||
+ | endpoints = [ " | ||
+ | } | ||
+ | |||
+ | /* | ||
+ | * Tachtler | ||
+ | * server10.idmz.tachtler.net | ||
+ | */ | ||
+ | |||
+ | object Endpoint " | ||
+ | host = " | ||
+ | port = " | ||
+ | } | ||
+ | |||
+ | object Zone " | ||
+ | endpoints = [ " | ||
+ | parent = " | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Nützliche Befehle ===== | ||
+ | |||
+ | Nachfolgend einige nützliche Befehle: | ||
+ | |||
+ | ^ Befehl | ||
+ | | < | ||
+ | | < | ||
+ | | < | ||
+ | | < | ||
tachtler/icinga2_-_grundkonfiguration.txt · Zuletzt geändert: 2021/08/04 20:13 von klaus