Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
centreon
centreon-collect
Commits
7d7c28ef
Commit
7d7c28ef
authored
Jun 09, 2020
by
David Boucher
Browse files
cleanup(cce_core): Coding style applied.
parent
d107389d
Changes
17
Hide whitespace changes
Inline
Side-by-side
include/com/centreon/engine/command_manager.hh
View file @
7d7c28ef
...
...
@@ -24,8 +24,8 @@
#include
<future>
#include
<mutex>
#include
"com/centreon/engine/namespace.hh"
#include
"com/centreon/engine/engine_impl.hh"
#include
"com/centreon/engine/namespace.hh"
CCE_BEGIN
()
class
command_manager
{
...
...
include/com/centreon/engine/globals.hh
View file @
7d7c28ef
...
...
@@ -31,8 +31,8 @@
#include
"com/centreon/engine/events/sched_info.hh"
#include
"com/centreon/engine/events/timed_event.hh"
#include
"com/centreon/engine/nebmods.hh"
#include
"com/centreon/engine/utils.hh"
#include
"com/centreon/engine/restart_stats.hh"
#include
"com/centreon/engine/utils.hh"
#ifdef __cplusplus
extern
"C"
{
...
...
include/com/centreon/engine/restart_stats.hh
View file @
7d7c28ef
...
...
@@ -17,6 +17,7 @@
*
*/
#include
<chrono>
#include
"com/centreon/engine/namespace.hh"
CCE_BEGIN
()
...
...
src/cbmod/statistics/hosts_checked.cc
View file @
7d7c28ef
...
...
@@ -17,7 +17,9 @@
*/
#include
"com/centreon/broker/neb/statistics/hosts_checked.hh"
#include
<sstream>
#include
"com/centreon/broker/config/applier/state.hh"
#include
"com/centreon/broker/neb/internal.hh"
#include
"com/centreon/engine/globals.hh"
...
...
src/cbmod/statistics/services_checked.cc
View file @
7d7c28ef
...
...
@@ -17,7 +17,9 @@
*/
#include
"com/centreon/broker/neb/statistics/services_checked.hh"
#include
<sstream>
#include
"com/centreon/broker/config/applier/state.hh"
#include
"com/centreon/broker/neb/internal.hh"
#include
"com/centreon/engine/globals.hh"
...
...
src/cce_core/checkable.cc
View file @
7d7c28ef
...
...
@@ -18,7 +18,9 @@
*/
#include
"com/centreon/engine/checkable.hh"
#include
<sstream>
#include
"com/centreon/engine/exceptions/error.hh"
#include
"com/centreon/engine/logging/logger.hh"
...
...
src/cce_core/command_manager.cc
View file @
7d7c28ef
...
...
@@ -23,8 +23,8 @@
#include
<sys/types.h>
#include
<unistd.h>
#include
"com/centreon/engine/comment.hh"
#include
"com/centreon/engine/checks/checker.hh"
#include
"com/centreon/engine/comment.hh"
#include
"com/centreon/engine/globals.hh"
#include
"com/centreon/engine/logging/logger.hh"
...
...
src/cce_core/globals.cc
View file @
7d7c28ef
...
...
@@ -21,7 +21,9 @@
*/
#include
"com/centreon/engine/globals.hh"
#include
<map>
#include
"com/centreon/engine/logging/logger.hh"
#include
"compatibility/nagios.h"
...
...
src/cce_core/host.cc
View file @
7d7c28ef
...
...
@@ -3432,8 +3432,7 @@ bool host::authorized_by_dependencies(dependency::types dependency_type) const {
if
(
dep
->
get_fail_on
(
state
))
return
false
;
if
(
state
==
host
::
state_up
&&
!
dep
->
master_host_ptr
->
has_been_checked
()
&&
if
(
state
==
host
::
state_up
&&
!
dep
->
master_host_ptr
->
has_been_checked
()
&&
dep
->
get_fail_on_pending
())
return
false
;
...
...
src/cce_core/macros/grab_value.cc
View file @
7d7c28ef
...
...
@@ -19,7 +19,9 @@
*/
#include
"com/centreon/engine/macros/grab_value.hh"
#include
<cstdlib>
#include
"com/centreon/engine/configuration/applier/state.hh"
#include
"com/centreon/engine/globals.hh"
#include
"com/centreon/engine/logging/logger.hh"
...
...
@@ -655,19 +657,26 @@ static int handle_summary_macro(nagios_macros* mac,
mac
->
x
[
MACRO_TOTALHOSTSUP
]
=
std
::
to_string
(
hosts_up
);
mac
->
x
[
MACRO_TOTALHOSTSDOWN
]
=
std
::
to_string
(
hosts_down
);
mac
->
x
[
MACRO_TOTALHOSTSUNREACHABLE
]
=
std
::
to_string
(
hosts_unreachable
);
mac
->
x
[
MACRO_TOTALHOSTSDOWNUNHANDLED
]
=
std
::
to_string
(
hosts_down_unhandled
);
mac
->
x
[
MACRO_TOTALHOSTSUNREACHABLEUNHANDLED
]
=
std
::
to_string
(
hosts_unreachable_unhandled
);
mac
->
x
[
MACRO_TOTALHOSTSDOWNUNHANDLED
]
=
std
::
to_string
(
hosts_down_unhandled
);
mac
->
x
[
MACRO_TOTALHOSTSUNREACHABLEUNHANDLED
]
=
std
::
to_string
(
hosts_unreachable_unhandled
);
mac
->
x
[
MACRO_TOTALHOSTPROBLEMS
]
=
std
::
to_string
(
host_problems
);
mac
->
x
[
MACRO_TOTALHOSTPROBLEMSUNHANDLED
]
=
std
::
to_string
(
host_problems_unhandled
);
mac
->
x
[
MACRO_TOTALHOSTPROBLEMSUNHANDLED
]
=
std
::
to_string
(
host_problems_unhandled
);
mac
->
x
[
MACRO_TOTALSERVICESOK
]
=
std
::
to_string
(
services_ok
);
mac
->
x
[
MACRO_TOTALSERVICESWARNING
]
=
std
::
to_string
(
services_warning
);
mac
->
x
[
MACRO_TOTALSERVICESCRITICAL
]
=
std
::
to_string
(
services_critical
);
mac
->
x
[
MACRO_TOTALSERVICESUNKNOWN
]
=
std
::
to_string
(
services_unknown
);
mac
->
x
[
MACRO_TOTALSERVICESWARNINGUNHANDLED
]
=
std
::
to_string
(
services_warning_unhandled
);
mac
->
x
[
MACRO_TOTALSERVICESCRITICALUNHANDLED
]
=
std
::
to_string
(
services_critical_unhandled
);
mac
->
x
[
MACRO_TOTALSERVICESUNKNOWNUNHANDLED
]
=
std
::
to_string
(
services_unknown_unhandled
);
mac
->
x
[
MACRO_TOTALSERVICESWARNINGUNHANDLED
]
=
std
::
to_string
(
services_warning_unhandled
);
mac
->
x
[
MACRO_TOTALSERVICESCRITICALUNHANDLED
]
=
std
::
to_string
(
services_critical_unhandled
);
mac
->
x
[
MACRO_TOTALSERVICESUNKNOWNUNHANDLED
]
=
std
::
to_string
(
services_unknown_unhandled
);
mac
->
x
[
MACRO_TOTALSERVICEPROBLEMS
]
=
std
::
to_string
(
service_problems
);
mac
->
x
[
MACRO_TOTALSERVICEPROBLEMSUNHANDLED
]
=
std
::
to_string
(
service_problems_unhandled
);
mac
->
x
[
MACRO_TOTALSERVICEPROBLEMSUNHANDLED
]
=
std
::
to_string
(
service_problems_unhandled
);
}
// Return only the macro the user requested.
...
...
src/cce_core/retention/applier/service.cc
View file @
7d7c28ef
...
...
@@ -18,6 +18,7 @@
*/
#include
"com/centreon/engine/retention/applier/service.hh"
#include
"com/centreon/engine/configuration/applier/state.hh"
#include
"com/centreon/engine/flapping.hh"
#include
"com/centreon/engine/globals.hh"
...
...
src/cce_core/retention/dump.cc
View file @
7d7c28ef
...
...
@@ -18,8 +18,10 @@
*/
#include
"com/centreon/engine/retention/dump.hh"
#include
<fstream>
#include
<iomanip>
#include
"com/centreon/engine/broker.hh"
#include
"com/centreon/engine/comment.hh"
#include
"com/centreon/engine/configuration/applier/state.hh"
...
...
@@ -47,8 +49,7 @@ using namespace com::centreon::engine::retention;
*/
std
::
ostream
&
dump
::
comment
(
std
::
ostream
&
os
,
com
::
centreon
::
engine
::
comment
const
&
obj
)
{
logger
(
dbg_functions
,
basic
)
<<
"dump::comment()"
;
logger
(
dbg_functions
,
basic
)
<<
"dump::comment()"
;
char
const
*
host_name
;
char
const
*
service_description
;
if
(
obj
.
get_comment_type
()
==
com
::
centreon
::
engine
::
comment
::
host
)
{
...
...
@@ -58,9 +59,9 @@ std::ostream& dump::comment(std::ostream& os,
host_name
=
it
->
second
->
get_name
().
c_str
();
service_description
=
""
;
os
<<
"hostcomment {
\n
"
;
}
else
{
auto
it
=
service
::
services_by_id
.
find
({
obj
.
get_host_id
(),
obj
.
get_service_id
()});
}
else
{
auto
it
=
service
::
services_by_id
.
find
({
obj
.
get_host_id
(),
obj
.
get_service_id
()});
if
(
it
==
service
::
services_by_id
.
end
())
return
os
;
host_name
=
it
->
second
->
get_hostname
().
c_str
();
...
...
@@ -108,8 +109,7 @@ std::ostream& dump::comment(std::ostream& os,
* @return The output stream.
*/
std
::
ostream
&
dump
::
comments
(
std
::
ostream
&
os
)
{
logger
(
dbg_functions
,
basic
)
<<
"dump::comments()"
;
logger
(
dbg_functions
,
basic
)
<<
"dump::comments()"
;
for
(
comment_map
::
iterator
it
(
comment
::
comments
.
begin
()),
end
(
comment
::
comments
.
end
());
it
!=
end
;
++
it
)
...
...
@@ -214,8 +214,7 @@ std::ostream& dump::notifications(
* @return The output stream.
*/
std
::
ostream
&
dump
::
scheduled_downtime
(
std
::
ostream
&
os
,
downtime
const
&
obj
)
{
logger
(
dbg_functions
,
basic
)
<<
"dump::scheduled_downtime()"
;
logger
(
dbg_functions
,
basic
)
<<
"dump::scheduled_downtime()"
;
obj
.
retention
(
os
);
return
os
;
}
...
...
@@ -228,8 +227,7 @@ std::ostream& dump::scheduled_downtime(std::ostream& os, downtime const& obj) {
* @return The output stream.
*/
std
::
ostream
&
dump
::
downtimes
(
std
::
ostream
&
os
)
{
logger
(
dbg_functions
,
basic
)
<<
"dump::downtimes()"
;
logger
(
dbg_functions
,
basic
)
<<
"dump::downtimes()"
;
for
(
std
::
pair
<
time_t
,
std
::
shared_ptr
<
downtime
>>
const
&
obj
:
downtimes
::
downtime_manager
::
instance
().
get_scheduled_downtimes
())
dump
::
scheduled_downtime
(
os
,
*
obj
.
second
);
...
...
src/cce_core/service.cc
View file @
7d7c28ef
...
...
@@ -485,8 +485,7 @@ std::ostream& operator<<(std::ostream& os,
<<
string
::
ctime
(
obj
.
get_last_time_unknown
())
<<
"
\n
last_time_critical: "
<<
string
::
ctime
(
obj
.
get_last_time_critical
())
<<
"
\n
has_been_checked: "
<<
obj
.
has_been_checked
()
<<
"
\n
has_been_checked: "
<<
obj
.
has_been_checked
()
<<
"
\n
is_being_freshened: "
<<
obj
.
get_is_being_freshened
()
<<
"
\n
notified_on_unknown: "
...
...
@@ -1850,8 +1849,7 @@ int service::handle_async_check_result(check_result* queued_check_result) {
queued_check_result
->
get_early_timeout
(),
queued_check_result
->
get_return_code
(),
nullptr
,
nullptr
);
if
(
!
(
reschedule_check
&&
get_should_be_scheduled
()
&&
has_been_checked
())
||
if
(
!
(
reschedule_check
&&
get_should_be_scheduled
()
&&
has_been_checked
())
||
!
get_checks_enabled
())
{
/* set the checked flag */
set_has_been_checked
(
true
);
...
...
src/cce_core/xsddefault.cc
View file @
7d7c28ef
...
...
@@ -21,15 +21,18 @@
*/
#include
"com/centreon/engine/xsddefault.hh"
#include
<fcntl.h>
#include
<sys/stat.h>
#include
<unistd.h>
#include
<cerrno>
#include
<cstdio>
#include
<cstdlib>
#include
<iomanip>
#include
<sstream>
#include
<string>
#include
"com/centreon/engine/comment.hh"
#include
"com/centreon/engine/common.hh"
#include
"com/centreon/engine/configuration/applier/state.hh"
...
...
@@ -109,7 +112,7 @@ int xsddefault_save_status_data() {
// get number of items in the command buffer
if
(
config
->
check_external_commands
())
{
//FIXME DBR
//
FIXME DBR
pthread_mutex_lock
(
&
external_command_buffer
.
buffer_lock
);
used_external_command_buffer_slots
=
external_command_buffer
.
items
;
high_external_command_buffer_slots
=
external_command_buffer
.
high
;
...
...
@@ -690,8 +693,7 @@ int xsddefault_save_status_data() {
stream
<<
"
\t
host_id="
<<
it
->
second
->
get_host_id
()
<<
"
\n
"
;
if
(
it
->
second
->
get_comment_type
()
==
com
::
centreon
::
engine
::
comment
::
service
)
stream
<<
"
\t
service_id="
<<
it
->
second
->
get_service_id
()
<<
"
\n
"
;
stream
<<
"
\t
service_id="
<<
it
->
second
->
get_service_id
()
<<
"
\n
"
;
stream
<<
"
\t
entry_type="
<<
it
->
second
->
get_entry_type
()
<<
"
\n
"
"
\t
comment_id="
...
...
tests/engine/centenginestats2/centenginestats2.cc
View file @
7d7c28ef
...
...
@@ -18,6 +18,7 @@
*/
#include
<gtest/gtest.h>
#include
<sstream>
#define executable "bin/centenginestats2"
...
...
tests/engine/enginerpc/client.cc
View file @
7d7c28ef
...
...
@@ -21,8 +21,10 @@
#include
<grpcpp/channel.h>
#include
<grpcpp/client_context.h>
#include
<grpcpp/create_channel.h>
#include
<iostream>
#include
<memory>
#include
"engine.grpc.pb.h"
using
namespace
com
::
centreon
::
engine
;
...
...
tests/engine/enginerpc/enginerpc.cc
View file @
7d7c28ef
...
...
@@ -20,6 +20,7 @@
#include
"com/centreon/engine/enginerpc.hh"
#include
<gtest/gtest.h>
#include
<atomic>
#include
<chrono>
#include
<cstdio>
...
...
@@ -268,12 +269,12 @@ TEST_F(EngineRpc, GetService) {
th
.
join
();
std
::
vector
<
std
::
string
>
result_names
(
output
.
size
());
std
::
copy
(
output
.
begin
(),
output
.
end
(),
result_names
.
begin
());
std
::
copy
(
output
.
begin
(),
output
.
end
(),
result_names
.
begin
());
ASSERT_EQ
(
vectests
,
result_names
);
std
::
vector
<
std
::
string
>
result_ids
(
output2
.
size
());
std
::
copy
(
output2
.
begin
(),
output2
.
end
(),
result_ids
.
begin
());
std
::
copy
(
output2
.
begin
(),
output2
.
end
(),
result_ids
.
begin
());
ASSERT_EQ
(
vectests
,
result_ids
);
erpc
.
shutdown
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment