Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): merge release 22.04.1 into 22.04.x #349

Merged
merged 31 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
95e58a2
enh(broker/mysql_connection): unix socket is different on Debian or o…
bouda1 Jun 13, 2022
ea327d5
Mon 13562 sonar atoi 22.04.x.new (#290)
denliA Jun 21, 2022
a81829a
enh(ccc): new grpc client
bouda1 Jun 21, 2022
3af3790
fix(engine): when display_name is empty, it should be replaced by des…
bouda1 Jun 21, 2022
a23c890
enh(tests): database credentials configurable from resource.robot (#2…
denliA Jun 21, 2022
665dd9c
fix(engine): checkable::name() conflicted with host::name()
bouda1 Jun 21, 2022
1a4c987
Mon 13901 cbd multiargs 22.04.x (#293)
denliA Jun 23, 2022
5bc8326
Mon 13562 sonar unsigned bitwise operator (#294) (#295)
denliA Jun 24, 2022
9590659
enh(sonar): ignore postgresql in bam folder (#296) (#298)
denliA Jun 27, 2022
03643e6
enh(sonar): change reserved name to a non reserved one (#297) (#301)
denliA Jun 29, 2022
18e68a5
fix(broker/bam): downtimes on kpi can be more than one
bouda1 Jun 30, 2022
161271d
fix(broker): rebuild/remove graphs has come back
bouda1 Jul 5, 2022
f6b067e
enh(ccc): ccc is functional
bouda1 Jul 8, 2022
512bca7
MON-14166 fix bbdo compression nego (#316)
jean-christophe81 Jul 8, 2022
9dbe605
Mon 13562 sonar atoi external command (#302) (#318)
denliA Jul 12, 2022
027dbf6
fix(broker/engine): grpc api can be changed throught configuration. O…
bouda1 Jul 12, 2022
fc26741
fix(broker/bam): detection of downtime end was bad (#319)
bouda1 Jul 12, 2022
edf12a5
fix(engine): bad rebase fixed here
bouda1 Jul 12, 2022
d90a049
enh(sonar) : replace new by make_shared or make_unique (#322) (#326)
denliA Jul 18, 2022
8a0651e
fix(robot): fix robot BEATOI tests 22.04 (#325)
denliA Jul 18, 2022
e14ed0b
Mon 14198 sonar dynamic allocations (#327) (#328)
denliA Jul 25, 2022
65487df
fix(broker/rebuild): error in sql query
bouda1 Jul 28, 2022
1223736
fix(broker/rebuild): creation date of rrd file too late
bouda1 Jul 28, 2022
5316762
fix(ci): update dockerfile centos7 for python38 (#337)
rem31 Jul 29, 2022
dbf0b7d
fix(ci/debian): set shell to centreon-engine user (#334)
lgcosta Jul 29, 2022
0abe027
fix(ci): issue with conan fixed
bouda1 Jul 29, 2022
8269b22
fix(ci/scripts): conan bad path
bouda1 Aug 1, 2022
7e68f4e
enh(engine/anomalydetection): Enable recheck for anomaly-detection se…
jean-christophe81 Aug 3, 2022
cd461bc
fix(ci/tests): dateutil missing for robot
bouda1 Aug 3, 2022
7262cbc
fix(ci): correct syntax
chgautier Aug 30, 2022
ea82d0b
Merge branch '22.04.x' into release-22.04.1
chgautier Aug 30, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(broker/bam): detection of downtime end was bad (#319)
* fix(tests/bam): sometimes broker is too long to stop
* fix(tests/summary): new options -f and -s
* fix(conanfile): openssl updated

REFS: MON-14091
  • Loading branch information
bouda1 committed Jul 12, 2022
commit fc2674103e8f4e9ad68001a2b96f70ed9bae5d87
2 changes: 1 addition & 1 deletion broker/bam/src/ba.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Copyright 2014-2016, 2021 Centreon
** Copyright 2014-2016, 2021-2022 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
Expand Down
8 changes: 4 additions & 4 deletions broker/bam/src/kpi_service.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
** Copyright 2014-2015, 2021 Centreon
** Copyright 2014-2015, 2021-2022 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -181,7 +181,7 @@ bool kpi_service::is_acknowledged() const {
* @param[out] visitor Object that will receive events.
*/
void kpi_service::service_update(
std::shared_ptr<neb::service_status> const& status,
const std::shared_ptr<neb::service_status>& status,
io::stream* visitor) {
if (status && status->host_id == _host_id &&
status->service_id == _service_id) {
Expand Down Expand Up @@ -298,15 +298,15 @@ void kpi_service::service_update(
* @param[in] dt
* @param[out] visitor Object that will receive events.
*/
void kpi_service::service_update(std::shared_ptr<neb::downtime> const& dt,
void kpi_service::service_update(const std::shared_ptr<neb::downtime>& dt,
io::stream* visitor) {
assert(dt && dt->host_id == _host_id && dt->service_id == _service_id);
// Update information.
bool downtimed = dt->was_started && dt->actual_end_time.is_null();
if (!_downtimed && downtimed)
_downtimed = true;

if (_downtime_ids.contains(dt->internal_id) && !dt->was_cancelled) {
if (_downtime_ids.contains(dt->internal_id) && dt->deletion_time.is_null()) {
log_v2::bam()->trace("Downtime {} already handled in this kpi service",
dt->internal_id);
return;
Expand Down
1 change: 1 addition & 0 deletions broker/bam/test/ba/kpi_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,7 @@ TEST_F(BamBA, KpiServiceDt) {
std::cout << "service_update 1" << std::endl;
kpis[0]->service_update(dt, _visitor.get());

dt->deletion_time = now + 2 + 10 * i + 5;
dt->actual_end_time = now + 2 + 10 * i + 5;
dt->was_cancelled = true;
std::cout << "service_update 2" << std::endl;
Expand Down
4 changes: 1 addition & 3 deletions ci/docker/Dockerfile.collect-debian11-dependencies
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM debian:bullseye
RUN apt-get -y update && \
apt-get -y install cmake \
apt-get -y install cmake \
curl \
gcc \
g++ \
Expand Down Expand Up @@ -36,5 +36,3 @@ COPY conanfile.txt .
RUN cat conanfile.txt
RUN conan install . -s compiler.cppstd=14 -s compiler.libcxx=libstdc++11 --build='missing'
WORKDIR /src


2 changes: 1 addition & 1 deletion ci/scripts/collect-unit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ tests/ut_broker --gtest_output=xml:ut_broker.xml
tests/ut_engine --gtest_output=xml:ut_engine.xml
tests/ut_clib --gtest_output=xml:ut_clib.xml
tests/ut_connector --gtest_output=xml:ut_connector.xml
echo "---------------------------------------------------------- end of ut tests ------------------------------------------------"
echo "---------------------------------------------------------- end of ut tests ------------------------------------------------"
14 changes: 10 additions & 4 deletions conanfile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ asio/1.22.1
fmt/8.1.1
spdlog/1.10.0
nlohmann_json/3.10.5
openssl/1.1.1n
grpc/1.43.0
openssl/1.1.1o
grpc/1.46.3
mariadb-connector-c/3.1.12
zlib/1.2.12
boost/1.79.0
Expand All @@ -15,7 +15,13 @@ libssh2/1.10.0
cmake

[options]
grpc:secure=True
boost:header_only=True
grpc:csharp_ext=False
grpc:csharp_plugin=False
grpc:node_plugin=False
grpc:objective_c_plugin=False
grpc:php_plugin=False
grpc:python_plugin=True
grpc:ruby_plugin=False
grpc:secure=True
libssh2:shared=False

8 changes: 3 additions & 5 deletions engine/inc/com/centreon/engine/configuration/state.hh
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,11 @@ class state {
int perfdata_timeout() const noexcept;
void perfdata_timeout(int value);
std::string const& poller_name() const noexcept;
void poller_name(std::string const& value) noexcept;
void poller_name(std::string const& value);
uint32_t poller_id() const noexcept;
void poller_id(uint32_t value) noexcept;
void poller_id(uint32_t value);
uint16_t rpc_port() const noexcept;
void rpc_port(uint16_t value) noexcept;
const std::string& rpc_listen_address() const noexcept;
void rpc_listen_address(const std::string& listen_address) noexcept;
void rpc_port(uint16_t value);
bool process_performance_data() const noexcept;
void process_performance_data(bool value);
std::list<std::string> const& resource_file() const noexcept;
Expand Down
8 changes: 4 additions & 4 deletions engine/src/configuration/state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2798,7 +2798,7 @@ std::string const& state::poller_name() const noexcept {
*
* @param[in] value The new poller_name value.
*/
void state::poller_name(std::string const& value) noexcept {
void state::poller_name(std::string const& value) {
_poller_name = value;
}

Expand All @@ -2816,7 +2816,7 @@ uint32_t state::poller_id() const noexcept {
*
* @param[in] value The new poller_id value.
*/
void state::poller_id(uint32_t value) noexcept {
void state::poller_id(uint32_t value) {
_poller_id = value;
}

Expand All @@ -2834,7 +2834,7 @@ uint16_t state::rpc_port() const noexcept {
*
* @param[in] value The new poller_id value.
*/
void state::rpc_port(uint16_t value) noexcept {
void state::rpc_port(uint16_t value) {
_rpc_port = value;
}

Expand All @@ -2852,7 +2852,7 @@ const std::string& state::rpc_listen_address() const noexcept {
*
* @param[in] value The new grpc api listen address.
*/
void state::rpc_listen_address(const std::string& listen_address) noexcept {
void state::rpc_listen_address(const std::string& listen_address) {
_rpc_listen_address = listen_address;
}

Expand Down
101 changes: 97 additions & 4 deletions tests/bam/inherited_downtime.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
Resource ../resources/resources.robot
Suite Setup Clean Before Suite
Suite Teardown Clean After Suite
Test Setup Stop Processes
Test Setup BAM Setup

Documentation Centreon Broker and BAM
Library Process
Library DatabaseLibrary
Library DateTime
Library OperatingSystem
Library ../resources/Broker.py
Library ../resources/Engine.py
Expand Down Expand Up @@ -60,7 +62,7 @@ BEBAMIDT1
Should Be True ${result} msg=The BA ba_1 is in downtime as it should not

Stop Engine
Stop Broker
Kindly Stop Broker

BEBAMIDT2
[Documentation] A BA of type 'worst' with one service is configured. The BA is in critical state, because of its service. Then we set a downtime on this last one. An inherited downtime is set to the BA. Engine is restarted. Broker is restarted. The two downtimes are still there with no duplicates. The downtime is removed from the service, the inherited downtime is then deleted.
Expand Down Expand Up @@ -105,7 +107,7 @@ BEBAMIDT2
Start Engine
Sleep 3s
# Broker is restarted
Stop Broker
Kindly Stop Broker
Start Broker
END

Expand All @@ -126,7 +128,7 @@ BEBAMIDT2
Should Be True ${result} msg=We should have no more downtime

Stop Engine
Stop Broker
Kindly Stop Broker

BEBAMIGNDT1
[Documentation] A BA of type 'worst' with two services is configured. The downtime policy on this ba is "Ignore the indicator in the calculation". The BA is in critical state, because of the second critical service. Then we apply two downtimes on this last one. The BA state is ok because of the policy on indicators. A first downtime is cancelled, the BA is still OK, but when the second downtime is cancelled, the BA should be CRITICAL.
Expand Down Expand Up @@ -209,3 +211,94 @@ BEBAMIGNDT1
Stop Engine
Kindly Stop Broker

BEBAMIGNDT2
[Documentation] A BA of type 'worst' with two services is configured. The downtime policy on this ba is "Ignore the indicator in the calculation". The BA is in critical state, because of the second critical service. Then we apply two downtimes on this last one. The BA state is ok because of the policy on indicators. The first downtime reaches its end, the BA is still OK, but when the second downtime reaches its end, the BA should be CRITICAL.
[Tags] broker downtime engine bam
Clear Commands Status
Config Broker module
Config Broker central
Broker Config Log central core error
Broker Config Log central bam trace
Config Broker rrd
Config Engine ${1}

Clone Engine Config To DB
Add Bam Config To Engine

@{svc}= Set Variable ${{ [("host_16", "service_313"), ("host_16", "service_314")] }}
Create BA With Services test worst ${svc} ignore
Add Bam Config To Broker central
# Command of service_314 is set to critical
${cmd_1}= Get Command Id 313
Log To Console service_314 has command id ${cmd_1}
Set Command Status ${cmd_1} 0
${cmd_2}= Get Command Id 314
Log To Console service_314 has command id ${cmd_2}
Set Command Status ${cmd_2} 2
Start Broker
Start Engine
Sleep 5s

# KPI set to ok
Repeat Keyword 3 times Process Service Check Result host_16 service_313 0 output critical for 313
${result}= Check Service Status With Timeout host_16 service_313 0 60
Should Be True ${result} msg=The service (host_16,service_313) is not OK as expected

# KPI set to critical
Repeat Keyword 3 times Process Service Check Result host_16 service_314 2 output critical for 314
${result}= Check Service Status With Timeout host_16 service_314 2 60
Should Be True ${result} msg=The service (host_16,service_314) is not CRITICAL as expected

# The BA should become critical
${result}= Check Ba Status With Timeout test 2 60
Should Be True ${result} msg=The BA ba_1 is not CRITICAL as expected
Log To console The BA is critical.

# Two downtimes are applied on service_314
Schedule Service Downtime host_16 service_314 60
${result}= Check Service Downtime With Timeout host_16 service_314 1 60
Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be
Log to console One downtime applied to service_314.

Schedule Service Downtime host_16 service_314 30
${result}= Check Service Downtime With Timeout host_16 service_314 2 60
Should Be True ${result} msg=The service (host_16, service_314) is not in downtime as it should be
Log to console Two downtimes applied to service_314.

${result}= Check Service Downtime With Timeout _Module_BAM_1 ba_1 0 60
Should Be True ${result} msg=The BA ba_1 is in downtime but should not
Log to console The BA is configured to ignore kpis in downtime

${result}= Check Ba Status With Timeout test 0 60
Should Be True ${result} msg=The service in downtime should be ignored while computing the state of this BA.
Log to console The BA is OK, since the critical service is in downtime.

# The first downtime should reach its end

Log to console After 30s, the first downtime should be finished.
${result}= Check Service Downtime With Timeout host_16 service_314 1 60
Should Be True ${result} msg=The service (host_16, service_314) does not contain 1 downtime as it should
Log to console Still one downtime applied to service_314.

Log to console After 30s, the second downtime should be finished.
${result}= Check Ba Status With Timeout test 0 60
Should Be True ${result} msg=The BA is not OK whereas the service_314 is still in downtime.
Log to console The BA is still OK

# The second downtime finishes
${result}= Check Ba Status With Timeout test 2 60
Should Be True ${result} msg=The critical service is no more in downtime, the BA should be critical.
Log to console The BA is now critical (no more downtime)

Stop Engine
Kindly Stop Broker

*** Keywords ***
BAM Setup
Stop Processes
Connect To Database pymysql ${DBName} ${DBUser} ${DBPass} ${DBHost} ${DBPort}
${date}= Get Current Date result_format=epoch
log to console date=${date}
Query UPDATE downtimes SET deletion_time=${date}, actual_end_time=${date} WHERE actual_end_time is null


8 changes: 4 additions & 4 deletions tests/broker-engine/bbdo-protobuf.robot
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ BEPBBEE1
${result}= Find In Log with timeout ${centralLog} ${start} ${content} 30
Should Be True ${result} msg=Message about not matching bbdo versions not available
Stop Engine
Stop Broker
Kindly Stop Broker

BEPBBEE2
[Documentation] bbdo_version 3 not compatible with sql/storage
Expand Down Expand Up @@ -74,7 +74,7 @@ BEPBBEE3
Start Engine
Wait Until Created /tmp/pbservicestatus.log 1m
Stop Engine
Stop Broker
Kindly Stop Broker

BEPBBEE4
[Documentation] bbdo_version 3 generates new bbdo protobuf host status messages.
Expand All @@ -96,7 +96,7 @@ BEPBBEE4
Start Engine
Wait Until Created /tmp/pbhoststatus.log 1m
Stop Engine
Stop Broker
Kindly Stop Broker

BEPBBEE5
[Documentation] bbdo_version 3 generates new bbdo protobuf service messages.
Expand All @@ -118,4 +118,4 @@ BEPBBEE5
Start Engine
Wait Until Created /tmp/pbservice.log 1m
Stop Engine
Stop Broker
Kindly Stop Broker
2 changes: 1 addition & 1 deletion tests/broker-engine/compression.robot
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ BECC1
Start Engine
${result}= Check Connections
Should Be True ${result} msg=Engine and Broker not connected
Stop Broker
Kindly Stop Broker
Stop Engine
${content1}= Create List we have extensions '${ext["${comp1}"]}' and peer has '${ext["${comp2}"]}'
${content2}= Create List we have extensions '${ext["${comp2}"]}' and peer has '${ext["${comp1}"]}'
Expand Down
2 changes: 1 addition & 1 deletion tests/broker-engine/hostgroups.robot
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ EBNHG1
${result}= Find In Log With Timeout ${centralLog} ${start} ${content} 45
Should Be True ${result} msg=One of the new host groups not found in logs.
Stop Engine
Stop Broker
Kindly Stop Broker

EBNHGU1
[Documentation] New host group with several pollers and connections to DB with broker configured with unified_sql
Expand Down
Loading