Icinga2 Hierarchie: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
David (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „=Test Aufbau:= ==Ziehl== *2 icinga systeme (oder mehr) die verschieden bereiche getrent überwachen sollen und ihre auswertungen an den master server senden =…“) |
David (Diskussion | Beiträge) |
||
| Zeile 1: | Zeile 1: | ||
=Test Aufbau:= | =Test Aufbau:= | ||
==Ziehl== | ==Ziehl== | ||
| − | *2 icinga | + | *2 icinga Systeme (oder mehr) die verschieden bereiche getrennt überwachen sollen und ihre auswertungen an den master server senden |
==Rechner== | ==Rechner== | ||
| Zeile 17: | Zeile 17: | ||
=Installation= | =Installation= | ||
==icinga admin installieren== | ==icinga admin installieren== | ||
| − | ===packet | + | ===packet Installation=== |
*debian | *debian | ||
unter debian repositorys hinzufügen | unter debian repositorys hinzufügen | ||
| Zeile 27: | Zeile 27: | ||
apt install software-properties-common | apt install software-properties-common | ||
add-apt-repository ppa:formorer/icinga | add-apt-repository ppa:formorer/icinga | ||
| − | * | + | *installieren |
apt-get update | apt-get update | ||
apt-get upgrade | apt-get upgrade | ||
| Zeile 38: | Zeile 38: | ||
*beschrieben wird nur icinga right für alle zusätlichen systeme muss genauso vorgegangen werden | *beschrieben wird nur icinga right für alle zusätlichen systeme muss genauso vorgegangen werden | ||
*wir benutzen auf left Debian 8 & right Ubuntu 16.04 | *wir benutzen auf left Debian 8 & right Ubuntu 16.04 | ||
| − | ===packet | + | ===packet Installation=== |
*debian | *debian | ||
unter debian repositorys hinzufügen | unter debian repositorys hinzufügen | ||
| Zeile 57: | Zeile 57: | ||
https://xinux.net/index.php/Icinga-web_ubuntu_16.04 | https://xinux.net/index.php/Icinga-web_ubuntu_16.04 | ||
==icinga right-1 installieren== | ==icinga right-1 installieren== | ||
| − | *beschrieben wird nur icinga right-1 für alle | + | *beschrieben wird nur icinga right-1 für alle zusätzliche Systeme muss genauso vorgegangen werden |
===packet installatieren=== | ===packet installatieren=== | ||
*debian | *debian | ||
| Zeile 68: | Zeile 68: | ||
apt install software-properties-common | apt install software-properties-common | ||
add-apt-repository ppa:formorer/icinga | add-apt-repository ppa:formorer/icinga | ||
| − | * | + | *installieren |
apt-get update | apt-get update | ||
apt-get upgrade | apt-get upgrade | ||
apt-get install icinga2 | apt-get install icinga2 | ||
==Zertifikate== | ==Zertifikate== | ||
| − | *nach dem alle system | + | *nach dem alle system installiert wurden am besten die Zertifikate direkt angehen |
| − | *auf der cert authority für jeden host ein Zertifikate | + | *auf der cert authority für jeden host ein Zertifikate generieren |
*dann auf die Zertifikate auf die hosts kopieren mit scp in den ordner /etc/icinga2/pki | *dann auf die Zertifikate auf die hosts kopieren mit scp in den ordner /etc/icinga2/pki | ||
| − | *darauf achten das die hostname & Endpoint | + | *darauf achten das die hostname & Endpoint Name mit den Zertifikate übereinstimmen |
=Konfiguration= | =Konfiguration= | ||
| Zeile 182: | Zeile 182: | ||
</pre> | </pre> | ||
| − | ===Neue | + | ===Neue Konfiguration anwenden=== |
/etc/icinga2/icinga2.conf | /etc/icinga2/icinga2.conf | ||
<pre> | <pre> | ||
| Zeile 194: | Zeile 194: | ||
mv /etc/icinga2/conf.d/* /etc/icinga2/zones.d/global-templates | mv /etc/icinga2/conf.d/* /etc/icinga2/zones.d/global-templates | ||
| − | ===icinga state | + | ===icinga state kopieren=== |
scp /var/lib/icinga2/icinga2.state root@icinga-left.xinux.org:/var/lib/icinga2 | scp /var/lib/icinga2/icinga2.state root@icinga-left.xinux.org:/var/lib/icinga2 | ||
scp /var/lib/icinga2/icinga2.state root@icinga-right.xinux.org:/var/lib/icinga2 | scp /var/lib/icinga2/icinga2.state root@icinga-right.xinux.org:/var/lib/icinga2 | ||
===Icinga neue hosts übernehmen=== | ===Icinga neue hosts übernehmen=== | ||
| − | * in der nodliste | + | * in der nodliste müssten die neun node schon angezeigt werden (sofern sie schon online sind) |
icinga2 node list | icinga2 node list | ||
| − | * mit node update-config werden die entsprechenden | + | * mit node update-config werden die entsprechenden Einträge in repository.d angelegt |
icinga2 node update-config | icinga2 node update-config | ||
| − | * nach einem reload werden die nodes auch im webinterface | + | * nach einem reload werden die nodes auch im webinterface übernommen |
service icinga2 reload | service icinga2 reload | ||
| Zeile 269: | Zeile 269: | ||
</pre> | </pre> | ||
| − | === | + | ===Konfiguration anwenden=== |
| − | sicherstellen das die neue | + | sicherstellen das die neue Konfiguration benutzt wird |
/etc/icinga2/icinga2.conf | /etc/icinga2/icinga2.conf | ||
<pre> | <pre> | ||
| Zeile 278: | Zeile 278: | ||
===Icinga neue hosts übernehmen=== | ===Icinga neue hosts übernehmen=== | ||
| − | * in der nodliste | + | * in der nodliste müssten die neun node schon angezeigt werden (sofern sie schon online sind) |
icinga2 node list | icinga2 node list | ||
| − | * mit node update-config werden die entsprechenden | + | * mit node update-config werden die entsprechenden Einträge in repository.d angelegt |
icinga2 node update-config | icinga2 node update-config | ||
| − | * nach einem reload werden die nodes auch im webinterface | + | * nach einem reload werden die nodes auch im webinterface übernommen |
service icinga2 reload | service icinga2 reload | ||
| Zeile 293: | Zeile 293: | ||
===Zone anlegen=== | ===Zone anlegen=== | ||
| − | *die | + | *die Zonen anlegen |
/etc/icinga2/zones.conf | /etc/icinga2/zones.conf | ||
<pre> | <pre> | ||
Version vom 6. Juli 2016, 12:57 Uhr
Test Aufbau:
Ziehl
- 2 icinga Systeme (oder mehr) die verschieden bereiche getrennt überwachen sollen und ihre auswertungen an den master server senden
Rechner
icinga-admin 192.168.241.161 icinga-left 192.168.241.162 icinga-right 192.168.241.163 icinga-left-1 192.168.241.164 icinga-left-2 192.168.241.165 icinga-right-1 192.168.241.166 icinga-right-2 192.168.241.167
Plan
Installation
icinga admin installieren
packet Installation
- debian
unter debian repositorys hinzufügen
wget -O - http://debmon.org/debmon/repo.key 2>/dev/null | apt-key add - echo 'deb http://debmon.org/debmon debmon-jessie main' >/etc/apt/sources.list.d/debmon.list apt-get update
- ubuntu
unter ubuntu repositorys hinzufügen
apt install software-properties-common add-apt-repository ppa:formorer/icinga
- installieren
apt-get update apt-get upgrade apt-get install icinga2
icinga2 web
- icinga2 web aufsetzen
https://xinux.net/index.php/Icinga-web_ubuntu_16.04
icinga right installieren
- beschrieben wird nur icinga right für alle zusätlichen systeme muss genauso vorgegangen werden
- wir benutzen auf left Debian 8 & right Ubuntu 16.04
packet Installation
- debian
unter debian repositorys hinzufügen
wget -O - http://debmon.org/debmon/repo.key 2>/dev/null | apt-key add - echo 'deb http://debmon.org/debmon debmon-jessie main' >/etc/apt/sources.list.d/debmon.list apt-get update
- ubuntu
unter ubuntu repositorys hinzufügen
apt install software-properties-common add-apt-repository ppa:formorer/icinga
- installiern
apt-get update apt-get upgrade apt-get install icinga2
icinga2 web
- icinga2 web aufsetzen
https://xinux.net/index.php/Icinga-web_ubuntu_16.04
icinga right-1 installieren
- beschrieben wird nur icinga right-1 für alle zusätzliche Systeme muss genauso vorgegangen werden
packet installatieren
- debian
unter debian repositorys hinzufügen
wget -O - http://debmon.org/debmon/repo.key 2>/dev/null | apt-key add - echo 'deb http://debmon.org/debmon debmon-jessie main' >/etc/apt/sources.list.d/debmon.list apt-get update
- ubuntu
unter ubuntu repositorys hinzufügen
apt install software-properties-common add-apt-repository ppa:formorer/icinga
- installieren
apt-get update apt-get upgrade apt-get install icinga2
Zertifikate
- nach dem alle system installiert wurden am besten die Zertifikate direkt angehen
- auf der cert authority für jeden host ein Zertifikate generieren
- dann auf die Zertifikate auf die hosts kopieren mit scp in den ordner /etc/icinga2/pki
- darauf achten das die hostname & Endpoint Name mit den Zertifikate übereinstimmen
Konfiguration
icinga Master Konfiguration
unser name & zone:
- Node Name = icinga-admin.xinux.org
- Zone Name = icinga-admin.xinux.org
zone name:
- icinga-admin.xinux.org = icinga-admin.xinux.org
- icinga-left.xinux.org = icinga-left.xinux.org
- icinga-right.xinux.org = icinga-right.xinux.org
Zone & Namen definieren
/etc/icinga2/constants.conf
const NodeName = "icinga-admin.xinux.org" const ZoneName = "icinga-admin.xinux.org"
Zone anlegen
- die zonen des masters anlegen
/etc/icinga2/zones.conf
object Endpoint "icinga-admin.xinux.org" {
host = "icinga-admin.xinux.org"
}
object Zone "icinga-admin.xinux.org" {
endpoints = [ "icinga-admin.xinux.org" ]
}
/*
* Global zone for templates
*/
object Zone "global-templates" {
global = true
}
Health-check erstellen
vi /etc/icinga2/cluster/icinga-admin.conf
/*
* cluster health checks
* icinga-admin as master node [x]
* icinga-left as a Satellite node
* icinga-right as a Satellite node
*/
object Host "icinga-admin" {
display_name = "Health Checks on icinga-admin"
address = "icinga-admin.xinux.org"
check_command = "hostalive"
}
object Host "icinga-left" {
display_name = "icinga-left"
address = "icinga-left.xinux.org"
check_command = "hostalive"
}
object Host "icinga-right" {
display_name = "icinga-right"
address = "icinga-right.xinux.org"
check_command = "hostalive"
}
object Service "cluster" {
check_command = "cluster"
check_interval = 5s
retry_interval = 1s
host_name = "icinga-admin"
}
object Service "icinga" {
check_command = "icinga"
max_check_attempts = 3
check_interval = 60s
retry_interval = 30s
host_name = "icinga-admin"
}
/* check if checker zone is connected */
object Service "cluster-zone-checker" {
check_command = "cluster-zone"
check_interval = 5s
retry_interval = 1s
vars.cluster_zone = "icinga-left"
host_name = "icinga-admin"
}
/* check if checker zone is connected */
object Service "cluster-zone-icinga-right" {
check_command = "cluster-zone"
check_interval = 5s
retry_interval = 1s
vars.cluster_zone = "icinga-right"
host_name = "icinga-admin"
}
Neue Konfiguration anwenden
/etc/icinga2/icinga2.conf
# include_recursive "conf.d" include_recursive "cluster"
- Templates anlegen
mkdir "icinga-right" "icinga-left" "icinga-admin" "global-templates" mv /etc/icinga2/conf.d/hosts.conf /etc/icinga2/zones.d/icinga-admin/ mv /etc/icinga2/conf.d/* /etc/icinga2/zones.d/global-templates
icinga state kopieren
scp /var/lib/icinga2/icinga2.state root@icinga-left.xinux.org:/var/lib/icinga2 scp /var/lib/icinga2/icinga2.state root@icinga-right.xinux.org:/var/lib/icinga2
Icinga neue hosts übernehmen
- in der nodliste müssten die neun node schon angezeigt werden (sofern sie schon online sind)
icinga2 node list
- mit node update-config werden die entsprechenden Einträge in repository.d angelegt
icinga2 node update-config
- nach einem reload werden die nodes auch im webinterface übernommen
service icinga2 reload
icinga right konfigurieren
- icinga left entsprechend anpassen
Zone & Namen definieren
/etc/icinga2/constants.conf
const NodeName = "icinga-right.xinux.org" const ZoneName = "icinga-right.xinux.org"
Zonen anlegen
/etc/icinga2/zones.conf
/*
* Generated by Icinga 2 node setup commands
* on 2016-07-04 09:14:01 +0000
*/
object Endpoint "icinga-admin.xinux.org" {
host = "icinga-admin.xinux.org"
port = "5665"
}
object Zone "master" {
endpoints = [ "icinga-admin.xinux.org" ]
}
object Endpoint "icinga-right.xinux.org" {
}
object Zone "icinga-right.xinux.org" {
//this is the local node = "icinga-right.xinux.org"
endpoints = [ "icinga-right.xinux.org" ]
parent = "master"
}
#ADD the below lines
/*
* Global zone for templates
*/
object Zone "global-templates" {
global = true
}
Health-check erstellen
mkdir /etc/icinga2/cluster
vi /etc/icinga2/cluster/icinga-right.conf
object Host "icinga-right" {
display_name = "Health Checks on icinga-right"
address = "icinga-right.xinux.org"
check_command = "hostalive"
}
object Service "cluster" {
check_command = "cluster"
check_interval = 5s
retry_interval = 1s
host_name = "icinga-right"
}
Konfiguration anwenden
sicherstellen das die neue Konfiguration benutzt wird /etc/icinga2/icinga2.conf
# include_recursive "conf.d" include_recursive "cluster"
Icinga neue hosts übernehmen
- in der nodliste müssten die neun node schon angezeigt werden (sofern sie schon online sind)
icinga2 node list
- mit node update-config werden die entsprechenden Einträge in repository.d angelegt
icinga2 node update-config
- nach einem reload werden die nodes auch im webinterface übernommen
service icinga2 reload
icinga-right-1 Konfigurieren
Zone & Namen definieren
/etc/icinga2/constants.conf
const ZoneName = "icinga-right-1.xinux.org" const NodeName = "icinga-right-1.xinux.org"
Zone anlegen
- die Zonen anlegen
/etc/icinga2/zones.conf
/*
* Generated by Icinga 2 node setup commands
* on 2016-07-04 13:28:43 +0000
*/
object Endpoint "icinga-right.xinux.org" {
host = "icinga-right.xinux.org"
port = "5665"
}
object Zone "master" {
endpoints = [ "icinga-right.xinux.org" ]
}
object Endpoint NodeName {
}
object Zone ZoneName {
endpoints = [ NodeName ]
parent = "master"
}
icinga neustarten
service icinga restart
Nütziches
Debuging
tail -f /var/log/icinga2/icinga2.log tail -f /var/log/icinga2/startup.log
links
https://wiki.icinga.org/display/howtos/Icinga2+Distributed+Cluster+Install+with+CentOS+6