mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-30 00:54:30 +02:00
Move zone specific configuration to zones.conf included in icinga2.conf.
Fixes #6208
This commit is contained in:
parent
4fa42d6fd1
commit
ec7d9b0f3d
@ -88,6 +88,12 @@ Icinga 2 supports [C/C++-style comments](#comments).
|
|||||||
|
|
||||||
The `include` directive can be used to include other files.
|
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
|
* The Icinga Template Library (ITL) provides a number of useful templates
|
||||||
* and command definitions.
|
* and command definitions.
|
||||||
@ -136,6 +142,17 @@ The `constants.conf` configuration file can be used to define global constants:
|
|||||||
/* Our local zone name. */
|
/* Our local zone name. */
|
||||||
const ZoneName = NodeName
|
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
|
### <a id="localhost-conf"></a> localhost.conf
|
||||||
|
|
||||||
|
@ -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/icinga2.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2)
|
||||||
install_if_not_exists(icinga2/constants.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/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/downtimes.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
||||||
install_if_not_exists(icinga2/conf.d/generic-host.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
install_if_not_exists(icinga2/conf.d/generic-host.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
|
||||||
|
@ -7,21 +7,3 @@ object ApiListener "api" {
|
|||||||
key_path = SysconfDir + "/icinga2/pki/" + NodeName + ".key"
|
key_path = SysconfDir + "/icinga2/pki/" + NodeName + ".key"
|
||||||
ca_path = SysconfDir + "/icinga2/pki/ca.crt"
|
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" ]
|
|
||||||
}*/
|
|
||||||
|
|
||||||
|
@ -12,6 +12,12 @@
|
|||||||
*/
|
*/
|
||||||
include "constants.conf"
|
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
|
* The Icinga Template Library (ITL) provides a number of useful templates
|
||||||
* and command definitions.
|
* and command definitions.
|
||||||
|
38
etc/icinga2/zones.conf
Normal file
38
etc/icinga2/zones.conf
Normal 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" ]
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
@ -409,6 +409,7 @@ exit 0
|
|||||||
%attr(0750,%{icinga_user},%{icinga_group}) %dir %{_sysconfdir}/%{name}/zones.d
|
%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}/%{name}.conf
|
||||||
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/constants.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/*.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/*.conf
|
||||||
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/localhost/*.conf
|
%config(noreplace) %attr(0640,%{icinga_user},%{icinga_group}) %{_sysconfdir}/%{name}/conf.d/hosts/localhost/*.conf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user