Move zone specific configuration to zones.conf included in icinga2.conf.

Fixes #6208
This commit is contained in:
Michael Friedrich 2014-05-22 21:00:42 +02:00
parent 4fa42d6fd1
commit ec7d9b0f3d
6 changed files with 63 additions and 18 deletions

View File

@ -88,6 +88,12 @@ Icinga 2 supports [C/C++-style comments](#comments).
The `include` directive can be used to include other files.
/**
* The zones.conf defines zones for a cluster setup.
* Not required for single instance setups.
*/
include "zones.conf"
/**
* The Icinga Template Library (ITL) provides a number of useful templates
* and command definitions.
@ -136,6 +142,17 @@ The `constants.conf` configuration file can be used to define global constants:
/* Our local zone name. */
const ZoneName = NodeName
### <a id="zones-conf"></a> zones.conf
The `zones.conf` configuration file can be used to configure `Endpoint` and `Zone` objects
required for a [distributed zone setup](#distributed-monitoring-high-availability). By default
a local dummy zone is defined based on the `NodeName` constant defined in
[constants.conf](#constants-conf).
> **Note**
>
> Not required for single instance installations.
### <a id="localhost-conf"></a> localhost.conf

View File

@ -21,6 +21,7 @@ configure_file(icinga/icinga-classic-apache.conf.cmake ${CMAKE_CURRENT_BINARY_DI
install_if_not_exists(icinga2/icinga2.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
install_if_not_exists(icinga2/constants.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
install_if_not_exists(icinga2/zones.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
install_if_not_exists(icinga2/conf.d/commands.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
install_if_not_exists(icinga2/conf.d/downtimes.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
install_if_not_exists(icinga2/conf.d/generic-host.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)

View File

@ -7,21 +7,3 @@ object ApiListener "api" {
key_path = SysconfDir + "/icinga2/pki/" + NodeName + ".key"
ca_path = SysconfDir + "/icinga2/pki/ca.crt"
}
object Endpoint NodeName {
host = NodeName
}
object Zone ZoneName {
endpoints = [ NodeName ]
}
/*object Endpoint "satellite.example.org" {
host = "satellite.example.org"
}
object Zone "satellite" {
parent = "master"
endpoints = [ "satellite.example.org" ]
}*/

View File

@ -12,6 +12,12 @@
*/
include "constants.conf"
/**
* The zones.conf defines zones for a cluster setup.
* Not required for single instance setups.
*/
include "zones.conf"
/**
* The Icinga Template Library (ITL) provides a number of useful templates
* and command definitions.

38
etc/icinga2/zones.conf Normal file
View File

@ -0,0 +1,38 @@
/*
* Endpoint and Zone configuration for a cluster setup
* This local example requires `NodeName` defined in
* constants.conf.
*/
object Endpoint NodeName {
host = NodeName
}
object Zone ZoneName {
endpoints = [ NodeName ]
}
/*
* Read the documentation on how to configure
* a cluster setup with multiple zones.
*/
/*
object Endpoint "master.example.org" {
host = "master.example.org"
}
object Endpoint "satellite.example.org" {
host = "satellite.example.org"
}
object Zone "master" {
endpoints = [ "master.example.org" ]
}
object Zone "satellite" {
parent = "master"
endpoints = [ "satellite.example.org" ]
}
*/

View File

@ -409,6 +409,7 @@ exit 0
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/zones.d
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/zones.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/*.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/*.conf
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/localhost/*.conf