From e9fe0f4277df3ccf79f75974a9f8ad5c986aa5e0 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 23 Aug 2016 20:11:37 +0200 Subject: [PATCH 1/5] Docs: Fix notes formatting refs #12523 --- doc/6-distributed-monitoring.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/6-distributed-monitoring.md b/doc/6-distributed-monitoring.md index b6ce38df6..5f813a591 100644 --- a/doc/6-distributed-monitoring.md +++ b/doc/6-distributed-monitoring.md @@ -916,7 +916,9 @@ them from this directory and restart Icinga 2. The generated host object uses the `cluster-zone` check command as [health check](6-distributed-monitoring.md#distributed-monitoring-health-checks). -> **Tip** In case you want to blacklist or whitelist certain hosts and/or services +> **Tip** +> +> In case you want to blacklist or whitelist certain hosts and/or services > on the master, use the `icinga2 node {black,white}list` > commands. @@ -1113,6 +1115,7 @@ replicate cluster events amongst each other. In addition to that, several Icinga features can enable HA functionality. > **Note** +> > All nodes in the same zone require that you enable the same features for high-availability (HA). Overview: @@ -1292,6 +1295,7 @@ Open Icinga Web 2 and check the two newly created client hosts with two new serv -- one executed locally (`ping4`) and one using command endpoint (`disk`). > **Tip** +> > It's a good idea to add [health checks](6-distributed-monitoring.md#distributed-monitoring-health-checks) > to make sure that your cluster notifies you in case of failure. @@ -1535,6 +1539,7 @@ Open Icinga Web 2 and check the two newly created client hosts with two new serv -- one executed locally (`ping4`) and one using command endpoint (`disk`). > **Tip** +> > It's a good idea to add [health checks](6-distributed-monitoring.md#distributed-monitoring-health-checks) > to make sure that your cluster notifies you in case of failure. From ed15c1c29916e8a94456b39046ae853631715631 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Tue, 23 Aug 2016 20:20:15 +0200 Subject: [PATCH 2/5] Docs: Change tip/note formatting again refs #12523 --- doc/6-distributed-monitoring.md | 114 ++++++++++++-------------------- 1 file changed, 41 insertions(+), 73 deletions(-) diff --git a/doc/6-distributed-monitoring.md b/doc/6-distributed-monitoring.md index 5f813a591..6c75b5a51 100644 --- a/doc/6-distributed-monitoring.md +++ b/doc/6-distributed-monitoring.md @@ -29,13 +29,11 @@ Rephrasing this picture into more details: The following sections will refer to these roles and explain the differences and the possibilities this kind of setup offers. -> **Tip**: -> -> If you just want to install a single master node that monitors several hosts -> (i.e. Icinga 2 clients), continue reading -- we'll start with -> simple examples. -> In case you are planning a huge cluster setup with multiple levels and -> lots of clients, read on -- we'll deal with these cases later on. +**Tip**: If you just want to install a single master node that monitors several hosts +(i.e. Icinga 2 clients), continue reading -- we'll start with +simple examples. +In case you are planning a huge cluster setup with multiple levels and +lots of clients, read on -- we'll deal with these cases later on. The installation on each system is the same: You need to install the [Icinga 2 package](2-getting-started.md#setting-up-icinga2) and the required [plugins](2-getting-started.md#setting-up-check-plugins). @@ -175,9 +173,7 @@ Install the [Icinga 2 package](2-getting-started.md#setting-up-icinga2) and setu the required [plugins](2-getting-started.md#setting-up-check-plugins) if you haven't done so already. -> **Note** -> -> Windows is not supported for a master node setup. +**Note**: Windows is not supported for a master node setup. The next step is to run the `node wizard` CLI command. Prior to that ensure to collect the required information: @@ -572,10 +568,8 @@ The endpoint configuration could look like this, for example: Next, you need to define two zones. There is no naming convention, best practice is to either use `master`, `satellite`/`client-fqdn` or to choose region names for example `Europe`, `USA` and `Asia`, though. -> **Note** -> -> Each client requires its own zone and endpoint configuration. Best practice -> is to use the client's FQDN for all object names. +**Note**: Each client requires its own zone and endpoint configuration. Best practice +is to use the client's FQDN for all object names. The `master` zone is a parent of the `icinga2-client2.localdomain` zone: @@ -735,10 +729,8 @@ The endpoint configuration could look like this: Next, you need to define two zones. There is no naming convention, best practice is to either use `master`, `satellite`/`client-fqdn` or to choose region names for example `Europe`, `USA` and `Asia`, though. -> **Note** -> -> Each client requires its own zone and endpoint configuration. Best practice -> is to use the client's FQDN for all object names. +**Note**: Each client requires its own zone and endpoint configuration. Best practice +is to use the client's FQDN for all object names. The `master` zone is a parent of the `icinga2-client1.localdomain` zone: @@ -836,12 +828,10 @@ itself. You can also use the config sync inside a high-availability zone to ensure that all config objects are synced among zone members. -> **Note** -> -> You can only have one so-called "config master" in a zone which stores -> the configuration in the `zones.d` directory. -> Multiple nodes with configuration files in the `zones.d` directory are -> **not supported**. +**Note**: You can only have one so-called "config master" in a zone which stores +the configuration in the `zones.d` directory. +Multiple nodes with configuration files in the `zones.d` directory are +**not supported**. Now that you've learned the basics about the configuration sync, proceed with the [scenarios](6-distributed-monitoring.md#distributed-monitoring-scenarios) @@ -916,11 +906,9 @@ them from this directory and restart Icinga 2. The generated host object uses the `cluster-zone` check command as [health check](6-distributed-monitoring.md#distributed-monitoring-health-checks). -> **Tip** -> -> In case you want to blacklist or whitelist certain hosts and/or services -> on the master, use the `icinga2 node {black,white}list` -> commands. +**Tip**: In case you want to blacklist or whitelist certain hosts and/or services +on the master, use the `icinga2 node {black,white}list` +commands. In this example we're first putting all `ping*` services on all hosts on the blacklist. With the next command we allow the host `probe` to run the service `ping4`: @@ -1114,9 +1102,7 @@ The setup uses the capabilities of the Icinga 2 cluster. All zone members replicate cluster events amongst each other. In addition to that, several Icinga 2 features can enable HA functionality. -> **Note** -> -> All nodes in the same zone require that you enable the same features for high-availability (HA). +**Note**: All nodes in the same zone require that you enable the same features for high-availability (HA). Overview: @@ -1294,10 +1280,8 @@ Validate the configuration and restart Icinga 2 on the master node `icinga2-mast Open Icinga Web 2 and check the two newly created client hosts with two new services -- one executed locally (`ping4`) and one using command endpoint (`disk`). -> **Tip** -> -> It's a good idea to add [health checks](6-distributed-monitoring.md#distributed-monitoring-health-checks) -> to make sure that your cluster notifies you in case of failure. +**Tip**: It's a good idea to add [health checks](6-distributed-monitoring.md#distributed-monitoring-health-checks) +to make sure that your cluster notifies you in case of failure. ### Three Levels with Master, Satellites, and Clients @@ -1308,10 +1292,8 @@ This scenario combines everything you've learned so far: High-availability maste satellites receiving their config from the master zone, and clients checked via command endpoint from the satellite zones. -> **Tip** -> -> It can get complicated, so grab a pen and paper and bring your thoughts to life. -> Play around with a test setup before using it in a production environment! +**Tip**: It can get complicated, so grab a pen and paper and bring your thoughts to life. +Play around with a test setup before using it in a production environment! Overview: @@ -1538,10 +1520,8 @@ Validate the configuration and restart Icinga 2 on the master node `icinga2-mast Open Icinga Web 2 and check the two newly created client hosts with two new services -- one executed locally (`ping4`) and one using command endpoint (`disk`). -> **Tip** -> -> It's a good idea to add [health checks](6-distributed-monitoring.md#distributed-monitoring-health-checks) -> to make sure that your cluster notifies you in case of failure. +**Tip**: It's a good idea to add [health checks](6-distributed-monitoring.md#distributed-monitoring-health-checks) +to make sure that your cluster notifies you in case of failure. ## Best Practice @@ -1565,10 +1545,8 @@ configuration files only. Use your preferred package repository and/or configuration management tool (Puppet, Ansible, Chef, etc.) for that. -> **Note** -> -> Checkable objects (hosts and services) cannot be put into a global -> zone. The configuration validation will terminate with an error. +**Note**: Checkable objects (hosts and services) cannot be put into a global +zone. The configuration validation will terminate with an error. The zone object configuration must be deployed on all nodes which should receive the global configuration files: @@ -1597,10 +1575,8 @@ before restarting the parent master/satellite nodes. Then validate the configuration on the master node and restart Icinga 2. -> **Tip** -> -> You can copy the example configuration files located in `/etc/icinga2/conf.d` -> into your global zone. +**Tip**: You can copy the example configuration files located in `/etc/icinga2/conf.d` +into your global zone. Example: @@ -1828,15 +1804,13 @@ By default the DB IDO feature only runs on one node. All other nodes in the same the active IDO database connection at runtime. The node with the active DB IDO connection is not necessarily the zone master. -> **Note** -> -> The DB IDO HA feature can be disabled by setting the `enable_ha` attribute to `false` -> for the [IdoMysqlConnection](9-object-types.md#objecttype-idomysqlconnection) or -> [IdoPgsqlConnection](9-object-types.md#objecttype-idopgsqlconnection) object on **all** nodes in the -> **same** zone. -> -> All endpoints will enable the DB IDO feature and connect to the configured -> database and dump configuration, status and historical data on their own. +**Note**: The DB IDO HA feature can be disabled by setting the `enable_ha` attribute to `false` +for the [IdoMysqlConnection](9-object-types.md#objecttype-idomysqlconnection) or +[IdoPgsqlConnection](9-object-types.md#objecttype-idopgsqlconnection) object on **all** nodes in the +**same** zone. + +All endpoints will enable the DB IDO feature and connect to the configured +database and dump configuration, status and historical data on their own. If the instance with the active DB IDO connection dies, the HA functionality will automatically elect a new DB IDO master. @@ -1888,10 +1862,8 @@ It is not necessary that both the master and the client node establish two connections to each other. Icinga 2 will only use one connection and close the second connection if established. -> **Tip** -> -> Choose either to let master/satellite nodes connect to client nodes -> or vice versa. +**Tip**: Choose either to let master/satellite nodes connect to client nodes +or vice versa. ### Disable Log Duration for Command Endpoints @@ -2037,10 +2009,8 @@ Once the setup is completed you can use the `node setup` cli command too. Instead of using the `node wizard` CLI command, there is an alternative `node setup` command available which has some prerequisites. -> **Note** -> -> The CLI command can be used on Linux/Unix and Windows operating systems. -> The graphical Windows setup wizard actively uses these CLI commands. +**Note**: The CLI command can be used on Linux/Unix and Windows operating systems. +The graphical Windows setup wizard actively uses these CLI commands. #### Node Setup on the Master Node @@ -2266,8 +2236,6 @@ was executed inside the Docker client. ![Icinga 2 Client Automation Docker](images/distributed-monitoring/icinga2_distributed_automation_docker_client_icingaweb2.png) -> **Note** -> -> This is a volatile example using Docker. Build your own Docker -> container client using these examples. +**Note**: This is a volatile example using Docker. Build your own Docker +container client using these examples. From 8c1fc813d168e733bd55a2c3f49ac317ee6eeb0f Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 24 Aug 2016 11:13:19 +0200 Subject: [PATCH 3/5] Fix incorrect notifications for soft recoveries fixes #12529 --- lib/icinga/checkable-check.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/icinga/checkable-check.cpp b/lib/icinga/checkable-check.cpp index a064a80ae..00e48232b 100644 --- a/lib/icinga/checkable-check.cpp +++ b/lib/icinga/checkable-check.cpp @@ -183,7 +183,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig if (IsStateOK(cr->GetState())) { SetStateType(StateTypeHard); // NOT-OK -> HARD OK - if (old_stateType == StateTypeHard && !IsStateOK(old_state)) + if (!IsStateOK(old_state)) recovery = true; ResetNotificationNumbers(); @@ -278,7 +278,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig if (notification_reachable && !in_downtime && !IsAcknowledged()) { /* Send notifications whether when a hard state change occured. */ - if (hardChange) + if (hardChange && !(old_stateType == StateTypeSoft && IsStateOK(new_state))) send_notification = true; /* Or if the checkable is volatile and in a HARD state. */ else if (is_volatile && GetStateType() == StateTypeHard) @@ -383,17 +383,9 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig NotifyFlapping(origin); } - if (recovery) { - /* Recovery notifications must be sent any time. - * Users who where notified about a problem before - * will be filtered when processing the notification. - */ + if (send_notification && !is_flapping) { if (!IsPaused()) - OnNotificationsRequested(this, NotificationRecovery, cr, "", "", MessageOrigin::Ptr()); - } else if (send_notification && !is_flapping) { - /* Problem notifications */ - if (!IsPaused()) - OnNotificationsRequested(this, NotificationProblem, cr, "", "", MessageOrigin::Ptr()); + OnNotificationsRequested(this, recovery ? NotificationRecovery : NotificationProblem, cr, "", "", MessageOrigin::Ptr()); } } From b238df3fa3d58a9bc0a5729056adc074268622a4 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 24 Aug 2016 11:35:12 +0200 Subject: [PATCH 4/5] Fix missing IDO updates for groups fixes #12527 --- lib/db_ido/hostdbobject.cpp | 5 +++++ lib/db_ido/servicedbobject.cpp | 5 +++++ lib/db_ido/userdbobject.cpp | 14 ++++++++++++++ lib/db_ido/userdbobject.hpp | 2 ++ 4 files changed, 26 insertions(+) diff --git a/lib/db_ido/hostdbobject.cpp b/lib/db_ido/hostdbobject.cpp index 7292338ac..30ef27a30 100644 --- a/lib/db_ido/hostdbobject.cpp +++ b/lib/db_ido/hostdbobject.cpp @@ -397,6 +397,11 @@ String HostDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) co Host::Ptr host = static_pointer_cast(GetObject()); + Array::Ptr groups = host->GetGroups(); + + if (groups) + hashData += DbObject::HashValue(groups); + Array::Ptr parents = new Array(); /* parents */ diff --git a/lib/db_ido/servicedbobject.cpp b/lib/db_ido/servicedbobject.cpp index 921e15960..b9009097f 100644 --- a/lib/db_ido/servicedbobject.cpp +++ b/lib/db_ido/servicedbobject.cpp @@ -357,6 +357,11 @@ String ServiceDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) Service::Ptr service = static_pointer_cast(GetObject()); + Array::Ptr groups = service->GetGroups(); + + if (groups) + hashData += DbObject::HashValue(groups); + Array::Ptr dependencies = new Array(); /* dependencies */ diff --git a/lib/db_ido/userdbobject.cpp b/lib/db_ido/userdbobject.cpp index 60fe460e6..c50a78e71 100644 --- a/lib/db_ido/userdbobject.cpp +++ b/lib/db_ido/userdbobject.cpp @@ -163,3 +163,17 @@ void UserDbObject::OnConfigUpdateHeavy(void) DbObject::OnMultipleQueries(queries); } + +String UserDbObject::CalculateConfigHash(const Dictionary::Ptr& configFields) const +{ + String hashData = DbObject::CalculateConfigHash(configFields); + + User::Ptr user = static_pointer_cast(GetObject()); + + Array::Ptr groups = user->GetGroups(); + + if (groups) + hashData += DbObject::HashValue(groups); + + return hashData; +} diff --git a/lib/db_ido/userdbobject.hpp b/lib/db_ido/userdbobject.hpp index 20f18fa21..2aa90be48 100644 --- a/lib/db_ido/userdbobject.hpp +++ b/lib/db_ido/userdbobject.hpp @@ -43,6 +43,8 @@ protected: virtual Dictionary::Ptr GetStatusFields(void) const override; virtual void OnConfigUpdateHeavy(void) override; + + virtual String CalculateConfigHash(const Dictionary::Ptr& configFields) const; }; } From e33dffcbba19f2e5ffd461b4adeaa408e2a0dd9d Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Wed, 24 Aug 2016 14:05:44 +0200 Subject: [PATCH 5/5] Release version 2.5.2 --- ChangeLog | 7 +++++++ RELEASE.md | 20 ++++++++++---------- doc/1-about.md | 7 +++++++ icinga2.nuspec | 2 +- icinga2.spec | 2 +- tools/chocolateyInstall.ps1 | 4 ++-- 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61d17916d..2719b53d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,13 @@ Please check [doc/1-about.md]. ## What's New +### What's New in Version 2.5.2 + +#### Bugfixes + +* Bug 12527 (DB IDO): Newly added group member tables in the IDO database are not updated +* Bug 12529 (Checker): Icinga 2 sends SOFT recovery notifications + ### What's New in Version 2.5.1 #### Bugfixes diff --git a/RELEASE.md b/RELEASE.md index 26c35752c..3e2d54fc4 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -12,9 +12,9 @@ Check the following issue filters: ## Backport Commits $ git checkout master - $ ./pick.py -V 2.4.9 + $ ./pick.py -V 2.5.2 -The script creates a new branch 'auto-merged-2.4.9' which is based on the +The script creates a new branch 'auto-merged-2.5.2' which is based on the current support branch. It then merges all commits from the 'master' branch which reference a ticket for the version that was specified. @@ -25,8 +25,8 @@ rebase until no commits are left: After finishing the rebase the branch needs to be merged into the support branch: - $ git checkout support/2.4 - $ git merge --ff-only auto-merged-2.4.9 + $ git checkout support/2.5 + $ git merge --ff-only auto-merged-2.5.2 ## Authors @@ -86,16 +86,16 @@ Push the tag. For major releases: Create a new "support" branch: $ git checkout master - $ git checkout -b support/2.4 - $ git push -u origin support/2.4 + $ git checkout -b support/2.5 + $ git push -u origin support/2.5 For minor releases: Push the support branch, cherry-pick the release commit into master and merge the support branch: - $ git push -u origin support/2.4 + $ git push -u origin support/2.5 $ git checkout master - $ git cherry-pick support/2.4 - $ git merge --strategy=ours support/2.4 + $ git cherry-pick support/2.5 + $ git merge --strategy=ours support/2.5 $ git push origin master # External Dependencies @@ -141,7 +141,7 @@ Create the nupkg package: Install the created icinga2 package locally: - choco install icinga2 -version 2.5.0 -fdv "%cd%" -source "'%cd%;https://chocolatey.org/api/v2/'" + choco install icinga2 -version 2.5.2 -fdv "%cd%" -source "'%cd%;https://chocolatey.org/api/v2/'" Upload the package to [chocolatey](https://chocolatey.org/packages/upload). diff --git a/doc/1-about.md b/doc/1-about.md index 77ab0bb19..f3e749f90 100644 --- a/doc/1-about.md +++ b/doc/1-about.md @@ -54,6 +54,13 @@ More details in the [Icinga FAQ](https://www.icinga.org/icinga/faq/). ## What's New +### What's New in Version 2.5.2 + +#### Bugfixes + +* Bug [12527](https://dev.icinga.org/issues/12527 "Bug 12527") (DB IDO): Newly added group member tables in the IDO database are not updated +* Bug [12529](https://dev.icinga.org/issues/12529 "Bug 12529") (Checker): Icinga 2 sends SOFT recovery notifications + ### What's New in Version 2.5.1 #### Bugfixes diff --git a/icinga2.nuspec b/icinga2.nuspec index 1624c17d0..883ae46eb 100755 --- a/icinga2.nuspec +++ b/icinga2.nuspec @@ -6,7 +6,7 @@ icinga2 Icinga2 - 2.5.1 + 2.5.2 2016 - The Icinga Project Icinga Development Team icinga2 - Monitoring Agent for Windows diff --git a/icinga2.spec b/icinga2.spec index 6726d781f..15c39f6cd 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -66,7 +66,7 @@ Summary: Network monitoring application Name: icinga2 -Version: 2.5.1 +Version: 2.5.2 Release: %{revision}%{?dist} License: GPL-2.0+ Group: Applications/System diff --git a/tools/chocolateyInstall.ps1 b/tools/chocolateyInstall.ps1 index d5afe5e25..0532d0b52 100755 --- a/tools/chocolateyInstall.ps1 +++ b/tools/chocolateyInstall.ps1 @@ -1,7 +1,7 @@ $packageName = 'icinga2' $installerType = 'msi' -$url32 = 'http://packages.icinga.org/windows/Icinga2-v2.5.1-x86.msi' -$url64 = 'http://packages.icinga.org/windows/Icinga2-v2.5.1-x86_64.msi' +$url32 = 'http://packages.icinga.org/windows/Icinga2-v2.5.2-x86.msi' +$url64 = 'http://packages.icinga.org/windows/Icinga2-v2.5.2-x86_64.msi' $silentArgs = '/qn /norestart' $validExitCodes = @(0)