Skip to content

Commit

Permalink
enh(broker/neb): instance_configuration not used
Browse files Browse the repository at this point in the history
  • Loading branch information
bouda1 committed Feb 29, 2024
1 parent 4bdde5e commit e7f9c56
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 306 deletions.
2 changes: 0 additions & 2 deletions broker/neb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ set(NEB_SOURCES
${SRC_DIR}/host_service_status.cc
${SRC_DIR}/host_status.cc
${SRC_DIR}/instance.cc
${SRC_DIR}/instance_configuration.cc
${SRC_DIR}/instance_status.cc
${SRC_DIR}/log_entry.cc
${SRC_DIR}/responsive_instance.cc
Expand Down Expand Up @@ -76,7 +75,6 @@ set(NEB_SOURCES
${INC_DIR}/com/centreon/broker/neb/host_service_status.hh
${INC_DIR}/com/centreon/broker/neb/host_status.hh
${INC_DIR}/com/centreon/broker/neb/instance.hh
${INC_DIR}/com/centreon/broker/neb/instance_configuration.hh
${INC_DIR}/com/centreon/broker/neb/instance_status.hh
${INC_DIR}/com/centreon/broker/neb/internal.hh
${INC_DIR}/com/centreon/broker/neb/log_entry.hh
Expand Down
35 changes: 17 additions & 18 deletions broker/neb/inc/com/centreon/broker/neb/events.hh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
** Copyright 2009-2011,2015 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
**
** For more information : [email protected]
*/
/**
* Copyright 2009-2011,2015-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : [email protected]
*/

#ifndef CCB_NEB_EVENTS_HH
#define CCB_NEB_EVENTS_HH
Expand All @@ -32,7 +32,6 @@
#include "com/centreon/broker/neb/host_parent.hh"
#include "com/centreon/broker/neb/host_status.hh"
#include "com/centreon/broker/neb/instance.hh"
#include "com/centreon/broker/neb/instance_configuration.hh"
#include "com/centreon/broker/neb/instance_status.hh"
#include "com/centreon/broker/neb/log_entry.hh"
#include "com/centreon/broker/neb/responsive_instance.hh"
Expand Down
64 changes: 0 additions & 64 deletions broker/neb/inc/com/centreon/broker/neb/instance_configuration.hh

This file was deleted.

4 changes: 0 additions & 4 deletions broker/neb/src/broker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,6 @@ void broker_module_init(void const* arg) {
e.register_event(make_type(io::neb, neb::de_service_status),
"service_status", &neb::service_status::operations,
neb::service_status::entries, "services");
e.register_event(make_type(io::neb, neb::de_instance_configuration),
"instance_configuration",
&neb::instance_configuration::operations,
neb::instance_configuration::entries);
e.register_event(make_type(io::neb, neb::de_responsive_instance),
"responsive_instance",
&neb::responsive_instance::operations,
Expand Down
53 changes: 16 additions & 37 deletions broker/neb/src/initial.cc
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/**
* Copyright 2009-2022 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : [email protected]
*/
* Copyright 2009-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : [email protected]
*/

#include "com/centreon/broker/neb/initial.hh"
#include "com/centreon/broker/config/applier/state.hh"
Expand Down Expand Up @@ -481,25 +481,6 @@ static void send_pb_service_list() {
send_service_list(neb::callback_pb_service);
}

/**
* Send the instance configuration loaded event.
*/
static void send_instance_configuration() {
log_v2::neb()->info(
"init: sending initial instance configuration loading event");
std::shared_ptr<neb::instance_configuration> ic(
new neb::instance_configuration);
ic->loaded = true;
ic->poller_id = config::applier::state::instance().poller_id();
neb::gl_publisher.write(ic);
}

/**************************************
* *
* Global Functions *
* *
**************************************/

/**
* Send initial configuration to the global publisher.
*/
Expand All @@ -516,7 +497,6 @@ void neb::send_initial_configuration() {
send_service_group_list();
send_host_dependencies_list();
send_service_dependencies_list();
send_instance_configuration();
}

/**************************************
Expand All @@ -541,5 +521,4 @@ void neb::send_initial_pb_configuration() {
send_pb_service_group_list();
send_pb_host_dependencies_list();
send_pb_service_dependencies_list();
send_instance_configuration();
}
113 changes: 0 additions & 113 deletions broker/neb/src/instance_configuration.cc

This file was deleted.

44 changes: 18 additions & 26 deletions broker/neb/src/neb.cc
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
/**
* Copyright 2009-2016, 2018-2021 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : [email protected]
*/
* Copyright 2009-2016, 2018-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* For more information : [email protected]
*/

#include <clocale>
#include <csignal>

#include "com/centreon/broker/config/applier/init.hh"
#include "com/centreon/broker/config/applier/state.hh"
#include "com/centreon/broker/config/parser.hh"
#include "com/centreon/broker/log_v2.hh"
#include "com/centreon/broker/neb/callbacks.hh"
#include "com/centreon/broker/neb/instance_configuration.hh"
#include "com/centreon/broker/neb/internal.hh"
#include "com/centreon/engine/nebcallbacks.hh"
#include "com/centreon/exceptions/msg_fmt.hh"

Expand Down Expand Up @@ -183,18 +184,9 @@ int nebmodule_init(int flags, char const* args, void* handle) {
/**
* @brief Reload module after configuration reload.
*
* This will effectively send an instance_configuration object to the
* multiplexer.
*
* @return OK.
*/
int nebmodule_reload() {
std::shared_ptr<neb::instance_configuration> ic(
new neb::instance_configuration);
ic->loaded = true;
ic->poller_id = config::applier::state::instance().poller_id();
multiplexing::publisher p;
p.write(ic);
return 0;
}
}
Loading

1 comment on commit e7f9c56

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
8 2 0 10 80.00 0s

Failed Tests

Name Message ⏱️ Duration Suite
BRRDRM1 index_id=6358 Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 0 if modulo==2 . 0.000 s Rrd
BRRDRMU1 Data before RRD rebuild contain index_id % 3. The expected average is 100 if modulo==0, 75 if modulo==1, 0 if modulo==2 . 0.000 s Rrd

Please sign in to comment.