diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 00000000000..08a9bd35381
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1,7 @@
+* @centreon/owners-cpp
+
+.github/** @centreon/owners-pipelines
+packaging/** @centreon/owners-pipelines
+selinux/** @centreon/owners-pipelines
+
+tests/** @centreon/owners-robot-e2e
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 2f20441e411..882e3438310 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -15,11 +15,11 @@ Please include a short resume of the changes and what is the purpose of PR. Any
## Target serie
-- [ ] 21.10.x
- [ ] 22.04.x
- [ ] 22.10.x
- [ ] 23.04.x
-- [ ] 23.10.x (master)
+- [ ] 23.10.x
+- [ ] 24.04.x (master)
How this pull request can be tested ?
diff --git a/.github/actions/delivery/action.yml b/.github/actions/delivery/action.yml
index 5670e7b09ab..a9ae5f3c240 100644
--- a/.github/actions/delivery/action.yml
+++ b/.github/actions/delivery/action.yml
@@ -36,12 +36,12 @@ runs:
echo "extfile=deb" >> $GITHUB_ENV
- name: Use cache files
- uses: actions/cache@v3
+ uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: ./*.${{ env.extfile }}
key: ${{ inputs.cache_key }}
- - uses: jfrog/setup-jfrog-cli@v3
+ - uses: jfrog/setup-jfrog-cli@901bb9632db90821c2d3f076012bdeaf66598555 # v3.4.1
env:
JF_URL: https://centreon.jfrog.io
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
diff --git a/.github/actions/package/action.yml b/.github/actions/package/action.yml
index 0b95d964bbe..3e12de73d08 100644
--- a/.github/actions/package/action.yml
+++ b/.github/actions/package/action.yml
@@ -76,7 +76,7 @@ runs:
shell: bash
- name: Cache packages
- uses: actions/cache/save@v3
+ uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: ./*.${{ inputs.package_extension }}
key: ${{ inputs.cache_key }}
diff --git a/.github/actions/promote-to-stable/action.yml b/.github/actions/promote-to-stable/action.yml
index ed663baa648..f61b16d27dc 100644
--- a/.github/actions/promote-to-stable/action.yml
+++ b/.github/actions/promote-to-stable/action.yml
@@ -26,7 +26,7 @@ inputs:
runs:
using: "composite"
steps:
- - uses: jfrog/setup-jfrog-cli@v3
+ - uses: jfrog/setup-jfrog-cli@901bb9632db90821c2d3f076012bdeaf66598555 # v3.4.1
env:
JF_URL: https://centreon.jfrog.io
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
@@ -39,9 +39,17 @@ runs:
echo "[DEBUG] - Minor version: ${{ inputs.minor_version }}"
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
+ # Cloud specific promote
+ # delivery by default to onprem, override to internal if base branch is master
+ if [[ $GITHUB_BASE_REF == "master" ]]; then
+ ROOT_REPO_PATH="rpm-standard-internal"
+ else
+ ROOT_REPO_PATH="rpm-standard"
+ fi
+
for ARCH in "noarch" "x86_64"; do
echo "[DEBUG] - Get artifactory path of $ARCH testing artifacts to promote to stable."
- SRC_PATHS=$(jf rt s --include-dirs rpm-standard/${{ inputs.major_version }}/${{ inputs.distrib }}/testing/$ARCH/${{ inputs.module_name }}/*.rpm | jq -r '.[].path')
+ SRC_PATHS=$(jf rt s --include-dirs $ROOT_REPO_PATH/${{ inputs.major_version }}/${{ inputs.distrib }}/testing/$ARCH/${{ inputs.module_name }}/*.rpm | jq -r '.[].path')
if [[ ${SRC_PATHS[@]} ]]; then
for SRC_PATH in ${SRC_PATHS[@]}; do
echo "[DEBUG] - Source path found: $SRC_PATH"
@@ -51,13 +59,18 @@ runs:
continue
fi
echo "[DEBUG] - Build $ARCH artifactory target path."
- TARGET_PATH="rpm-standard/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module_name }}/"
+ TARGET_PATH="$ROOT_REPO_PATH/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module_name }}/"
echo "[DEBUG] - Target path: $TARGET_PATH"
echo "[DEBUG] - Promoting $ARCH testing artifacts to stable."
for ARTIFACT in ${SRC_PATHS[@]}; do
- echo "[DEBUG] - Promoting $ARTIFACT to stable on artifactory."
- jf rt cp $ARTIFACT $TARGET_PATH --flat=true
+ echo "[DEBUG] - Downloading $ARTIFACT from TESTING."
+ jf rt download $ARTIFACT --flat
+ done
+ for ARTIFACT_DL in $(dir|grep -E "*.rpm"); do
+ echo "[DEBUG] - Promoting (upload) $ARTIFACT_DL to stable $TARGET_PATH."
+ jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --flat
done
+ rm -f *.rpm
done
shell: bash
@@ -86,7 +99,15 @@ runs:
echo "[DEBUG] - Promoting DEB testing artifacts to stable."
for ARTIFACT in ${SRC_PATHS[@]}; do
- echo "[DEBUG] - Promoting $ARTIFACT to stable."
- jf rt cp $ARTIFACT $TARGET_PATH --flat=true
+ echo "[DEBUG] - Downloading $ARTIFACT from TESTING."
+ jf rt download $ARTIFACT --flat
done
+
+ for ARTIFACT_DL in $(dir|grep -E "*.deb"); do
+ ARCH=$(echo $ARTIFACT_DL | cut -d '_' -f3 | cut -d '.' -f1)
+ echo "[DEBUG] - Promoting (upload) $ARTIFACT_DL to stable $TARGET_PATH."
+ jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --deb "${{ inputs.distrib }}/main/$ARCH"
+ done
+
+ rm -f *.deb
shell: bash
diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml
index b6b0d85885a..bf3891050d4 100644
--- a/.github/actions/release/action.yml
+++ b/.github/actions/release/action.yml
@@ -56,4 +56,4 @@ runs:
--header 'Content-Type: application/json' \
--data ''$VERSION_DATA''
- shell: bash
\ No newline at end of file
+ shell: bash
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000000..3db635e65a3
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,10 @@
+version: 2
+updates:
+ - package-ecosystem: github-actions
+ directory: '/'
+ schedule:
+ interval: weekly
+ open-pull-requests-limit: 10
+ labels:
+ - 'dependencies'
+ - 'gha'
diff --git a/.github/docker/Dockerfile.centreon-collect-alma8 b/.github/docker/Dockerfile.centreon-collect-alma8
index 9406c331f0f..5e09d3a516b 100644
--- a/.github/docker/Dockerfile.centreon-collect-alma8
+++ b/.github/docker/Dockerfile.centreon-collect-alma8
@@ -36,7 +36,6 @@ dnf install -y cmake \
MariaDB-server \
gnutls-devel \
libgcrypt-devel \
- libssh2-devel \
lua-devel \
make \
perl-ExtUtils-Embed.noarch \
@@ -56,7 +55,7 @@ dnf install -y cmake \
dnf update libarchive
-pip3 install conan==1.57.0 --prefix=/usr --upgrade
+pip3 install conan==1.61.0 --prefix=/usr --upgrade
rm -rf ~/.conan/profiles/default
EOF
@@ -66,7 +65,7 @@ COPY conanfile.txt .
RUN <> /etc/yum.conf
+echo 'assumeyes=1' >> /etc/yum.conf
+sed -i 's/best=True/best=False/g' /etc/dnf/dnf.conf
+dnf install -y dnf-plugins-core
+dnf config-manager --set-enabled crb
+
+dnf install -y epel-release
+
+dnf --best install -y \
+ gcc \
+ gcc-c++ \
+ gdb \
+ git \
+ openssh-server \
+ mariadb-server \
+ mariadb \
+ gnutls \
+ libgcrypt \
+ lua \
+ perl-ExtUtils-Embed \
+ python3 \
+ python3-devel \
+ python3-pip \
+ perl-Thread-Queue \
+ rrdtool \
+ perl \
+ procps-ng \
+ zstd \
+ psmisc \
+ sudo
+
+echo "install robot and dependencies"
+
+pip3 install -U robotframework robotframework-databaselibrary robotframework-httpctrl robotframework-examples pymysql python-dateutil psutil
+pip3 install grpcio grpcio_tools py-cpuinfo cython unqlite gitpython boto3
+
+cd /tmp/collect
+
+.github/scripts/collect-prepare-test-robot.sh mariadb
+
+/bin/rm -rf /tmp/collect
+
+EOF
+
diff --git a/.github/docker/Dockerfile.centreon-collect-debian-bullseye b/.github/docker/Dockerfile.centreon-collect-debian-bullseye
index 248a07dcfda..1ae20485815 100644
--- a/.github/docker/Dockerfile.centreon-collect-debian-bullseye
+++ b/.github/docker/Dockerfile.centreon-collect-debian-bullseye
@@ -49,7 +49,7 @@ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
-pip3 install conan==1.57.0
+pip3 install conan==1.61.0
ln -s /usr/local/bin/conan /usr/bin/conan
rm -rf ~/.conan/profiles/default
@@ -60,7 +60,7 @@ COPY conanfile.txt .
RUN <> /etc/yum.conf
+echo 'assumeyes=1' >> /etc/yum.conf
+sed -i 's/best=True/best=False/g' /etc/dnf/dnf.conf
+dnf install -y dnf-plugins-core
+dnf config-manager --set-enabled crb
+
+dnf install -y epel-release
+
+dnf --best install -y gcc \
+ gcc-c++ \
+ gdb \
+ git \
+ openssh-server \
+ mysql-server \
+ mysql \
+ gnutls \
+ libgcrypt \
+ lua \
+ perl-ExtUtils-Embed \
+ python3 \
+ python3-devel \
+ python3-pip \
+ perl-Thread-Queue \
+ rrdtool \
+ perl \
+ procps-ng \
+ zstd \
+ psmisc \
+ sudo \
+ iproute
+
+echo "install robot and dependencies"
+
+pip3 install -U robotframework robotframework-databaselibrary robotframework-httpctrl robotframework-examples pymysql python-dateutil psutil
+pip3 install grpcio grpcio_tools py-cpuinfo cython unqlite gitpython boto3
+
+cd /tmp/collect
+
+.github/scripts/collect-prepare-test-robot.sh mysql
+
+/bin/rm -rf /tmp/collect
+
+EOF
diff --git a/.github/scripts/collect-prepare-test-robot.sh b/.github/scripts/collect-prepare-test-robot.sh
new file mode 100755
index 00000000000..e0eb711bfb3
--- /dev/null
+++ b/.github/scripts/collect-prepare-test-robot.sh
@@ -0,0 +1,95 @@
+#!/bin/bash
+set -e
+set -x
+
+
+database_type=$1
+
+. /etc/os-release
+distrib=${ID}
+distrib=$(echo $distrib | tr '[:lower:]' '[:upper:]')
+
+
+echo "########################### Configure sshd ###########################"
+ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -P "" << /dev/null 2>&1 &
+ else
+ mkdir -p /run/mysqld
+ chown mysql:mysql /run/mysqld
+ mariadbd --socket=/run/mysqld/mysqld.sock --user=root > /dev/null 2>&1 &
+ fi
+ sleep 5
+
+ echo "########################### Init centreon database ############################"
+
+ mysql -e "CREATE USER IF NOT EXISTS 'centreon'@'localhost' IDENTIFIED BY 'centreon';"
+ mysql -e "CREATE USER IF NOT EXISTS 'root_centreon'@'localhost' IDENTIFIED BY 'centreon';"
+fi
+
+mysql -e "GRANT SELECT,UPDATE,DELETE,INSERT,CREATE,DROP,INDEX,ALTER,LOCK TABLES,CREATE TEMPORARY TABLES, EVENT,CREATE VIEW ON *.* TO 'centreon'@'localhost';"
+mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'root_centreon'@'localhost'"
+
+cat resources/centreon.sql | sed "s/DBNameConf/centreon/g" > /tmp/centreon.sql
+
+mysql -u root_centreon -pcentreon < resources/centreon_storage.sql
+mysql -u root_centreon -pcentreon < /tmp/centreon.sql
+
+cd tests
+
+if [ "$distrib" = "ALMALINUX" ]; then
+ dnf groupinstall -y "Development Tools"
+ dnf install -y python3-devel
+else
+ apt-get update
+ apt-get install -y build-essential
+ apt-get install -y python3-dev
+fi
+
+
+echo "########################## Install centreon collect ###########################"
+cd ..
+echo "Installation..."
+if [ "$distrib" = "ALMALINUX" ]; then
+ dnf clean all
+ rm -f ./*-selinux-*.rpm # avoid to install selinux packages which are dependent to centreon-common-selinux
+ dnf install -y ./*.rpm
+else
+ apt-get update
+# apt-get install -y ./*.deb
+fi
+
+
+if [ $database_type == 'mysql' ]; then
+ killall -w mysqldtoto
+else
+ killall -w mariadbd
+fi
+
+cd ..
+
+\rm -rf *
+
diff --git a/.github/scripts/collect-test-robot.sh b/.github/scripts/collect-test-robot.sh
index da38d9aa372..fae6945272a 100755
--- a/.github/scripts/collect-test-robot.sh
+++ b/.github/scripts/collect-test-robot.sh
@@ -6,6 +6,8 @@ export RUN_ENV=docker
test_file=$1
database_type=$2
+#this env variable is a json that contains some test params
+export TESTS_PARAMS='$3'
. /etc/os-release
distrib=${ID}
@@ -24,75 +26,25 @@ if [ ${database_type} == 'mysql' ] && [ ! -f tests/${test_file}.mysql ]; then
exit 0
fi
-echo "########################### Configure and start sshd ###########################"
-ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -P "" << /dev/null 2>&1 &
else
- mkdir -p /run/mysqld
- chown mysql:mysql /run/mysqld
mariadbd --socket=/run/mysqld/mysqld.sock --user=root > /dev/null 2>&1 &
fi
sleep 5
- echo "########################### Init centreon database ############################"
-
- mysql -e "CREATE USER IF NOT EXISTS 'centreon'@'localhost' IDENTIFIED BY 'centreon';"
- mysql -e "CREATE USER IF NOT EXISTS 'root_centreon'@'localhost' IDENTIFIED BY 'centreon';"
-fi
-
-mysql -e "GRANT SELECT,UPDATE,DELETE,INSERT,CREATE,DROP,INDEX,ALTER,LOCK TABLES,CREATE TEMPORARY TABLES, EVENT,CREATE VIEW ON *.* TO 'centreon'@'localhost';"
-mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'root_centreon'@'localhost'"
-
-cat resources/centreon.sql | sed "s/DBNameConf/centreon/g" > /tmp/centreon.sql
-
-mysql -u root_centreon -pcentreon < resources/centreon_storage.sql
-mysql -u root_centreon -pcentreon < /tmp/centreon.sql
-
-#remove git dubious ownership
-git config --global --add safe.directory $PWD
-
-echo "########################### Install Robot Framework ###########################"
-cd tests
-pip3 install -U robotframework robotframework-databaselibrary robotframework-httpctrl robotframework-examples pymysql python-dateutil psutil
-
-if [ "$distrib" = "ALMALINUX" ]; then
- dnf groupinstall -y "Development Tools"
- dnf install -y python3-devel
-else
- apt-get update
- apt-get install -y build-essential
- apt-get install -y python3-dev
fi
-pip3 install grpcio grpcio_tools py-cpuinfo cython unqlite gitpython boto3
echo "########################## Install centreon collect ###########################"
-cd ..
echo "Installation..."
if [ "$distrib" = "ALMALINUX" ]; then
dnf clean all
@@ -103,9 +55,13 @@ else
apt-get install -y ./*.deb
fi
+
ulimit -c unlimited
echo '/tmp/core.%p' > /proc/sys/kernel/core_pattern
+#remove git dubious ownership
+/usr/bin/git config --global --add safe.directory $PWD
+
echo "##### Starting tests #####"
cd tests
./init-proto.sh
diff --git a/.github/scripts/collect-unit-tests.sh b/.github/scripts/collect-unit-tests.sh
index 79787f82d94..6ccf25a4b2c 100755
--- a/.github/scripts/collect-unit-tests.sh
+++ b/.github/scripts/collect-unit-tests.sh
@@ -6,11 +6,11 @@ rm -rf /src/build
mkdir /src/build
cd /src/build/
-conan install .. -s compiler.cppstd=14 -s compiler.libcxx=libstdc++11 --build=missing
+conan install .. -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing
if [ $(cat /etc/issue | awk '{print $1}') = "Debian" ] ; then
- CXXFLAGS="-Wall -Wextra" cmake -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DWITH_CENTREON_CLIB_INCLUDE_DIR=../clib/inc/ -DWITH_CENTREON_CLIB_LIBRARIES=centreon-clib/libcentreon_clib.so -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On ..
+ CXXFLAGS="-Wall -Wextra" cmake -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DWITH_CENTREON_CLIB_INCLUDE_DIR=../clib/inc/ -DWITH_CENTREON_CLIB_LIBRARIES=centreon-clib/libcentreon_clib.so -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On -DNG=On ..
else
- CXXFLAGS="-Wall -Wextra" cmake3 -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DWITH_CENTREON_CLIB_INCLUDE_DIR=../clib/inc/ -DWITH_CENTREON_CLIB_LIBRARIES=centreon-clib/libcentreon_clib.so -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On ..
+ CXXFLAGS="-Wall -Wextra" cmake3 -G "Ninja" -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DWITH_CENTREON_CLIB_INCLUDE_DIR=../clib/inc/ -DWITH_CENTREON_CLIB_LIBRARIES=centreon-clib/libcentreon_clib.so -DCMAKE_BUILD_TYPE=Debug -DWITH_PREFIX=/usr -DWITH_PREFIX_BIN=/usr/sbin -DWITH_USER_BROKER=centreon-broker -DWITH_USER_ENGINE=centreon-engine -DWITH_GROUP_BROKER=centreon-broker -DWITH_GROUP_ENGINE=centreon-engine -DWITH_TESTING=On -DWITH_PREFIX_MODULES=/usr/share/centreon/lib/centreon-broker -DWITH_PREFIX_CONF_BROKER=/etc/centreon-broker -DWITH_PREFIX_LIB_BROKER=/usr/lib64/nagios -DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine -DWITH_PREFIX_LIB_ENGINE=/usr/lib64/centreon-engine -DWITH_PREFIX_LIB_CLIB=/usr/lib64/ -DWITH_RW_DIR=/var/lib/centreon-engine/rw -DWITH_VAR_DIR=/var/log/centreon-engine -DWITH_MODULE_SIMU=On -DNG=On ..
fi
#Build
diff --git a/.github/workflows/actionlint.yml b/.github/workflows/actionlint.yml
index 42a391e17a2..e9b57c04346 100644
--- a/.github/workflows/actionlint.yml
+++ b/.github/workflows/actionlint.yml
@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Download actionlint
id: get_actionlint
@@ -38,3 +38,40 @@ jobs:
-pyflakes= \
-color
shell: bash
+ yaml-lint:
+ runs-on: ubuntu-22.04
+ steps:
+ - name: Checkout sources
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+
+ - name: Install Yaml
+ run: |
+ pip install yamllint==1.32.0
+
+ - name: Add Yaml Lint Rules
+ run: |
+ cat <>./yamllint_rules.yml
+ extends: default
+
+ rules:
+ document-start: disable
+ line-length: disable
+ truthy:
+ check-keys: false
+ level: error
+ indentation:
+ spaces: 2
+ indent-sequences: true
+ check-multi-line-strings: false
+ comments:
+ ignore-shebangs: true
+ min-spaces-from-content: 1
+ comments-indentation: disable
+ new-lines:
+ type: unix
+ new-line-at-end-of-file: enable
+ EOF
+
+ - name: Lint YAML files
+ run: |
+ yamllint -c ./yamllint_rules.yml ./.github/actions/ ./.github/workflows/
diff --git a/.github/workflows/centreon-collect.yml b/.github/workflows/centreon-collect.yml
index d1496855a0b..b339f222923 100644
--- a/.github/workflows/centreon-collect.yml
+++ b/.github/workflows/centreon-collect.yml
@@ -46,22 +46,6 @@ jobs:
get-version:
uses: ./.github/workflows/get-version.yml
- veracode-analysis:
- needs: [get-version]
- uses: ./.github/workflows/veracode-analysis.yml
- with:
- module_name: centreon-collect
- major_version: ${{ needs.get-version.outputs.version }}
- minor_version: ${{ needs.get-version.outputs.patch }}
- stability: ${{ needs.get-version.outputs.stability }}
- img_version: ${{ needs.get-version.outputs.img_version }}
- secrets:
- veracode_api_id: ${{ secrets.VERACODE_API_ID_COLL }}
- veracode_api_key: ${{ secrets.VERACODE_API_KEY_COLL }}
- veracode_srcclr_token: ${{ secrets.VERACODE_SRCCLR_TOKEN }}
- docker_registry_id: ${{ secrets.DOCKER_REGISTRY_ID }}
- docker_registry_passwd: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
-
unit-test:
needs: [get-version]
if: ${{ ! contains(fromJson('["stable"]'), needs.get-version.outputs.stability) }}
@@ -75,10 +59,10 @@ jobs:
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Login to Registry
- uses: docker/login-action@v2
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
@@ -106,11 +90,11 @@ jobs:
deliver-sources:
runs-on: [self-hosted, common]
needs: [get-version, package]
- if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) }}
+ if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }}
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: centreon-collect
@@ -141,7 +125,7 @@ jobs:
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Publish RPM packages
uses: ./.github/actions/delivery
@@ -170,7 +154,7 @@ jobs:
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Publish DEB packages
uses: ./.github/actions/delivery
@@ -184,7 +168,7 @@ jobs:
promote:
needs: [get-version]
- if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) }}
+ if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }}
runs-on: [self-hosted, common]
strategy:
matrix:
@@ -192,7 +176,7 @@ jobs:
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Promote ${{ matrix.distrib }} to stable
uses: ./.github/actions/promote-to-stable
diff --git a/.github/workflows/docker-builder.yml b/.github/workflows/docker-builder.yml
index f23175eabb4..7fa2db996a0 100644
--- a/.github/workflows/docker-builder.yml
+++ b/.github/workflows/docker-builder.yml
@@ -30,18 +30,39 @@ jobs:
- runner: collect
dockerfile: centreon-collect-alma8
image: centreon-collect-alma8
+ tag: ${{ needs.get-version.outputs.img_version }}
- runner: collect
dockerfile: centreon-collect-alma9
image: centreon-collect-alma9
+ tag: ${{ needs.get-version.outputs.img_version }}
+ - runner: collect
+ dockerfile: centreon-collect-alma9-test
+ image: centreon-collect-alma9-test
+ tag: ${{ needs.get-version.outputs.test_img_version }}
- runner: collect
dockerfile: centreon-collect-mysql-alma9
image: centreon-collect-mysql-alma9
+ tag: ${{ needs.get-version.outputs.img_version }}
+ - runner: collect
+ dockerfile: centreon-collect-mysql-alma9-test
+ image: centreon-collect-mysql-alma9-test
+ tag: ${{ needs.get-version.outputs.test_img_version }}
- runner: collect
dockerfile: centreon-collect-debian-bullseye
image: centreon-collect-debian-bullseye
+ tag: ${{ needs.get-version.outputs.img_version }}
+ - runner: collect
+ dockerfile: centreon-collect-debian-bullseye-test
+ image: centreon-collect-debian-bullseye-test
+ tag: ${{ needs.get-version.outputs.test_img_version }}
- runner: collect-arm64
dockerfile: centreon-collect-debian-bullseye
image: centreon-collect-debian-bullseye-arm64
+ tag: ${{ needs.get-version.outputs.img_version }}
+ - runner: collect-arm64
+ dockerfile: centreon-collect-debian-bullseye-test
+ image: centreon-collect-debian-bullseye-arm64-test
+ tag: ${{ needs.get-version.outputs.test_img_version }}
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.runner)) }}
@@ -49,25 +70,26 @@ jobs:
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Login to Registry
- uses: docker/login-action@v2
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- name: Login to Proxy Registry
- uses: docker/login-action@v2
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
- - uses: docker/setup-buildx-action@v2
+ - uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2.10.0
- - uses: docker/build-push-action@v3
+ - name: Build image ${{ matrix.image }}:${{ matrix.tag }}
+ uses: docker/build-push-action@1104d471370f9806843c095c1db02b5a90c5f8b6 # v3.3.1
with:
file: .github/docker/Dockerfile.${{ matrix.dockerfile }}
context: .
@@ -75,4 +97,4 @@ jobs:
platforms: ${{ contains(matrix.runner, 'arm') && 'linux/arm64' || 'linux/amd64' }}
pull: true
push: true
- tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:${{ needs.get-version.outputs.img_version }}
+ tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:${{ matrix.tag }}
diff --git a/.github/workflows/get-version.yml b/.github/workflows/get-version.yml
index add097da665..117ade3c9fb 100644
--- a/.github/workflows/get-version.yml
+++ b/.github/workflows/get-version.yml
@@ -4,6 +4,9 @@ on:
img_version:
description: "docker image version (conan checksum)"
value: ${{ jobs.get-version.outputs.img_version }}
+ test_img_version:
+ description: "test docker image version (checksum of database sql, script and dockerfiles)"
+ value: ${{ jobs.get-version.outputs.test_img_version }}
version:
description: "major version"
value: ${{ jobs.get-version.outputs.version }}
@@ -25,6 +28,7 @@ jobs:
runs-on: ubuntu-22.04
outputs:
img_version: ${{ steps.get_version.outputs.img_version }}
+ test_img_version: ${{ steps.get_version.outputs.test_img_version }}
version: ${{ steps.get_version.outputs.version }}
patch: ${{ steps.get_version.outputs.patch }}
release: ${{ steps.get_version.outputs.release }}
@@ -32,14 +36,31 @@ jobs:
environment: ${{ steps.get_version.outputs.env }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+
+ - name: install gh cli on self-hosted runner
+ run: |
+ if ! command -v gh &> /dev/null; then
+ echo "Installing GH CLI."
+ type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
+ curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
+ sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg
+ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
+ sudo apt update
+ sudo apt install gh -y
+ else
+ echo "GH CLI is already installed."
+ fi
+ shell: bash
- id: get_version
run: |
- IMG_VERSION=$(md5sum conanfile.txt | awk '{print substr($1, 0, 8)}')
+ IMG_VERSION=$( cat `ls .github/docker/Dockerfile.centreon-collect-* | grep -v test` conanfile.txt | md5sum | awk '{print substr($1, 0, 8)}')
+ TEST_IMG_VERSION=$(cat .github/docker/Dockerfile.centreon-collect-*-test .github/scripts/collect-prepare-test-robot.sh resources/*.sql | md5sum | cut -c1-8)
VERSION=$(awk '$1 ~ "COLLECT_MAJOR" {maj=substr($2, 1, length($2)-1)} $1 ~ "COLLECT_MINOR" {min=substr($2, 1, length($2)-1) ; print maj "." min}' CMakeLists.txt)
PATCH=$(awk '$1 ~ "COLLECT_PATCH" {print substr($2, 1, length($2) - 1)}' CMakeLists.txt)
echo "img_version=$IMG_VERSION" >> $GITHUB_OUTPUT
+ echo "test_img_version=$TEST_IMG_VERSION" >> $GITHUB_OUTPUT
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "patch=$PATCH" >> $GITHUB_OUTPUT
@@ -50,9 +71,22 @@ jobs:
fi
case "$BRANCHNAME" in
- master | [2-9][0-9].[0-9][0-9].x | release* | hotfix*)
+ master | [2-9][0-9].[0-9][0-9].x)
echo "release=1" >> $GITHUB_OUTPUT
;;
+ release* | hotfix*)
+ # Handle workflow_dispatch run triggers
+ GITHUB_RELEASE_BRANCH_BASE_REF_NAME="$(gh pr view $BRANCHNAME -q .baseRefName --json headRefName,baseRefName,state)"
+ echo "GITHUB_RELEASE_BRANCH_BASE_REF_NAME is: $GITHUB_RELEASE_BRANCH_BASE_REF_NAME"
+ GITHUB_RELEASE_BRANCH_PR_STATE="$(gh pr view $BRANCHNAME -q .state --json headRefName,baseRefName,state)"
+ echo "GITHUB_RELEASE_BRANCH_PR_STATE is: $GITHUB_RELEASE_BRANCH_PR_STATE"
+ if [[ "$GITHUB_RELEASE_BRANCH_BASE_REF_NAME" == "master" ]] && [[ "$GITHUB_RELEASE_BRANCH_PR_STATE" == "OPEN" ]]; then
+ # This case is specific to cloud release
+ echo "release=`date +%s`.`echo ${{ github.sha }} | cut -c -7`" >> $GITHUB_OUTPUT
+ else
+ echo "release=1" >> $GITHUB_OUTPUT
+ fi
+ ;;
*)
echo "release=`date +%s`.`echo ${{ github.sha }} | cut -c -7`" >> $GITHUB_OUTPUT
;;
@@ -79,3 +113,5 @@ jobs:
echo "env=$VERSION-$ENV" >> $GITHUB_OUTPUT
echo "GH_ENV: $VERSION-$ENV"
shell: bash
+ env:
+ GH_TOKEN: ${{ github.token }}
diff --git a/.github/workflows/package-collect.yml b/.github/workflows/package-collect.yml
index 9a7d3eb8a24..c3b7a82f152 100644
--- a/.github/workflows/package-collect.yml
+++ b/.github/workflows/package-collect.yml
@@ -18,7 +18,6 @@ on:
jobs:
package:
-
strategy:
fail-fast: false
matrix:
@@ -46,6 +45,13 @@ jobs:
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.runner)) }}
+ env:
+ SCCACHE_PATH: "/usr/bin/sccache"
+ SCCACHE_BUCKET: "centreon-github-sccache"
+ SCCACHE_REGION: "eu-west-1"
+ AWS_ACCESS_KEY_ID: ${{ secrets.COLLECT_S3_ACCESS_KEY }}
+ AWS_SECRET_ACCESS_KEY: ${{ secrets.COLLECT_S3_SECRET_KEY }}
+
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:${{ inputs.img_version }}
credentials:
@@ -56,7 +62,26 @@ jobs:
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+
+ - name: Install sccache
+ run: |
+ if [ "${{ matrix.package_extension }}" = "deb" ]; then
+ apt-get update
+ apt-get install -y wget
+ elif [ "${{ matrix.package_extension }}" = "rpm" ]; then
+ dnf install -y wget
+ fi
+ if [ "${{ matrix.arch }}" = "amd64" ]; then
+ wget https://github.com/mozilla/sccache/releases/download/v0.7.4/sccache-v0.7.4-x86_64-unknown-linux-musl.tar.gz
+ tar xzf sccache-v0.7.4-x86_64-unknown-linux-musl.tar.gz
+ mv sccache-v0.7.4-x86_64-unknown-linux-musl/sccache /usr/bin/
+ elif [ "${{ matrix.arch }}" = "arm64" ]; then
+ wget https://github.com/mozilla/sccache/releases/download/v0.7.4/sccache-v0.7.4-aarch64-unknown-linux-musl.tar.gz
+ tar xzf sccache-v0.7.4-aarch64-unknown-linux-musl.tar.gz
+ mv sccache-v0.7.4-aarch64-unknown-linux-musl/sccache /usr/bin/
+ fi
+ ${SCCACHE_PATH} --start-server
- name: Generate selinux binaries
if: ${{ matrix.package_extension == 'rpm' }}
@@ -77,9 +102,9 @@ jobs:
- name: Compile sources
run: |
- sudo pip3 install conan==1.57.0 --prefix=/usr --upgrade
+ sudo pip3 install conan==1.61.0 --prefix=/usr --upgrade
- sudo conan install . -s compiler.cppstd=14 -s compiler.libcxx=libstdc++11 --build=missing
+ sudo conan install . -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing
CMAKE="cmake3"
if [ "${{ matrix.package_extension }}" = "deb" ]; then
@@ -104,11 +129,22 @@ jobs:
-DWITH_CREATE_FILES=OFF \
-DWITH_CONFIG_FILES=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DNG=ON \
+ -DCMAKE_C_COMPILER_LAUNCHER=${SCCACHE_PATH} \
+ -DCMAKE_CXX_COMPILER_LAUNCHER=${SCCACHE_PATH} \
.
sudo ninja
shell: bash
+ - name: Cache statistics
+ run: ${SCCACHE_PATH} --show-stats
+ shell: bash
+
+ - name: Stop sccache server
+ run: ${SCCACHE_PATH} --stop-server
+ shell: bash
+
- name: Generate debug files
run: |
for file in $(find ./{lib/*.so,bin} -type f); do
@@ -139,7 +175,7 @@ jobs:
# set condition to true if artifacts are needed
- if: ${{ false }}
name: Upload package artifacts
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
path: ./*.${{ matrix.package_extension}}
diff --git a/.github/workflows/rebase-master.yml b/.github/workflows/rebase-master.yml
index 44caf04f357..c2241297a0e 100644
--- a/.github/workflows/rebase-master.yml
+++ b/.github/workflows/rebase-master.yml
@@ -16,7 +16,7 @@ jobs:
if: github.event.pull_request.merged == true
steps:
- name: git checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
token: ${{ secrets.CENTREON_TECHNIQUE_PAT }}
diff --git a/.github/workflows/rebase-version.yml b/.github/workflows/rebase-version.yml
index 164dc622163..4be9a45361f 100644
--- a/.github/workflows/rebase-version.yml
+++ b/.github/workflows/rebase-version.yml
@@ -16,7 +16,7 @@ jobs:
if: github.event.pull_request.merged == true
steps:
- name: git checkout
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
token: ${{ secrets.CENTREON_TECHNIQUE_PAT }}
diff --git a/.github/workflows/release-collect.yml b/.github/workflows/release-collect.yml
index b49a2afc231..f91fab7a47f 100644
--- a/.github/workflows/release-collect.yml
+++ b/.github/workflows/release-collect.yml
@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
diff --git a/.github/workflows/robot-nightly.yml b/.github/workflows/robot-nightly.yml
index 02353da2f79..0816720af8d 100644
--- a/.github/workflows/robot-nightly.yml
+++ b/.github/workflows/robot-nightly.yml
@@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: |
gh workflow run robot-nightly.yml -r "dev-23.10.x"
@@ -30,6 +30,21 @@ jobs:
get-version:
uses: ./.github/workflows/get-version.yml
+ veracode-analysis:
+ needs: [get-version]
+ uses: ./.github/workflows/veracode-analysis.yml
+ with:
+ module_name: centreon-collect
+ major_version: ${{ needs.get-version.outputs.version }}
+ minor_version: ${{ needs.get-version.outputs.patch }}
+ img_version: ${{ needs.get-version.outputs.img_version }}
+ secrets:
+ veracode_api_id: ${{ secrets.VERACODE_API_ID_COLL }}
+ veracode_api_key: ${{ secrets.VERACODE_API_KEY_COLL }}
+ veracode_srcclr_token: ${{ secrets.VERACODE_SRCCLR_TOKEN }}
+ docker_registry_id: ${{ secrets.DOCKER_REGISTRY_ID }}
+ docker_registry_passwd: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
+
package:
needs: [get-version]
uses: ./.github/workflows/package-collect.yml
@@ -42,42 +57,60 @@ jobs:
robot-test:
needs: [get-version, package]
+
strategy:
fail-fast: false
matrix:
include:
- distrib: el9
- image: centreon-collect-alma9
+ image: centreon-collect-alma9-test
package_extension: rpm
arch: amd64
database_type: mariadb
+ test_group_name: robot_test-mariadb-el9-amd64
+ tests_params: '{}'
- distrib: el9
- image: centreon-collect-mysql-alma9
+ image: centreon-collect-mysql-alma9-test
package_extension: rpm
arch: amd64
database_type: mysql
+ test_group_name: robot_test-mysql-el9-amd64
+ tests_params: '{}'
- distrib: bullseye
- image: centreon-collect-debian-bullseye-arm64
+ image: centreon-collect-debian-bullseye-arm64-test
package_extension: deb
arch: arm64
database_type: mariadb
- name: robot test ${{ matrix.database_type }} ${{ matrix.distrib }} ${{ matrix.arch }}
+ test_group_name: robot_test-mariadb-el9-arm64
+ tests_params: '{}'
+ - distrib: el9
+ image: centreon-collect-alma9-test
+ package_extension: rpm
+ arch: amd64
+ database_type: mariadb
+ test_group_name: robot_test-mariadb-el9-amd64-grpc
+ tests_params: '{"default_transport":"grpc","default_bbdo_version":"3.1.0"}'
+
+ name: ${{ matrix.test_group_name }}
uses: ./.github/workflows/robot-test.yml
with:
distrib: ${{ matrix.distrib }}
arch: ${{ matrix.arch }}
image: ${{ matrix.image }}
+ image_test: ${{ matrix.image }}:${{ needs.get-version.outputs.test_img_version }}
image_version: ${{ needs.get-version.outputs.img_version }}
package_cache_key: cache-${{ github.sha }}-${{ matrix.package_extension}}-centreon-collect-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
package_cache_path: ./*.${{ matrix.package_extension}}
database_type: ${{ matrix.database_type }}
+ tests_params: ${{matrix.tests_params}}
+ test_group_name: ${{matrix.test_group_name}}
secrets:
registry_username: ${{ secrets.DOCKER_REGISTRY_ID }}
registry_password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
collect_s3_access_key: ${{ secrets.COLLECT_S3_ACCESS_KEY }}
collect_s3_secret_key: ${{ secrets.COLLECT_S3_SECRET_KEY }}
-
+
deliver-rpm:
if: ${{ contains(fromJson('["unstable"]'), needs.get-version.outputs.stability) }}
needs: [robot-test, get-version]
@@ -89,7 +122,7 @@ jobs:
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Publish RPM packages
uses: ./.github/actions/delivery
@@ -116,7 +149,7 @@ jobs:
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Publish DEB packages
uses: ./.github/actions/delivery
diff --git a/.github/workflows/robot-test.yml b/.github/workflows/robot-test.yml
index 3f87f26baa5..27d5bebf90a 100644
--- a/.github/workflows/robot-test.yml
+++ b/.github/workflows/robot-test.yml
@@ -10,6 +10,9 @@ on:
image:
required: true
type: string
+ image_test:
+ required: true
+ type: string
image_version:
required: true
type: string
@@ -22,6 +25,12 @@ on:
database_type:
required: true
type: string
+ tests_params:
+ required: true
+ type: string
+ test_group_name:
+ required: true
+ type: string
secrets:
registry_username:
required: true
@@ -34,14 +43,51 @@ on:
jobs:
+ test-image-to-cache:
+ runs-on: ${{ contains(inputs.image, 'arm') && fromJson('["self-hosted", "collect-arm64"]') || 'ubuntu-22.04' }}
+ steps:
+ - name: Checkout sources
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+
+ - name: Login to Registry
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
+ with:
+ registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
+ username: ${{ secrets.registry_username }}
+ password: ${{ secrets.registry_password }}
+
+ - name: Login to Proxy Registry
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
+ with:
+ registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
+ username: ${{ secrets.registry_username }}
+ password: ${{ secrets.registry_password }}
+
+ - name: load image
+ run: |
+ docker pull ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{inputs.image_test}}
+ shell: bash
+
+ - name: image to disk
+ run: |
+ docker save -o /tmp/${{inputs.image}} ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{inputs.image_test}}
+ shell: bash
+
+ - name: image to cache
+ uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
+ with:
+ path: /tmp/${{inputs.image}}
+ key: ${{inputs.image_test}}
+
robot-test-list:
+ needs: [test-image-to-cache]
runs-on: ubuntu-22.04
outputs:
features: ${{ steps.list-features.outputs.features }}
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: List features
id: list-features
@@ -52,57 +98,70 @@ jobs:
robot-test:
needs: [robot-test-list]
runs-on: ${{ contains(inputs.image, 'arm') && fromJson('["self-hosted", "collect-arm64"]') || 'ubuntu-22.04' }}
- container:
- image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{inputs.image}}:${{ inputs.image_version }}
- options: --privileged --ulimit core=-1 --security-opt seccomp=unconfined
- credentials:
- username: ${{ secrets.registry_username }}
- password: ${{ secrets.registry_password }}
strategy:
fail-fast: false
matrix:
feature: ${{ fromJson(needs.robot-test-list.outputs.features) }}
- name: ${{ matrix.feature }} ${{inputs.database_type}}
+ name: ${{ matrix.feature }} ${{inputs.test_group_name}}
steps:
- name: Checkout sources
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
+ - name: Restore image
+ uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
+ with:
+ path: /tmp/${{inputs.image}}
+ key: ${{inputs.image_test}}
+ fail-on-cache-miss: true
+
- name: Restore packages
- uses: actions/cache@v3
+ uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: ${{ inputs.package_cache_path }}
key: ${{ inputs.package_cache_key }}
fail-on-cache-miss: true
+ - name: load image
+ run: |
+ docker load --input /tmp/${{ inputs.image }}
+
- name: Test ${{ matrix.feature }}
- run: bash ./.github/scripts/collect-test-robot.sh ${{ matrix.feature }} ${{inputs.database_type}}
- shell: bash
+ run: |
+ docker run --rm --privileged --ulimit core=-1 --security-opt seccomp=unconfined \
+ -v $(pwd):/test_collect \
+ --env AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
+ --env AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
+ --env AWS_BUCKET=centreon-collect-robot-report \
+ --workdir /test_collect \
+ ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{inputs.image_test}} \
+ ./.github/scripts/collect-test-robot.sh \
+ ${{ matrix.feature }} ${{inputs.database_type}} ${{inputs.tests_params}}
+
env:
AWS_ACCESS_KEY_ID: ${{ secrets.collect_s3_access_key }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.collect_s3_secret_key }}
- AWS_BUCKET: centreon-collect-robot-report
- name: Move reports
if: ${{ failure() }}
run: |
mkdir reports
- FILE_PREFIX=`echo "${{ matrix.feature }}" | sed -e "s#/#__#g"`-${{inputs.database_type}}
+ FILE_PREFIX=`echo "${{ matrix.feature }}" | sed -e "s#/#__#g"`-${{inputs.test_group_name}}
if [ -d tests/failed ] ; then
- mv tests/log.html reports/$FILE_PREFIX-log.html
- mv tests/output.xml reports/$FILE_PREFIX-output.xml
- mv tests/failed reports/$FILE_PREFIX-failed
+ cp -rp tests/failed reports/$FILE_PREFIX-failed
+ cp tests/log.html reports/$FILE_PREFIX-log.html
+ cp tests/output.xml reports/$FILE_PREFIX-output.xml
fi
- name: Upload Test Results
if: ${{ failure() }}
- uses: actions/upload-artifact@v3
+ uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
- name: robot-test-reports-${{inputs.database_type}}-${{ inputs.distrib }}-${{ inputs.arch }}
+ name: reports-${{inputs.test_group_name}}
path: reports
retention-days: 1
@@ -112,12 +171,12 @@ jobs:
runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Download Artifacts
- uses: actions/download-artifact@v3
+ uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
- name: robot-test-reports-${{inputs.database_type}}-${{ inputs.distrib }}-${{ inputs.arch }}
+ name: reports-${{inputs.test_group_name}}
path: reports
- uses: actions/setup-python@v4
@@ -131,7 +190,7 @@ jobs:
shell: bash
- name: Send report to commit
- uses: joonvena/robotframework-reporter-action@v2.1
+ uses: joonvena/robotframework-reporter-action@413a90b26bb8a49eebc51af51f1631500ef0339d # v2.3
with:
gh_access_token: ${{ secrets.GITHUB_TOKEN }}
report_path: reports
diff --git a/.github/workflows/veracode-analysis.yml b/.github/workflows/veracode-analysis.yml
index 90b11c9c0f6..43952f3436c 100644
--- a/.github/workflows/veracode-analysis.yml
+++ b/.github/workflows/veracode-analysis.yml
@@ -11,9 +11,6 @@ on:
minor_version:
required: true
type: string
- stability:
- required: true
- type: string
img_version:
required: true
type: string
@@ -33,7 +30,6 @@ jobs:
build:
name: Binary preparation
runs-on: [self-hosted, collect]
- if: github.event_name != 'pull_request' && (inputs.stability == 'stable' || inputs.stability == 'unstable')
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/centreon-collect-alma9:${{ inputs.img_version }}
credentials:
@@ -41,7 +37,7 @@ jobs:
password: ${{ secrets.docker_registry_passwd }}
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Compiling Cpp sources
run: |
@@ -49,12 +45,13 @@ jobs:
mkdir build
cd build
- sudo pip3 install conan==1.57.0 --prefix=/usr --upgrade
- sudo conan install .. -s compiler.cppstd=14 -s compiler.libcxx=libstdc++11 --build=missing
+ sudo pip3 install conan==1.61.0 --prefix=/usr --upgrade
+ sudo conan install .. -s compiler.cppstd=17 -s compiler.libcxx=libstdc++11 --build=missing
sudo cmake \
-G "Ninja" \
-DCMAKE_CXX_FLAGS="-gdwarf-2 -g3 -O0 -fno-builtin" \
+ -DDEBUG_ROBOT=OFF \
-DWITH_TESTING=OFF \
-DWITH_BENCH=OFF \
-DWITH_MODULE_SIMU=OFF \
@@ -69,14 +66,23 @@ jobs:
-DWITH_DAEMONS=ON \
-DWITH_CREATE_FILES=OFF \
-DWITH_CONFIG_FILES=ON \
+ -DNG=ON \
..
sudo ninja
+ echo "[DEBUG] - Find compiled files"
+ find ./ -name "*.so"
+ echo "[DEBUG] - Build size"
+ du -sh ./lib/*.so | sort -rh
+
- name: Binary preparation
run: |
echo "[INFO] - Keeping only compiled files"
- find ./build -type f -not \( -name "*.so" -o -name "*.h" -o -name "*.cc" -o -name "*.hpp" \) -delete
+ # preserve binaries from cleaning
+ mv ./build/bin ./
+ find ./build -type f -not \( -name "*.so" \) -delete
+ mv ./bin ./build
echo "[INFO] - Removing veracode exclusions"
if [[ -f ".veracode-exclusions" ]]; then
@@ -90,18 +96,21 @@ jobs:
elif [[ -z "$LINE" ]]; then
echo "[INFO] - empty directive. Skipping this line"
else
- echo "[WARN] - target to exclude not found. Skipping: '$LINE'"
+ echo "::warning::Target to exclude from analysis not found. Skipping: '$LINE'"
fi
done
else
- echo "[WARN] - No '.veracode-exclusions' file found for this module. Skipping exclusion step"
+ echo "::warning::No '.veracode-exclusions' file found for this module. Skipping exclusion step"
fi
+ echo "[INFO] - Keeping only build's non empty folders"
+ find ./build -empty -type d -delete
+ ls -la ./build
echo "[INFO] - Generating the tarball"
tar cvzf "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.tar.gz" build
- name: Cache
- uses: actions/cache/save@v3
+ uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.tar.gz"
key: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary"
@@ -113,15 +122,13 @@ jobs:
steps:
- name: Promote latest scan
- # Only last develop should be promoted to policy scan
if: github.ref_name == 'develop'
-
env:
VERACODE_API_ID: "${{ secrets.veracode_api_id }}"
VERACODE_API_SECRET: "${{ secrets.veracode_api_key }}"
# Action forked as API calls hardcoded '.com' route
- uses: sc979/veracode-sandboxes-helper@v0.2
+ uses: sc979/veracode-sandboxes-helper@cf67241c27cbe6405ad8705111121ece9a48c4ff # v0.2
# Promote should not fail if sandbox was not found.
continue-on-error: true
with:
@@ -131,7 +138,7 @@ jobs:
delete-on-promote: false
- name: Get build binary
- uses: actions/cache/restore@v3
+ uses: actions/cache/restore@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
with:
path: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary.tar.gz"
key: "${{ inputs.module_name }}-${{ github.sha }}-${{ github.run_id }}-veracode-binary"
@@ -148,8 +155,6 @@ jobs:
createprofile: true
createsandbox: true
sandboxname: "${{ github.ref_name }}"
- #scantimeout: 120
includenewmodules: true
scanallnonfataltoplevelmodules: true
deleteincompletescan: 2
- scanpollinginterval: 120 # time between two checks in seconds / [30 to 120]
diff --git a/.veracode-exclusions b/.veracode-exclusions
index 49e09c0ea80..ae5b950d44e 100644
--- a/.veracode-exclusions
+++ b/.veracode-exclusions
@@ -35,3 +35,4 @@ engine/src/simumod/coder.pl
grpc/centreon-rpc-client.py
tests
packaging
+/root/.conan/
diff --git a/.version b/.version
new file mode 100644
index 00000000000..9a1d1d75c3b
--- /dev/null
+++ b/.version
@@ -0,0 +1,2 @@
+MAJOR=24.04
+MINOR=0
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 935229c2312..273ca6aedef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,8 +123,8 @@ if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
endif()
# Version.
-set(COLLECT_MAJOR 23)
-set(COLLECT_MINOR 10)
+set(COLLECT_MAJOR 24)
+set(COLLECT_MINOR 04)
set(COLLECT_PATCH 0)
set(COLLECT_VERSION "${COLLECT_MAJOR}.${COLLECT_MINOR}.${COLLECT_PATCH}")
add_definitions(-DCENTREON_CONNECTOR_VERSION=\"${COLLECT_VERSION}\")
diff --git a/bbdo/CMakeLists.txt b/bbdo/CMakeLists.txt
index a9a27c522a4..bd7c2a736c7 100644
--- a/bbdo/CMakeLists.txt
+++ b/bbdo/CMakeLists.txt
@@ -78,6 +78,19 @@ add_library(pb_extcmd_lib STATIC extcmd.pb.cc extcmd.pb.h)
add_dependencies(pb_extcmd_lib target_extcmd target_header)
set_target_properties(pb_extcmd_lib PROPERTIES POSITION_INDEPENDENT_CODE ON)
+add_library(pb_rebuild_message_lib STATIC rebuild_message.pb.cc
+ rebuild_message.pb.h)
+add_dependencies(pb_rebuild_message_lib target_rebuild_message target_header)
+set_target_properties(pb_rebuild_message_lib
+ PROPERTIES POSITION_INDEPENDENT_CODE ON)
+
+add_library(pb_remove_graph_message_lib STATIC remove_graph_message.pb.cc
+ remove_graph_message.pb.h)
+add_dependencies(pb_remove_graph_message_lib target_remove_graph_message
+ target_header)
+set_target_properties(pb_remove_graph_message_lib
+ PROPERTIES POSITION_INDEPENDENT_CODE ON)
+
macro(get_protobuf_files name)
set_source_files_properties("${CMAKE_SOURCE_DIR}/bbdo/${name}.pb.cc"
PROPERTIES GENERATED TRUE)
diff --git a/bbdo/bam.proto b/bbdo/bam.proto
index f27498d83cd..64084f86811 100644
--- a/bbdo/bam.proto
+++ b/bbdo/bam.proto
@@ -29,12 +29,14 @@ enum State {
UNKNOWN = 3;
}
+/*io::bam, bam::de_pb_inherited_downtime*/
message InheritedDowntime {
BBDOHeader header = 1;
uint32 ba_id = 2;
bool in_downtime = 3;
}
+/*io::bam, bam::de_pb_ba_status*/
message BaStatus {
uint32 ba_id = 2;
bool in_downtime = 3;
@@ -47,6 +49,7 @@ message BaStatus {
string output = 10;
}
+/*io::bam, bam::de_pb_ba_event*/
message BaEvent {
uint32 ba_id = 1;
double first_level = 2;
@@ -56,6 +59,7 @@ message BaEvent {
State status = 6;
}
+/*io::bam, bam::de_pb_kpi_event*/
message KpiEvent {
uint32 ba_id = 1;
uint64 start_time = 2;
@@ -68,17 +72,20 @@ message KpiEvent {
State status = 9;
}
+/*io::bam, bam::de_pb_dimension_bv_event*/
message DimensionBvEvent {
uint32 bv_id = 1;
string bv_name = 2;
string bv_description = 3;
}
+/*io::bam, bam::de_pb_dimension_ba_bv_relation_event*/
message DimensionBaBvRelationEvent {
uint32 ba_id = 1;
uint32 bv_id = 2;
}
+/*io::bam, bam::de_pb_dimension_timeperiod*/
message DimensionTimeperiod {
uint32 id = 1;
string name = 2;
@@ -91,6 +98,7 @@ message DimensionTimeperiod {
string sunday = 9;
}
+/*io::bam, bam::de_pb_dimension_ba_event*/
message DimensionBaEvent {
uint32 ba_id = 1;
string ba_name = 2;
@@ -101,6 +109,7 @@ message DimensionBaEvent {
uint32 sla_duration_warn = 7;
}
+/*io::bam, bam::de_pb_dimension_kpi_event*/
message DimensionKpiEvent {
uint32 kpi_id = 1;
uint32 ba_id = 2;
@@ -120,6 +129,7 @@ message DimensionKpiEvent {
double impact_unknown = 16;
}
+/*io::bam, bam::de_pb_kpi_status*/
message KpiStatus {
uint32 kpi_id = 1;
bool in_downtime = 2;
@@ -136,6 +146,7 @@ message KpiStatus {
bool valid = 13;
}
+/*io::bam, bam::de_pb_ba_duration_event*/
message BaDurationEvent {
uint32 ba_id = 1;
int64 real_start_time = 2;
@@ -147,12 +158,14 @@ message BaDurationEvent {
bool timeperiod_is_default = 8;
}
+/*io::bam, bam::de_pb_dimension_ba_timeperiod_relation*/
message DimensionBaTimeperiodRelation {
uint32 ba_id = 1;
uint32 timeperiod_id = 2;
bool is_default = 3;
}
+/*io::bam, bam::de_pb_dimension_truncate_table_signal*/
message DimensionTruncateTableSignal {
bool update_started = 1;
}
\ No newline at end of file
diff --git a/bbdo/bam/ba_duration_event.cc b/bbdo/bam/ba_duration_event.cc
index 12b909b87a7..9e4076a1f78 100644
--- a/bbdo/bam/ba_duration_event.cc
+++ b/bbdo/bam/ba_duration_event.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015, 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 : contact@centreon.com
+/**
+* Copyright 2014-2015, 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 : contact@centreon.com
*/
#include "bbdo/bam/ba_duration_event.hh"
diff --git a/bbdo/bam/ba_duration_event.hh b/bbdo/bam/ba_duration_event.hh
index 47a4eb58823..abe26b3877e 100644
--- a/bbdo/bam/ba_duration_event.hh
+++ b/bbdo/bam/ba_duration_event.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014, 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014, 2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_BA_DURATION_EVENT_HH
#define CCB_BAM_BA_DURATION_EVENT_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class ba_duration_event ba_duration_event.hh
* "com/centreon/broker/bam/ba_duration_event.hh"
@@ -62,8 +59,6 @@ class ba_duration_event : public io::data {
private:
void _internal_copy(ba_duration_event const& other);
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_BA_DURATION_EVENT_HH
diff --git a/bbdo/bam/ba_event.cc b/bbdo/bam/ba_event.cc
index b8f32ba5df4..6bd19805df1 100644
--- a/bbdo/bam/ba_event.cc
+++ b/bbdo/bam/ba_event.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015, 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 : contact@centreon.com
+/**
+* Copyright 2014-2015, 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 : contact@centreon.com
*/
#include "bbdo/bam/ba_event.hh"
diff --git a/bbdo/bam/ba_event.hh b/bbdo/bam/ba_event.hh
index 735584dff58..af16073ec2f 100644
--- a/bbdo/bam/ba_event.hh
+++ b/bbdo/bam/ba_event.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_BA_EVENT_HH
#define CCB_BAM_BA_EVENT_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class ba_event ba_event.hh "com/centreon/broker/bam/ba_event.hh"
* @brief Ba event
@@ -58,8 +55,6 @@ class ba_event : public io::data {
private:
void _internal_copy(ba_event const& other);
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_BA_EVENT_HH
diff --git a/bbdo/bam/ba_status.cc b/bbdo/bam/ba_status.cc
index 7b6d56ed1f4..d62bdddd8a7 100644
--- a/bbdo/bam/ba_status.cc
+++ b/bbdo/bam/ba_status.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015, 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 : contact@centreon.com
+/**
+* Copyright 2014-2015, 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 : contact@centreon.com
*/
#include "bbdo/bam/ba_status.hh"
diff --git a/bbdo/bam/ba_status.hh b/bbdo/bam/ba_status.hh
index 9b429d60127..209ee02258c 100644
--- a/bbdo/bam/ba_status.hh
+++ b/bbdo/bam/ba_status.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014, 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014, 2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_BA_STATUS_HH
#define CCB_BAM_BA_STATUS_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class ba_status ba_status.hh "com/centreon/broker/bam/ba_status.hh"
* @brief Update status of a BA.
@@ -61,8 +58,6 @@ class ba_status : public io::data {
private:
void _internal_copy(ba_status const& other);
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_BA_STATUS_HH
diff --git a/bbdo/bam/dimension_ba_bv_relation_event.cc b/bbdo/bam/dimension_ba_bv_relation_event.cc
index 48e9b7eaccc..ca96b7c87f9 100644
--- a/bbdo/bam/dimension_ba_bv_relation_event.cc
+++ b/bbdo/bam/dimension_ba_bv_relation_event.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-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 : contact@centreon.com
+/**
+* Copyright 2014-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 : contact@centreon.com
*/
#include "bbdo/bam/dimension_ba_bv_relation_event.hh"
diff --git a/bbdo/bam/dimension_ba_bv_relation_event.hh b/bbdo/bam/dimension_ba_bv_relation_event.hh
index 22b8fd8b97c..1b79c87d2f1 100644
--- a/bbdo/bam/dimension_ba_bv_relation_event.hh
+++ b/bbdo/bam/dimension_ba_bv_relation_event.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_DIMENSION_BA_BV_RELATION_EVENT_HH
#define CCB_BAM_DIMENSION_BA_BV_RELATION_EVENT_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class dimension_ba_bv_relation_event dimension_ba_bv_relation_event.hh
* "com/centreon/broker/bam/dimension_ba_bv_relation_event.hh"
@@ -58,8 +55,6 @@ class dimension_ba_bv_relation_event : public io::data {
private:
void _internal_copy(dimension_ba_bv_relation_event const& other);
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_DIMENSION_BA_BV_RELATION_EVENT_HH
diff --git a/bbdo/bam/dimension_ba_event.cc b/bbdo/bam/dimension_ba_event.cc
index f6518c5d59f..bc124013379 100644
--- a/bbdo/bam/dimension_ba_event.cc
+++ b/bbdo/bam/dimension_ba_event.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-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 : contact@centreon.com
+/**
+* Copyright 2014-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 : contact@centreon.com
*/
#include "bbdo/bam/dimension_ba_event.hh"
diff --git a/bbdo/bam/dimension_ba_event.hh b/bbdo/bam/dimension_ba_event.hh
index e7eaf7126a6..ac1ea83057a 100644
--- a/bbdo/bam/dimension_ba_event.hh
+++ b/bbdo/bam/dimension_ba_event.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_DIMENSION_BA_EVENT_HH
#define CCB_BAM_DIMENSION_BA_EVENT_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class dimension_ba_event dimension_ba_event.hh
* "com/centreon/broker/bam/dimension_ba_event.hh"
@@ -61,8 +58,6 @@ class dimension_ba_event : public io::data {
private:
void _internal_copy(dimension_ba_event const& other);
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_DIMENSION_BA_EVENT_HH
diff --git a/bbdo/bam/dimension_ba_timeperiod_relation.cc b/bbdo/bam/dimension_ba_timeperiod_relation.cc
index 82f19ab6dfe..1429c449227 100644
--- a/bbdo/bam/dimension_ba_timeperiod_relation.cc
+++ b/bbdo/bam/dimension_ba_timeperiod_relation.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-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 : contact@centreon.com
+/**
+* Copyright 2014-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 : contact@centreon.com
*/
#include "bbdo/bam/dimension_ba_timeperiod_relation.hh"
diff --git a/bbdo/bam/dimension_ba_timeperiod_relation.hh b/bbdo/bam/dimension_ba_timeperiod_relation.hh
index 19279893c1c..f116a873aa5 100644
--- a/bbdo/bam/dimension_ba_timeperiod_relation.hh
+++ b/bbdo/bam/dimension_ba_timeperiod_relation.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_DIMENSION_BA_TIMEPERIOD_RELATION_HH
#define CCB_BAM_DIMENSION_BA_TIMEPERIOD_RELATION_HH
@@ -24,11 +24,8 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class dimension_ba_timeperiod_relation dimension_ba_timeperiod_relation.hh
* "com/centreon/broker/bam/dimension_ba_timeperiod_relation.hh"
@@ -58,8 +55,6 @@ class dimension_ba_timeperiod_relation : public io::data {
private:
void _internal_copy(dimension_ba_timeperiod_relation const& other);
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_DIMENSION_BA_TIMEPERIOD_RELATION_HH
diff --git a/bbdo/bam/dimension_bv_event.cc b/bbdo/bam/dimension_bv_event.cc
index d13e2d810e2..a35c020c0a8 100644
--- a/bbdo/bam/dimension_bv_event.cc
+++ b/bbdo/bam/dimension_bv_event.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-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 : contact@centreon.com
+/**
+* Copyright 2014-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 : contact@centreon.com
*/
#include "bbdo/bam/dimension_bv_event.hh"
diff --git a/bbdo/bam/dimension_bv_event.hh b/bbdo/bam/dimension_bv_event.hh
index bddd022948c..3ee958b42e9 100644
--- a/bbdo/bam/dimension_bv_event.hh
+++ b/bbdo/bam/dimension_bv_event.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_DIMENSION_BV_EVENT_HH
#define CCB_BAM_DIMENSION_BV_EVENT_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class dimension_bv_event dimension_bv_event.hh
* "com/centreon/broker/bam/dimension_bv_event.hh"
@@ -57,8 +54,6 @@ class dimension_bv_event : public io::data {
private:
void _internal_copy(dimension_bv_event const& other);
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_DIMENSION_BV_EVENT_HH
diff --git a/bbdo/bam/dimension_kpi_event.cc b/bbdo/bam/dimension_kpi_event.cc
index 7a48fa6189f..f63ba81d1ab 100644
--- a/bbdo/bam/dimension_kpi_event.cc
+++ b/bbdo/bam/dimension_kpi_event.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015,2019-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 : contact@centreon.com
+/**
+* Copyright 2014-2015,2019-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 : contact@centreon.com
*/
#include "bbdo/bam/dimension_kpi_event.hh"
diff --git a/bbdo/bam/dimension_kpi_event.hh b/bbdo/bam/dimension_kpi_event.hh
index da054ee072f..1e3e5ced45a 100644
--- a/bbdo/bam/dimension_kpi_event.hh
+++ b/bbdo/bam/dimension_kpi_event.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014,2019-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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014,2019-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_DIMENSION_KPI_EVENT_HH
#define CCB_BAM_DIMENSION_KPI_EVENT_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class dimension_kpi_event dimension_kpi_event.hh
* "com/centreon/broker/bam/dimension_kpi_event.hh"
@@ -67,8 +64,6 @@ class dimension_kpi_event : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_DIMENSION_KPI_EVENT_HH
diff --git a/bbdo/bam/dimension_timeperiod.cc b/bbdo/bam/dimension_timeperiod.cc
index 9efdea77897..b6177b8bc5b 100644
--- a/bbdo/bam/dimension_timeperiod.cc
+++ b/bbdo/bam/dimension_timeperiod.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-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 : contact@centreon.com
+/**
+* Copyright 2014-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 : contact@centreon.com
*/
#include "bbdo/bam/dimension_timeperiod.hh"
diff --git a/bbdo/bam/dimension_timeperiod.hh b/bbdo/bam/dimension_timeperiod.hh
index 5d88005f08d..3febad2583c 100644
--- a/bbdo/bam/dimension_timeperiod.hh
+++ b/bbdo/bam/dimension_timeperiod.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_DIMENSION_TIMEPERIOD_HH
#define CCB_BAM_DIMENSION_TIMEPERIOD_HH
@@ -24,11 +24,8 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class dimension_timeperiod dimension_timeperiod.hh
* "com/centreon/broker/bam/dimension_timeperiod.hh"
@@ -59,8 +56,6 @@ class dimension_timeperiod : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_DIMENSION_TIMEPERIOD_HH
diff --git a/bbdo/bam/dimension_truncate_table_signal.cc b/bbdo/bam/dimension_truncate_table_signal.cc
index 4f79afe6a57..6f808c20d0a 100644
--- a/bbdo/bam/dimension_truncate_table_signal.cc
+++ b/bbdo/bam/dimension_truncate_table_signal.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2020 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 : contact@centreon.com
+/**
+* Copyright 2014-2020 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 : contact@centreon.com
*/
#include "bbdo/bam/dimension_truncate_table_signal.hh"
diff --git a/bbdo/bam/dimension_truncate_table_signal.hh b/bbdo/bam/dimension_truncate_table_signal.hh
index 003504f1e90..adf2107af4c 100644
--- a/bbdo/bam/dimension_truncate_table_signal.hh
+++ b/bbdo/bam/dimension_truncate_table_signal.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_DIMENSION_TRUNCATE_TABLE_SIGNAL_HH
#define CCB_BAM_DIMENSION_TRUNCATE_TABLE_SIGNAL_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class dimension_truncate_table_signal dimension_truncate_table_signal.hh
* "com/centreon/broker/bam/dimension_truncate_table_signal.hh"
@@ -57,8 +54,6 @@ class dimension_truncate_table_signal : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_DIMENSION_TRUNCATE_TABLE_SIGNAL_HH
diff --git a/bbdo/bam/inherited_downtime.cc b/bbdo/bam/inherited_downtime.cc
index 3aa997c1811..d6ebdc10b39 100644
--- a/bbdo/bam/inherited_downtime.cc
+++ b/bbdo/bam/inherited_downtime.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-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 : contact@centreon.com
+/**
+* Copyright 2014-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 : contact@centreon.com
*/
#include "bbdo/bam/inherited_downtime.hh"
diff --git a/bbdo/bam/inherited_downtime.hh b/bbdo/bam/inherited_downtime.hh
index 0b4e79fa965..45b7265fb46 100644
--- a/bbdo/bam/inherited_downtime.hh
+++ b/bbdo/bam/inherited_downtime.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014, 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014, 2021-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_INHERITED_DOWNTIME_HH
#define CCB_BAM_INHERITED_DOWNTIME_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class ba_status ba_status.hh "com/centreon/broker/bam/ba_status.hh"
* @brief Update status of a BA.
@@ -55,8 +52,6 @@ class inherited_downtime : public io::data {
private:
void _internal_copy(inherited_downtime const& other);
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_INHERITED_DOWNTIME_HH
diff --git a/bbdo/bam/kpi_event.cc b/bbdo/bam/kpi_event.cc
index 9b61e580f1c..3dabcf0ca64 100644
--- a/bbdo/bam/kpi_event.cc
+++ b/bbdo/bam/kpi_event.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015, 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 : contact@centreon.com
+/**
+* Copyright 2014-2015, 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 : contact@centreon.com
*/
#include "bbdo/bam/kpi_event.hh"
diff --git a/bbdo/bam/kpi_event.hh b/bbdo/bam/kpi_event.hh
index 278b477ddb2..5936e662f4f 100644
--- a/bbdo/bam/kpi_event.hh
+++ b/bbdo/bam/kpi_event.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014, 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014, 2021-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_KPI_EVENT_HH
#define CCB_BAM_KPI_EVENT_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class kpi_event kpi_event.hh "com/centreon/broker/bam/kpi_event.hh"
* @brief Kpi event
@@ -60,8 +57,6 @@ class kpi_event : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_KPI_EVENT_HH
diff --git a/bbdo/bam/kpi_status.cc b/bbdo/bam/kpi_status.cc
index 3771469e1e8..e1f7c5bef83 100644
--- a/bbdo/bam/kpi_status.cc
+++ b/bbdo/bam/kpi_status.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015, 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 : contact@centreon.com
+/**
+* Copyright 2014-2015, 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 : contact@centreon.com
*/
#include "bbdo/bam/kpi_status.hh"
diff --git a/bbdo/bam/kpi_status.hh b/bbdo/bam/kpi_status.hh
index 9a82a831388..77b2c225aa0 100644
--- a/bbdo/bam/kpi_status.hh
+++ b/bbdo/bam/kpi_status.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014-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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_KPI_STATUS_HH
#define CCB_BAM_KPI_STATUS_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class kpi_status kpi_status.hh "com/centreon/broker/bam/kpi_status.hh"
* @brief Update status of a KPI.
@@ -63,8 +60,6 @@ class kpi_status : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_KPI_STATUS_HH
diff --git a/bbdo/bam/rebuild.cc b/bbdo/bam/rebuild.cc
index 1ba21101857..4bc4e5693c6 100644
--- a/bbdo/bam/rebuild.cc
+++ b/bbdo/bam/rebuild.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-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 : contact@centreon.com
+/**
+* Copyright 2014-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 : contact@centreon.com
*/
#include "bbdo/bam/rebuild.hh"
diff --git a/bbdo/bam/rebuild.hh b/bbdo/bam/rebuild.hh
index 7030d910356..b965bcf3ec7 100644
--- a/bbdo/bam/rebuild.hh
+++ b/bbdo/bam/rebuild.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_REBUILD_HH
#define CCB_BAM_REBUILD_HH
@@ -24,11 +24,8 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
/**
* @class rebuild rebuild.hh "com/centreon/broker/bam/rebuild.hh"
* @brief ask for a rebuild.
@@ -52,8 +49,6 @@ class rebuild : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_REBUILD_HH
diff --git a/bbdo/bam/state.hh b/bbdo/bam/state.hh
index 061d0615d7d..def67c46e81 100644
--- a/bbdo/bam/state.hh
+++ b/bbdo/bam/state.hh
@@ -1,30 +1,27 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_STATE_HH
#define CCB_BAM_STATE_HH
#include "bbdo/bam.pb.h"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
-
-namespace bam {
+namespace com::centreon::broker::bam {
enum state {
state_ok = 0,
state_warning = 1,
@@ -35,8 +32,6 @@ enum state {
constexpr std::array state_str{"OK", "WARNING", "CRITICAL",
"UNKNOWN"};
-} // namespace bam
-
-CCB_END()
+} // namespace com::centreon::broker::bam
#endif // !CCB_BAM_STATE_HH
diff --git a/bbdo/bbdo.proto b/bbdo/bbdo.proto
index 9c676965d42..cc4aa5f6553 100644
--- a/bbdo/bbdo.proto
+++ b/bbdo/bbdo.proto
@@ -20,12 +20,14 @@ syntax = "proto3";
package com.centreon.broker;
+
message Bbdo {
uint32 major = 1;
uint32 minor = 2;
uint32 patch = 3;
}
+/*io::bbdo, bbdo::de_welcome*/
message Welcome {
Bbdo version = 1;
string extensions = 2;
@@ -33,10 +35,11 @@ message Welcome {
string poller_name = 4;
}
-
+/*io::bbdo, bbdo::de_pb_ack*/
message Ack {
uint32 acknowledged_events = 1;
}
+/*io::bbdo, bbdo::de_pb_stop*/
message Stop {
}
\ No newline at end of file
diff --git a/bbdo/bbdo/ack.cc b/bbdo/bbdo/ack.cc
index f86ffdff5ae..06ef1ff0c9c 100644
--- a/bbdo/bbdo/ack.cc
+++ b/bbdo/bbdo/ack.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2013, 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 : contact@centreon.com
+/**
+* Copyright 2013, 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 : contact@centreon.com
*/
#include "bbdo/bbdo/ack.hh"
diff --git a/bbdo/bbdo/ack.hh b/bbdo/bbdo/ack.hh
index d96fe869407..6a3427d57ea 100644
--- a/bbdo/bbdo/ack.hh
+++ b/bbdo/bbdo/ack.hh
@@ -25,11 +25,8 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
-
-namespace bbdo {
+namespace com::centreon::broker::bbdo {
/**
* @class ack ack.hh "com/centreon/broker/bbdo/ack.hh"
* @brief An ack event sent between two bbdo's endpoint.
@@ -58,8 +55,6 @@ class ack : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace bbdo
-
-CCB_END()
+} // namespace com::centreon::broker::bbdo
#endif // !CCB_BBDO_VERSION_RESPONSE_HH
diff --git a/bbdo/bbdo/bbdo_version.hh b/bbdo/bbdo/bbdo_version.hh
index 4b46b5ba8be..c05581c77ef 100644
--- a/bbdo/bbdo/bbdo_version.hh
+++ b/bbdo/bbdo/bbdo_version.hh
@@ -1,29 +1,25 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BBDO_VERSION_HH
#define CCB_BBDO_VERSION_HH
-#include "com/centreon/broker/namespace.hh"
-
-CCB_BEGIN()
-
-namespace bbdo {
+namespace com::centreon::broker::bbdo {
union bbdo_version {
struct {
@@ -43,8 +39,6 @@ union bbdo_version {
: patch(ptch), minor_v(min), major_v(maj) {}
};
-} // namespace bbdo
-
-CCB_END()
+} // namespace com::centreon::broker::bbdo
#endif
diff --git a/bbdo/bbdo/stop.cc b/bbdo/bbdo/stop.cc
index bc270c2fc68..ca0ff2877fe 100644
--- a/bbdo/bbdo/stop.cc
+++ b/bbdo/bbdo/stop.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 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 : contact@centreon.com
+/**
+* Copyright 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 : contact@centreon.com
*/
#include "bbdo/bbdo/stop.hh"
diff --git a/bbdo/bbdo/stop.hh b/bbdo/bbdo/stop.hh
index ee6ea4b5af5..0074f402e6b 100644
--- a/bbdo/bbdo/stop.hh
+++ b/bbdo/bbdo/stop.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2021-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BBDO_STOP_HH
#define CCB_BBDO_STOP_HH
@@ -25,11 +25,8 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
-
-namespace bbdo {
+namespace com::centreon::broker::bbdo {
/**
* @class stop stop.hh "com/centreon/broker/bbdo/stop.hh"
* @brief An stop event sent between two bbdo's endpoint.
@@ -57,8 +54,6 @@ class stop : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace bbdo
-
-CCB_END()
+} // namespace com::centreon::broker::bbdo
#endif // !CCB_BBDO_STOP_HH
diff --git a/bbdo/bbdo/version_response.cc b/bbdo/bbdo/version_response.cc
index c799184d716..6724fef4522 100644
--- a/bbdo/bbdo/version_response.cc
+++ b/bbdo/bbdo/version_response.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2013, 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 : contact@centreon.com
+/**
+* Copyright 2013, 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 : contact@centreon.com
*/
#include "bbdo/bbdo/version_response.hh"
diff --git a/bbdo/bbdo/version_response.hh b/bbdo/bbdo/version_response.hh
index 384df3f78b9..669be85b480 100644
--- a/bbdo/bbdo/version_response.hh
+++ b/bbdo/bbdo/version_response.hh
@@ -26,11 +26,8 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
-
-namespace bbdo {
+namespace com::centreon::broker::bbdo {
/**
* @class version_response version_response.hh
* "com/centreon/broker/bbdo/version_response.hh"
@@ -63,8 +60,6 @@ class version_response : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace bbdo
-
-CCB_END()
+} // namespace com::centreon::broker::bbdo
#endif // !CCB_BBDO_VERSION_RESPONSE_HH
diff --git a/bbdo/events.hh b/bbdo/events.hh
index 40690def059..feaf399629c 100644
--- a/bbdo/events.hh
+++ b/bbdo/events.hh
@@ -39,21 +39,21 @@ enum data_category {
internal = 65535
};
constexpr uint16_t category_id(const char* name) {
- if (absl::string_view("neb", 3) == name)
+ if (std::string_view("neb", 3) == name)
return neb;
- if (absl::string_view("bbdo", 4) == name)
+ if (std::string_view("bbdo", 4) == name)
return bbdo;
- if (absl::string_view("storage", 7) == name)
+ if (std::string_view("storage", 7) == name)
return storage;
- if (absl::string_view("internal", 8) == name)
+ if (std::string_view("internal", 8) == name)
return internal;
- if (absl::string_view("bam", 3) == name)
+ if (std::string_view("bam", 3) == name)
return bam;
- if (absl::string_view("extcmd", 6) == name)
+ if (std::string_view("extcmd", 6) == name)
return extcmd;
- if (absl::string_view("dumper", 6) == name)
+ if (std::string_view("dumper", 6) == name)
return dumper;
- if (absl::string_view("generator", 9) == name)
+ if (std::string_view("generator", 9) == name)
return generator;
return none;
}
@@ -101,7 +101,7 @@ enum data_element {
de_custom_variable,
de_custom_variable_status,
de_downtime,
- de_event_handler = 6,
+ de_event_handler = 6, // unused
de_flapping_status = 7, // unused
de_host_check = 8,
de_host_dependency = 9,
@@ -142,6 +142,12 @@ enum data_element {
de_pb_instance = 44,
de_pb_acknowledgement = 45,
de_pb_responsive_instance = 46,
+ de_pb_host_dependency = 47,
+ de_pb_service_dependency = 48,
+ de_pb_host_group = 49,
+ de_pb_host_group_member = 50,
+ de_pb_service_group = 51,
+ de_pb_service_group_member = 52
};
} // namespace neb
namespace storage {
diff --git a/bbdo/extcmd.proto b/bbdo/extcmd.proto
index efeec742e01..f0cadaf0397 100644
--- a/bbdo/extcmd.proto
+++ b/bbdo/extcmd.proto
@@ -36,6 +36,7 @@ message TimePoint {
* from engine to dest with several timepoints (one per muxer)
*
*/
+/*io::extcmd, extcmd::de_pb_bench*/
message Bench {
uint32 id = 1;
repeated TimePoint points = 2;
diff --git a/bbdo/neb.proto b/bbdo/neb.proto
index 65cfc597b41..2dccce236d4 100644
--- a/bbdo/neb.proto
+++ b/bbdo/neb.proto
@@ -41,6 +41,7 @@ enum AckType {
STICKY = 2;
}
+/*io::neb, neb::de_pb_service*/
message Service {
uint64 host_id = 1;
uint64 service_id = 2;
@@ -159,6 +160,7 @@ message Service {
/**
* @brief Message sent in BBDO 3.0.0 instead of neb::service_status
*/
+/*io::neb, neb::de_pb_service_status*/
message ServiceStatus {
uint64 host_id = 1;
uint64 service_id = 2;
@@ -225,6 +227,7 @@ message ServiceStatus {
*
* Only used with BBDO 3.0
*/
+/*io::neb, neb::de_pb_adaptive_service*/
message AdaptiveService {
uint64 host_id = 1;
uint64 service_id = 2;
@@ -246,6 +249,7 @@ message AdaptiveService {
optional string notification_period = 17;
}
+/*io::neb, neb::de_pb_host*/
message Host {
uint64 host_id = 1;
@@ -352,6 +356,7 @@ message Host {
/**
* @brief Message sent in BBDO 3.0.0 instead of neb::service_status
*/
+/*io::neb, neb::de_pb_host_status*/
message HostStatus {
uint64 host_id = 1;
@@ -408,6 +413,7 @@ message HostStatus {
*
* Only used with BBDO 3.0
*/
+/*io::neb, neb::de_pb_adaptive_host*/
message AdaptiveHost {
uint64 host_id = 1;
@@ -428,6 +434,7 @@ message AdaptiveHost {
optional string notification_period = 16;
}
+/*io::neb, neb::de_pb_comment*/
message Comment {
BBDOHeader header = 1;
@@ -470,6 +477,7 @@ message Comment {
* @brief A downtime is applied on a resource when we don't want notifications
* concerning bad states on this resource.
*/
+/*io::neb, neb::de_pb_downtime*/
message Downtime {
enum DowntimeType {
NOT_USED = 0;
@@ -497,6 +505,7 @@ message Downtime {
bool fixed = 18;
}
+/*io::neb, neb::de_pb_custom_variable*/
message CustomVariable {
enum VarType {
HOST = 0;
@@ -521,7 +530,8 @@ enum CheckType {
CheckPassive = 1;
}
-message Check {
+/*io::neb, neb::de_pb_host_check*/
+message HostCheck {
BBDOHeader header = 1;
bool active_checks_enabled = 2;
@@ -529,9 +539,21 @@ message Check {
string command_line = 4;
uint64 host_id = 5;
uint64 next_check = 6;
- uint64 service_id = 7;
}
+/*io::neb, neb::de_pb_service_check*/
+message ServiceCheck {
+ BBDOHeader header = 1;
+
+ bool active_checks_enabled = 2;
+ CheckType check_type = 3;
+ string command_line = 4;
+ uint64 host_id = 5;
+ uint64 next_check = 6;
+ uint64 service_id = 7;
+}
+
+/*io::neb, neb::de_pb_log_entry*/
message LogEntry {
enum LogType {
SOFT = 0;
@@ -569,6 +591,7 @@ message LogEntry {
int32 retry = 13;
}
+/*io::neb, neb::de_pb_instance_status*/
message InstanceStatus {
BBDOHeader header = 1;
@@ -590,6 +613,7 @@ message InstanceStatus {
uint64 instance_id = 17;
}
+/*io::neb, neb::de_pb_instance*/
message Instance {
BBDOHeader header = 1;
@@ -603,6 +627,7 @@ message Instance {
string version = 9;
}
+/*io::neb, neb::de_pb_responsive_instance*/
message ResponsiveInstance {
BBDOHeader header = 1;
@@ -610,6 +635,7 @@ message ResponsiveInstance {
bool responsive = 3;
}
+/*io::neb, neb::de_pb_acknowledgement*/
message Acknowledgement {
uint64 host_id = 1;
uint64 service_id = 2;
@@ -628,3 +654,78 @@ message Acknowledgement {
bool persistent_comment = 11;
uint32 state = 12;
}
+
+/*io::neb, neb::de_pb_host_dependency*/
+message HostDependency {
+ BBDOHeader header = 1;
+
+ string dependency_period= 2;
+ uint64 dependent_host_id = 3;
+ bool enabled = 4;
+ string execution_failure_options = 5;
+ uint64 host_id = 6;
+ bool inherits_parent = 7;
+ string notification_failure_options = 8;
+}
+
+
+/*io::neb, neb::de_pb_service_dependency*/
+message ServiceDependency {
+ BBDOHeader header = 1;
+
+ string dependency_period= 2;
+ uint64 dependent_host_id = 3;
+ bool enabled = 4;
+ string execution_failure_options = 5;
+ uint64 host_id = 6;
+ bool inherits_parent = 7;
+ string notification_failure_options = 8;
+ uint64 dependent_service_id = 9;
+ uint64 service_id = 10;
+}
+
+/*io::neb, neb::de_pb_host_group*/
+message HostGroup {
+ BBDOHeader header = 1;
+
+ bool enabled = 2;
+ uint64 hostgroup_id = 3;
+ string name = 4;
+ uint64 poller_id = 5;
+}
+
+
+/*io::neb, neb::de_pb_service_group*/
+message ServiceGroup {
+ BBDOHeader header = 1;
+
+ bool enabled = 2;
+ uint64 servicegroup_id = 3;
+ string name = 4;
+ uint64 poller_id = 5;
+}
+
+
+/*io::neb, neb::de_pb_host_group_member*/
+message HostGroupMember {
+ BBDOHeader header = 1;
+
+ bool enabled = 2;
+ uint64 hostgroup_id = 3;
+ string name = 4;
+ uint64 host_id = 5;
+ uint64 poller_id = 6;
+}
+
+/*io::neb, neb::de_pb_service_group_member*/
+message ServiceGroupMember {
+ BBDOHeader header = 1;
+
+ bool enabled = 2;
+ uint64 servicegroup_id = 3;
+ string name = 4;
+ uint64 host_id = 5;
+ uint64 poller_id = 6;
+ uint64 service_id = 7;
+}
+
diff --git a/bbdo/rebuild_message.proto b/bbdo/rebuild_message.proto
index 72d34775606..afc1e410747 100644
--- a/bbdo/rebuild_message.proto
+++ b/bbdo/rebuild_message.proto
@@ -15,6 +15,7 @@ message Timeserie {
uint32 rrd_retention = 4;
}
+/*io::storage, storage::de_rebuild_message*/
message RebuildMessage {
enum State {
START = 0;
diff --git a/bbdo/remove_graph_message.proto b/bbdo/remove_graph_message.proto
index e8de80544bd..8c35c876890 100644
--- a/bbdo/remove_graph_message.proto
+++ b/bbdo/remove_graph_message.proto
@@ -2,6 +2,7 @@ syntax = "proto3";
package com.centreon.broker;
+/*io::storage, storage::de_remove_graph_message*/
message RemoveGraphMessage {
repeated uint64 index_ids = 1;
repeated uint64 metric_ids = 2;
diff --git a/bbdo/severity.proto b/bbdo/severity.proto
index 3ce06ca99bb..44781d3af1c 100644
--- a/bbdo/severity.proto
+++ b/bbdo/severity.proto
@@ -35,6 +35,7 @@ package com.centreon.broker;
* relations between resources of our poller and this severity. And only if the
* severity is no more used at all, we can remove it.
*/
+/*io::neb, neb::de_pb_severity*/
message Severity {
uint64 id = 1;
enum Action {
diff --git a/bbdo/storage.proto b/bbdo/storage.proto
index 294070f7bf5..9c097a3a089 100644
--- a/bbdo/storage.proto
+++ b/bbdo/storage.proto
@@ -20,6 +20,7 @@ syntax = "proto3";
package com.centreon.broker;
+/*io::storage, storage::de_pb_metric*/
message Metric {
enum ValueType {
GAUGE = 0;
@@ -39,6 +40,7 @@ message Metric {
uint64 service_id = 12;
}
+/*io::storage, storage::de_pb_status*/
message Status {
uint64 index_id = 1;
uint32 interval = 2;
@@ -49,12 +51,14 @@ message Status {
uint64 service_id = 7;
}
+/*io::storage, storage::de_pb_index_mapping*/
message IndexMapping {
uint64 index_id = 1;
uint64 host_id = 2;
uint64 service_id = 3;
}
+/*io::storage, storage::de_pb_metric_mapping*/
message MetricMapping {
uint64 index_id = 1;
uint64 metric_id = 2;
diff --git a/bbdo/storage/index_mapping.cc b/bbdo/storage/index_mapping.cc
index 78c91c156be..b9ab76f9fc0 100644
--- a/bbdo/storage/index_mapping.cc
+++ b/bbdo/storage/index_mapping.cc
@@ -1,20 +1,20 @@
-/*
-** Copyright 2009-2020 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2009-2023 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 : contact@centreon.com
+ */
#include "bbdo/storage/index_mapping.hh"
@@ -36,8 +36,7 @@ index_mapping::index_mapping()
* @param host_id
* @param service_id
*/
-index_mapping::index_mapping(uint64_t index_id,
- uint32_t host_id,
+index_mapping::index_mapping(uint64_t index_id, uint32_t host_id,
uint32_t service_id)
: io::data(index_mapping::static_type()),
index_id{index_id},
@@ -46,20 +45,15 @@ index_mapping::index_mapping(uint64_t index_id,
// Mapping.
mapping::entry const index_mapping::entries[] = {
- mapping::entry(&index_mapping::index_id,
- "index_id",
+ mapping::entry(&index_mapping::index_id, "index_id",
mapping::entry::invalid_on_zero),
- mapping::entry(&index_mapping::host_id,
- "host_id",
+ mapping::entry(&index_mapping::host_id, "host_id",
mapping::entry::invalid_on_zero),
- mapping::entry(&index_mapping::service_id,
- "service_id",
+ mapping::entry(&index_mapping::service_id, "service_id",
mapping::entry::invalid_on_zero),
mapping::entry()};
// Operations.
-static io::data* new_index_mapping() {
- return new index_mapping;
-}
+static io::data* new_index_mapping() { return new index_mapping; }
io::event_info::event_operations const index_mapping::operations = {
&new_index_mapping, nullptr, nullptr};
diff --git a/bbdo/storage/index_mapping.hh b/bbdo/storage/index_mapping.hh
index 9c5ce73fa40..553334b4fdb 100644
--- a/bbdo/storage/index_mapping.hh
+++ b/bbdo/storage/index_mapping.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2015 - 2020 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2015 - 2020 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 : contact@centreon.com
+ */
#ifndef CCB_STORAGE_INDEX_MAPPING_HH
#define CCB_STORAGE_INDEX_MAPPING_HH
@@ -23,12 +23,10 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
+namespace com::centreon::broker::storage {
-namespace storage {
/**
* @class index_mapping index_mapping.hh
* "com/centreon/broker/storage/index_mapping.hh"
@@ -55,8 +53,6 @@ class index_mapping : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace storage
-
-CCB_END()
+} // namespace com::centreon::broker::storage
#endif // !CCB_STORAGE_INDEX_MAPPING_HH
diff --git a/bbdo/storage/metric.cc b/bbdo/storage/metric.cc
index 023d4bde2e2..84d9cd89d07 100644
--- a/bbdo/storage/metric.cc
+++ b/bbdo/storage/metric.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2009-2013, 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 : contact@centreon.com
+/**
+* Copyright 2009-2013, 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 : contact@centreon.com
*/
#include "bbdo/storage/metric.hh"
diff --git a/bbdo/storage/metric.hh b/bbdo/storage/metric.hh
index b5d6a4367aa..6a7d4ea9d07 100644
--- a/bbdo/storage/metric.hh
+++ b/bbdo/storage/metric.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2011-2013 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2011-2013 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 : contact@centreon.com
+ */
#ifndef CCB_STORAGE_METRIC_HH
#define CCB_STORAGE_METRIC_HH
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace storage {
+namespace com::centreon::broker::storage {
/**
* @class metric metric.hh "com/centreon/broker/storage/metric.hh"
* @brief Metric information.
@@ -39,16 +36,9 @@ namespace storage {
class metric : public io::data {
public:
metric();
- metric(uint32_t host_id,
- uint32_t service_id,
- const std::string& name,
- timestamp time,
- uint32_t interval,
- bool is_for_rebuild,
- uint32_t metric_id,
- int32_t rrd_len,
- double value,
- int16_t value_type);
+ metric(uint32_t host_id, uint32_t service_id, const std::string& name,
+ timestamp time, uint32_t interval, bool is_for_rebuild,
+ uint32_t metric_id, int32_t rrd_len, double value, int16_t value_type);
metric(const metric&) = delete;
~metric() noexcept = default;
metric& operator=(const metric&) = delete;
@@ -78,8 +68,6 @@ class metric : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace storage
-
-CCB_END()
+} // namespace com::centreon::broker::storage
#endif // !CCB_STORAGE_METRIC_HH
diff --git a/bbdo/storage/metric_mapping.cc b/bbdo/storage/metric_mapping.cc
index 92f9c43f060..d5335d0713d 100644
--- a/bbdo/storage/metric_mapping.cc
+++ b/bbdo/storage/metric_mapping.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 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 : contact@centreon.com
+/**
+* Copyright 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 : contact@centreon.com
*/
#include "bbdo/storage/metric_mapping.hh"
diff --git a/bbdo/storage/metric_mapping.hh b/bbdo/storage/metric_mapping.hh
index 125e5366b60..690ac03c358 100644
--- a/bbdo/storage/metric_mapping.hh
+++ b/bbdo/storage/metric_mapping.hh
@@ -23,12 +23,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace storage {
+namespace com::centreon::broker::storage {
/**
* @class metric_mapping metric_mapping.hh
* "com/centreon/broker/storage/metric_mapping.hh"
@@ -58,8 +55,6 @@ class metric_mapping : public io::data {
private:
void _internal_copy(metric_mapping const& s);
};
-} // namespace storage
-
-CCB_END()
+} // namespace com::centreon::broker::storage
#endif // !CCB_STORAGE_METRIC_MAPPING_HH
diff --git a/bbdo/storage/remove_graph.cc b/bbdo/storage/remove_graph.cc
index ebbdc78757a..a5eba898212 100644
--- a/bbdo/storage/remove_graph.cc
+++ b/bbdo/storage/remove_graph.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2012-2013 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 : contact@centreon.com
+/**
+* Copyright 2012-2013 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 : contact@centreon.com
*/
#include "bbdo/storage/remove_graph.hh"
diff --git a/bbdo/storage/remove_graph.hh b/bbdo/storage/remove_graph.hh
index cce4bf796d4..9323013f8e4 100644
--- a/bbdo/storage/remove_graph.hh
+++ b/bbdo/storage/remove_graph.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2012-2013 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2012-2023 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 : contact@centreon.com
+ */
#ifndef CCB_STORAGE_REMOVE_GRAPH_HH
#define CCB_STORAGE_REMOVE_GRAPH_HH
@@ -23,11 +23,8 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
-
-namespace storage {
+namespace com::centreon::broker::storage {
/**
* @class remove_graph remove_graph.hh
* "com/centreon/broker/storage/remove_graph.hh"
@@ -52,8 +49,6 @@ class remove_graph : public io::data {
static mapping::entry const entries[];
static io::event_info::event_operations const operations;
};
-} // namespace storage
-
-CCB_END()
+} // namespace com::centreon::broker::storage
#endif // !CCB_STORAGE_REMOVE_GRAPH_HH
diff --git a/bbdo/storage/status.cc b/bbdo/storage/status.cc
index 189f92ea9e4..4df212c9785 100644
--- a/bbdo/storage/status.cc
+++ b/bbdo/storage/status.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2011-2013 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 : contact@centreon.com
+/**
+* Copyright 2011-2013 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 : contact@centreon.com
*/
#include "bbdo/storage/status.hh"
diff --git a/bbdo/storage/status.hh b/bbdo/storage/status.hh
index 22665e17714..70883acba91 100644
--- a/bbdo/storage/status.hh
+++ b/bbdo/storage/status.hh
@@ -24,12 +24,9 @@
#include "com/centreon/broker/io/event_info.hh"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/mapping/entry.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
-
-namespace storage {
+namespace com::centreon::broker::storage {
/**
* @class status status.hh "com/centreon/broker/storage/status.hh"
* @brief Status data used to generate status graphs.
@@ -51,12 +48,8 @@ class status : public io::data {
static io::event_info::event_operations const operations;
status();
- status(timestamp const& time,
- uint64_t index_id,
- uint32_t interval,
- bool is_for_rebuild,
- timestamp const& rrd_len,
- int16_t state);
+ status(timestamp const& time, uint64_t index_id, uint32_t interval,
+ bool is_for_rebuild, timestamp const& rrd_len, int16_t state);
status(status const& s);
~status();
@@ -67,8 +60,6 @@ class status : public io::data {
return io::events::data_type::value;
}
};
-} // namespace storage
-
-CCB_END()
+} // namespace com::centreon::broker::storage
#endif // !CCB_STORAGE_STATUS_HH
diff --git a/bbdo/tag.proto b/bbdo/tag.proto
index 2622b78db42..d12898d8470 100644
--- a/bbdo/tag.proto
+++ b/bbdo/tag.proto
@@ -41,6 +41,7 @@ enum TagType {
HOSTCATEGORY = 3;
}
+/*io::neb, neb::de_pb_tag*/
message Tag {
uint64 id = 1;
enum Action {
diff --git a/broker/bam/CMakeLists.txt b/broker/bam/CMakeLists.txt
index 7fc67f822a0..8e121e90823 100644
--- a/broker/bam/CMakeLists.txt
+++ b/broker/bam/CMakeLists.txt
@@ -22,7 +22,10 @@ set(SRC_DIR "${PROJECT_SOURCE_DIR}/bam/src")
set(TEST_DIR "${PROJECT_SOURCE_DIR}/bam/test")
include_directories(
${INC_DIR} ${PROJECT_SOURCE_DIR}/core/inc ${PROJECT_SOURCE_DIR}/core/sql/inc
- ${PROJECT_SOURCE_DIR}/neb/inc)
+ ${PROJECT_SOURCE_DIR}/neb/inc
+ ${PROJECT_SOURCE_DIR}/core/src
+)
+
set(INC_DIR "${INC_DIR}/com/centreon/broker/bam")
# BAM module.
diff --git a/broker/bam/inc/com/centreon/broker/bam/availability_builder.hh b/broker/bam/inc/com/centreon/broker/bam/availability_builder.hh
index 694163be334..6105d32547d 100644
--- a/broker/bam/inc/com/centreon/broker/bam/availability_builder.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/availability_builder.hh
@@ -19,11 +19,10 @@
#ifndef CCB_BAM_AVAILABILITY_BUILDER_HH
#define CCB_BAM_AVAILABILITY_BUILDER_HH
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/time/timeperiod.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -89,6 +88,6 @@ class availability_builder {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_AVAILABILITY_BUILDER_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/availability_thread.hh b/broker/bam/inc/com/centreon/broker/bam/availability_thread.hh
index 8e061d3dcad..71a31f7371a 100644
--- a/broker/bam/inc/com/centreon/broker/bam/availability_thread.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/availability_thread.hh
@@ -22,13 +22,12 @@
#include "com/centreon/broker/bam/availability_builder.hh"
#include "com/centreon/broker/bam/timeperiod_map.hh"
#include "com/centreon/broker/io/data.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/sql/database_config.hh"
#include "com/centreon/broker/sql/mysql.hh"
#include "com/centreon/broker/time/timeperiod.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
class database_query;
@@ -91,6 +90,6 @@ class availability_thread final {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_AVAILABILITY_THREAD_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/ba.hh b/broker/bam/inc/com/centreon/broker/bam/ba.hh
index 00e83bc057f..1ea060933a9 100644
--- a/broker/bam/inc/com/centreon/broker/bam/ba.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/ba.hh
@@ -28,10 +28,9 @@
#include "com/centreon/broker/bam/internal.hh"
#include "com/centreon/broker/bam/service_listener.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/persistent_cache.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -103,9 +102,12 @@ class ba : public computable, public service_listener {
int _recompute_count{0};
static double _normalize(double d);
- virtual bool _apply_impact(kpi* kpi_ptr, impact_info& impact) = 0;
+ virtual void _apply_impact(kpi* kpi_ptr, impact_info& impact) = 0;
virtual void _unapply_impact(kpi* kpi_ptr, impact_info& impact) = 0;
- virtual void _recompute();
+ virtual bool _apply_changes(kpi* child,
+ const impact_values& new_hard_impact,
+ const impact_values& new_soft_impact,
+ bool in_downtime) = 0;
std::shared_ptr _generate_ba_status(bool state_changed) const;
std::shared_ptr _generate_virtual_service_status() const;
@@ -127,7 +129,7 @@ class ba : public computable, public service_listener {
uint32_t get_id() const;
uint32_t get_host_id() const;
uint32_t get_service_id() const;
- bool get_in_downtime() const;
+ bool in_downtime() const;
timestamp get_last_kpi_update() const;
std::string const& get_name() const;
virtual std::string get_output() const = 0;
@@ -158,6 +160,6 @@ class ba : public computable, public service_listener {
};
} // namespace bam
-CCB_END()
+} // namespace com::centreon::broker
#endif // !CCB_BAM_BA_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/ba_best.hh b/broker/bam/inc/com/centreon/broker/bam/ba_best.hh
index db4e93c4069..d9fe2efb0fd 100644
--- a/broker/bam/inc/com/centreon/broker/bam/ba_best.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/ba_best.hh
@@ -1,27 +1,27 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-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 : contact@centreon.com
+ */
#ifndef CCB_BAM_BA_BEST_HH
#define CCB_BAM_BA_BEST_HH
#include "com/centreon/broker/bam/ba.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -44,9 +44,12 @@ class ba_best : public ba {
void _commit_initial_events(io::stream* visitor);
protected:
- bool _apply_impact(kpi* kpi_ptr, impact_info& impact) override;
+ void _apply_impact(kpi* kpi_ptr, impact_info& impact) override;
void _unapply_impact(kpi* kpi_ptr, impact_info& impact) override;
- void _recompute() override;
+ bool _apply_changes(kpi* child,
+ const impact_values& new_hard_impact,
+ const impact_values& new_soft_impact,
+ bool in_downtime) override;
public:
ba_best(uint32_t id,
@@ -60,6 +63,6 @@ class ba_best : public ba {
};
} // namespace bam
-CCB_END()
+} // namespace com::centreon::broker
#endif // !CCB_BAM_BA_BEST_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/ba_impact.hh b/broker/bam/inc/com/centreon/broker/bam/ba_impact.hh
index bf997d984b4..0a9e3ccd295 100644
--- a/broker/bam/inc/com/centreon/broker/bam/ba_impact.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/ba_impact.hh
@@ -1,27 +1,27 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-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 : contact@centreon.com
+ */
#ifndef CCB_BAM_BA_IMPACT_HH
#define CCB_BAM_BA_IMPACT_HH
#include "com/centreon/broker/bam/ba.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -35,9 +35,15 @@ class kpi;
* of value.
*/
class ba_impact : public ba {
+ void _recompute();
+
protected:
- bool _apply_impact(kpi* kpi_ptr, impact_info& impact) override;
+ void _apply_impact(kpi* kpi_ptr, impact_info& impact) override;
void _unapply_impact(kpi* kpi_ptr, impact_info& impact) override;
+ bool _apply_changes(kpi* child,
+ const impact_values& new_hard_impact,
+ const impact_values& new_soft_impact,
+ bool in_downtime) override;
public:
ba_impact(uint32_t id,
@@ -53,6 +59,6 @@ class ba_impact : public ba {
};
} // namespace bam
-CCB_END()
+} // namespace com::centreon::broker
#endif // !CCB_BAM_BA_IMPACT_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/ba_ratio_number.hh b/broker/bam/inc/com/centreon/broker/bam/ba_ratio_number.hh
index d4a70bf5d60..fd66c9d5d81 100644
--- a/broker/bam/inc/com/centreon/broker/bam/ba_ratio_number.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/ba_ratio_number.hh
@@ -1,27 +1,27 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-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 : contact@centreon.com
+ */
#ifndef CCB_BAM_BA_RATIO_NUMBER_HH
#define CCB_BAM_BA_RATIO_NUMBER_HH
#include "com/centreon/broker/bam/ba.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -35,9 +35,12 @@ class kpi;
* of value.
*/
class ba_ratio_number : public ba {
- bool _apply_impact(kpi* kpi_ptr, impact_info& impact) override;
+ void _apply_impact(kpi* kpi_ptr, impact_info& impact) override;
void _unapply_impact(kpi* kpi_ptr, impact_info& impact) override;
- void _recompute() override;
+ bool _apply_changes(kpi* child,
+ const impact_values& new_hard_impact,
+ const impact_values& new_soft_impact,
+ bool in_downtime) override;
public:
ba_ratio_number(uint32_t id,
@@ -51,6 +54,6 @@ class ba_ratio_number : public ba {
};
} // namespace bam
-CCB_END()
+} // namespace com::centreon::broker
#endif // !CCB_BAM_BA_RATIO_NUMBER_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/ba_ratio_percent.hh b/broker/bam/inc/com/centreon/broker/bam/ba_ratio_percent.hh
index b33dc849005..75ad69245df 100644
--- a/broker/bam/inc/com/centreon/broker/bam/ba_ratio_percent.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/ba_ratio_percent.hh
@@ -1,27 +1,27 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-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 : contact@centreon.com
+ */
#ifndef CCB_BAM_BA_RATIO_PERCENT_HH
#define CCB_BAM_BA_RATIO_PERCENT_HH
#include "com/centreon/broker/bam/ba.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -35,9 +35,12 @@ class kpi;
* of value.
*/
class ba_ratio_percent : public ba {
- bool _apply_impact(kpi* kpi_ptr, ba::impact_info& impact) override;
+ void _apply_impact(kpi* kpi_ptr, ba::impact_info& impact) override;
void _unapply_impact(kpi* kpi_ptr, ba::impact_info& impact) override;
- void _recompute() override;
+ bool _apply_changes(kpi* child,
+ const impact_values& new_hard_impact,
+ const impact_values& new_soft_impact,
+ bool in_downtime) override;
public:
ba_ratio_percent(uint32_t id,
@@ -51,6 +54,6 @@ class ba_ratio_percent : public ba {
};
} // namespace bam
-CCB_END()
+} // namespace com::centreon::broker
#endif // !CCB_BAM_BA_RATIO_PERCENT_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/ba_svc_mapping.hh b/broker/bam/inc/com/centreon/broker/bam/ba_svc_mapping.hh
index 193f48bbc83..b252a460b0b 100644
--- a/broker/bam/inc/com/centreon/broker/bam/ba_svc_mapping.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/ba_svc_mapping.hh
@@ -19,9 +19,8 @@
#ifndef CCB_BAM_BA_SVC_MAPPING_HH
#define CCB_BAM_BA_SVC_MAPPING_HH
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -45,6 +44,6 @@ class ba_svc_mapping {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BA_SVC_MAPPING_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/ba_worst.hh b/broker/bam/inc/com/centreon/broker/bam/ba_worst.hh
index 095505e1534..9cd5cf05744 100644
--- a/broker/bam/inc/com/centreon/broker/bam/ba_worst.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/ba_worst.hh
@@ -1,27 +1,27 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-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 : contact@centreon.com
+ */
#ifndef CCB_BAM_BA_WORST_HH
#define CCB_BAM_BA_WORST_HH
#include "com/centreon/broker/bam/ba.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -44,9 +44,12 @@ class ba_worst : public ba {
void _commit_initial_events(io::stream* visitor);
protected:
- bool _apply_impact(kpi* kpi_ptr, impact_info& impact) override;
+ void _apply_impact(kpi* kpi_ptr, impact_info& impact) override;
void _unapply_impact(kpi* kpi_ptr, impact_info& impact) override;
- void _recompute() override;
+ bool _apply_changes(kpi* child,
+ const impact_values& new_hard_impact,
+ const impact_values& new_soft_impact,
+ bool in_downtime) override;
public:
ba_worst(uint32_t id,
@@ -60,6 +63,6 @@ class ba_worst : public ba {
};
} // namespace bam
-CCB_END()
+} // namespace com::centreon::broker
#endif // !CCB_BAM_BA_WORST_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_and.hh b/broker/bam/inc/com/centreon/broker/bam/bool_and.hh
index d23c99bdb18..9835bd26d57 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_and.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_and.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_BOOL_AND_HH
#include "com/centreon/broker/bam/bool_binary_operator.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -49,6 +48,6 @@ class bool_and : public bool_binary_operator {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_AND_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_binary_operator.hh b/broker/bam/inc/com/centreon/broker/bam/bool_binary_operator.hh
index 7676564a101..b4ae59d3f54 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_binary_operator.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_binary_operator.hh
@@ -21,11 +21,10 @@
#include "com/centreon/broker/bam/bool_value.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#define COMPARE_EPSILON 0.0001
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -62,6 +61,6 @@ class bool_binary_operator : public bool_value {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_BINARY_OPERATOR_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_call.hh b/broker/bam/inc/com/centreon/broker/bam/bool_call.hh
index f7841026201..a1ba84a2563 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_call.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_call.hh
@@ -21,9 +21,8 @@
#include "com/centreon/broker/bam/bool_expression.hh"
#include "com/centreon/broker/bam/bool_value.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -53,6 +52,6 @@ class bool_call : public bool_value {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_CALL_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_constant.hh b/broker/bam/inc/com/centreon/broker/bam/bool_constant.hh
index f44c183b6bb..752712c78a8 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_constant.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_constant.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_BOOL_CONSTANT_HH
#include "com/centreon/broker/bam/bool_value.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -51,6 +50,6 @@ class bool_constant : public bool_value {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_CONSTANT_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_equal.hh b/broker/bam/inc/com/centreon/broker/bam/bool_equal.hh
index 61b8f7f9642..38539bf83ff 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_equal.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_equal.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_BOOL_EQUAL_HH
#include "com/centreon/broker/bam/bool_binary_operator.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -44,6 +43,6 @@ class bool_equal : public bool_binary_operator {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_EQUAL_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_expression.hh b/broker/bam/inc/com/centreon/broker/bam/bool_expression.hh
index 0cba39906a9..26de689e934 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_expression.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_expression.hh
@@ -22,10 +22,9 @@
#include "bbdo/bam/state.hh"
#include "com/centreon/broker/bam/computable.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#include "impact_values.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -61,6 +60,6 @@ class bool_expression : public computable {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_EXPRESSION_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_less_than.hh b/broker/bam/inc/com/centreon/broker/bam/bool_less_than.hh
index abd15b37968..b0bdafbc686 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_less_than.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_less_than.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_BOOL_LESS_THAN_HH
#include "com/centreon/broker/bam/bool_binary_operator.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -47,6 +46,6 @@ class bool_less_than : public bool_binary_operator {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_LESS_THAN_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_more_than.hh b/broker/bam/inc/com/centreon/broker/bam/bool_more_than.hh
index 8dfe51243cb..cac67e53351 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_more_than.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_more_than.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_BOOL_MORE_THAN_HH
#include "com/centreon/broker/bam/bool_binary_operator.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -46,6 +45,6 @@ class bool_more_than : public bool_binary_operator {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_MORE_THAN_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_not.hh b/broker/bam/inc/com/centreon/broker/bam/bool_not.hh
index a4a16f46c8b..8e4adefed8d 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_not.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_not.hh
@@ -21,9 +21,8 @@
#include "com/centreon/broker/bam/bool_value.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -56,6 +55,6 @@ class bool_not : public bool_value {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_NOT_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_not_equal.hh b/broker/bam/inc/com/centreon/broker/bam/bool_not_equal.hh
index 170125c2507..181edcc4206 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_not_equal.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_not_equal.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_BOOL_NOT_EQUAL_HH
#include "com/centreon/broker/bam/bool_binary_operator.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -45,6 +44,6 @@ class bool_not_equal : public bool_binary_operator {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_NOT_EQUAL_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_operation.hh b/broker/bam/inc/com/centreon/broker/bam/bool_operation.hh
index 9f99253660a..734688901c6 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_operation.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_operation.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_BOOL_OPERATION_HH
#include "com/centreon/broker/bam/bool_binary_operator.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -55,6 +54,6 @@ class bool_operation : public bool_binary_operator {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_OR_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_or.hh b/broker/bam/inc/com/centreon/broker/bam/bool_or.hh
index 9462ca65c80..06e99fe70d4 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_or.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_or.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_BOOL_OR_HH
#include "com/centreon/broker/bam/bool_binary_operator.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -49,6 +48,6 @@ class bool_or : public bool_binary_operator {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_OR_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_service.hh b/broker/bam/inc/com/centreon/broker/bam/bool_service.hh
index f876837a277..b41bc708e3b 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_service.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_service.hh
@@ -22,10 +22,9 @@
#include "com/centreon/broker/bam/bool_value.hh"
#include "com/centreon/broker/bam/service_listener.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/neb/internal.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -68,6 +67,6 @@ class bool_service : public bool_value, public service_listener {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_SERVICE_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_value.hh b/broker/bam/inc/com/centreon/broker/bam/bool_value.hh
index cd7c7b661fe..c4d89f5d27c 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_value.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_value.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_BOOL_VALUE_HH
#include "com/centreon/broker/bam/computable.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -46,6 +45,6 @@ class bool_value : public computable {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_VALUE_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/bool_xor.hh b/broker/bam/inc/com/centreon/broker/bam/bool_xor.hh
index 4fbe48057b5..830e22fbd74 100644
--- a/broker/bam/inc/com/centreon/broker/bam/bool_xor.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/bool_xor.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_BOOL_XOR_HH
#include "com/centreon/broker/bam/bool_binary_operator.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -44,6 +43,6 @@ class bool_xor : public bool_binary_operator {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_BOOL_XOR_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/computable.hh b/broker/bam/inc/com/centreon/broker/bam/computable.hh
index 68eff9a4534..25319d12ae0 100644
--- a/broker/bam/inc/com/centreon/broker/bam/computable.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/computable.hh
@@ -1,5 +1,5 @@
-/*
- * Copyright 2014, 2023 Centreon
+/**
+ * Copyright 2014, 2023-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,10 +20,9 @@
#define CCB_BAM_COMPUTABLE_HH
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/persistent_cache.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -73,6 +72,6 @@ class computable {
};
} // namespace bam
-CCB_END()
+} // namespace com::centreon::broker
#endif // !CCB_BAM_COMPUTABLE_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/configuration/applier/ba.hh b/broker/bam/inc/com/centreon/broker/bam/configuration/applier/ba.hh
index 4b86a76dd10..e2c763f606e 100644
--- a/broker/bam/inc/com/centreon/broker/bam/configuration/applier/ba.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/configuration/applier/ba.hh
@@ -24,10 +24,9 @@
#include "com/centreon/broker/bam/configuration/state.hh"
#include "com/centreon/broker/bam/service_book.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/persistent_cache.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
// Forward declarations.
namespace neb {
@@ -80,6 +79,6 @@ class ba {
} // namespace configuration
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_CONFIGURATION_APPLIER_BA_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/configuration/applier/bool_expression.hh b/broker/bam/inc/com/centreon/broker/bam/configuration/applier/bool_expression.hh
index c52a50a28f3..d351229cc3c 100644
--- a/broker/bam/inc/com/centreon/broker/bam/configuration/applier/bool_expression.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/configuration/applier/bool_expression.hh
@@ -21,9 +21,8 @@
#include "com/centreon/broker/bam/configuration/bool_expression.hh"
#include "com/centreon/broker/bam/configuration/state.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declarations.
@@ -72,6 +71,6 @@ class bool_expression {
} // namespace configuration
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_CONFIGURATION_APPLIER_BOOL_EXPRESSION_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/configuration/applier/kpi.hh b/broker/bam/inc/com/centreon/broker/bam/configuration/applier/kpi.hh
index 0215c250db0..4328ec82308 100644
--- a/broker/bam/inc/com/centreon/broker/bam/configuration/applier/kpi.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/configuration/applier/kpi.hh
@@ -23,9 +23,8 @@
#include "com/centreon/broker/bam/configuration/state.hh"
#include "com/centreon/broker/bam/kpi.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -80,6 +79,6 @@ class kpi {
} // namespace configuration
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_CONFIGURATION_APPLIER_KPI_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/configuration/applier/state.hh b/broker/bam/inc/com/centreon/broker/bam/configuration/applier/state.hh
index 7b83a7641a0..a4f7951469e 100644
--- a/broker/bam/inc/com/centreon/broker/bam/configuration/applier/state.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/configuration/applier/state.hh
@@ -23,9 +23,8 @@
#include "com/centreon/broker/bam/configuration/applier/bool_expression.hh"
#include "com/centreon/broker/bam/configuration/applier/kpi.hh"
#include "com/centreon/broker/bam/service_book.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -78,6 +77,6 @@ class state {
} // namespace configuration
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_CONFIGURATION_APPLIER_STATE_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/configuration/ba.hh b/broker/bam/inc/com/centreon/broker/bam/configuration/ba.hh
index ff9ad7e5837..45b0cf701be 100644
--- a/broker/bam/inc/com/centreon/broker/bam/configuration/ba.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/configuration/ba.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_CONFIGURATION_BA_HH
#include "com/centreon/broker/bam/internal.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
namespace configuration {
@@ -94,6 +93,6 @@ class ba {
} // namespace configuration
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_CONFIGURATION_BA_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/configuration/bool_expression.hh b/broker/bam/inc/com/centreon/broker/bam/configuration/bool_expression.hh
index 7960802e8a6..7f7a88ecaa2 100644
--- a/broker/bam/inc/com/centreon/broker/bam/configuration/bool_expression.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/configuration/bool_expression.hh
@@ -19,9 +19,8 @@
#ifndef BAM_CCB_CONFIGURATION_BOOL_EXPRESSION_HH
#define BAM_CCB_CONFIGURATION_BOOL_EXPRESSION_HH
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
namespace configuration {
@@ -64,6 +63,6 @@ class bool_expression {
} // namespace configuration
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_CONFIGURATION_BOOL_EXPRESSION_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/configuration/kpi.hh b/broker/bam/inc/com/centreon/broker/bam/configuration/kpi.hh
index 2de9e92abe6..4bb02974a42 100644
--- a/broker/bam/inc/com/centreon/broker/bam/configuration/kpi.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/configuration/kpi.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_CONFIGURATION_KPI_HH
#include "com/centreon/broker/bam/internal.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
namespace configuration {
@@ -52,6 +51,7 @@ class kpi {
double _impact_critical;
double _impact_unknown;
KpiEvent _event;
+ std::string _name;
public:
kpi(uint32_t id = 0,
@@ -69,10 +69,9 @@ class kpi {
bool ignoreacknowledgement = false,
double warning = 0,
double critical = 0,
- double unknown = 0);
- kpi(kpi const& other);
- ~kpi();
- kpi& operator=(kpi const& other);
+ double unknown = 0,
+ const std::string& name = "");
+
bool operator==(kpi const& other) const;
bool operator!=(kpi const& other) const;
@@ -97,6 +96,7 @@ class kpi {
double get_impact_critical() const;
double get_impact_unknown() const;
const KpiEvent& get_opened_event() const;
+ const std::string get_name() const { return _name; }
void set_id(uint32_t id);
void set_state_type(short state_type);
@@ -119,6 +119,6 @@ class kpi {
} // namespace configuration
} // namespace bam
-CCB_END()
+}
#endif // CCB_BAM_CONFIGURATION_KPI_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/configuration/reader_exception.hh b/broker/bam/inc/com/centreon/broker/bam/configuration/reader_exception.hh
index eb6082db8eb..c77b560113b 100644
--- a/broker/bam/inc/com/centreon/broker/bam/configuration/reader_exception.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/configuration/reader_exception.hh
@@ -21,7 +21,7 @@
#include "com/centreon/exceptions/msg_fmt.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
namespace configuration {
@@ -45,6 +45,6 @@ class reader_exception : public com::centreon::exceptions::msg_fmt {
} // namespace configuration
} // namespace bam
-CCB_END()
+}
#endif // !CCB_CONFIGURATION_READER_EXCEPTION_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/configuration/reader_v2.hh b/broker/bam/inc/com/centreon/broker/bam/configuration/reader_v2.hh
index 7e319a4c9a4..438ea7fd56f 100644
--- a/broker/bam/inc/com/centreon/broker/bam/configuration/reader_v2.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/configuration/reader_v2.hh
@@ -20,10 +20,9 @@
#define CCB_BAM_CONFIGURATION_READER_V2_HH
#include "com/centreon/broker/bam/configuration/state.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/sql/database_config.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
// Forward declaration.
class mysql;
@@ -61,6 +60,6 @@ class reader_v2 {
} // namespace configuration
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_CONFIGURATION_READER_V2_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/configuration/state.hh b/broker/bam/inc/com/centreon/broker/bam/configuration/state.hh
index 780310f7100..f752da38b35 100644
--- a/broker/bam/inc/com/centreon/broker/bam/configuration/state.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/configuration/state.hh
@@ -24,9 +24,8 @@
#include "com/centreon/broker/bam/configuration/bool_expression.hh"
#include "com/centreon/broker/bam/configuration/kpi.hh"
#include "com/centreon/broker/bam/hst_svc_mapping.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
namespace configuration {
@@ -73,6 +72,6 @@ class state {
} // namespace configuration
} // namespace bam
-CCB_END()
+}
#endif // ! CCB_BAM_CONFIGURATION_STATE_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/connector.hh b/broker/bam/inc/com/centreon/broker/bam/connector.hh
index 9040fb546ac..09a0359e35d 100644
--- a/broker/bam/inc/com/centreon/broker/bam/connector.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/connector.hh
@@ -20,10 +20,9 @@
#define CCB_BAM_CONNECTOR_HH
#include "com/centreon/broker/io/endpoint.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/sql/database_config.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -67,6 +66,6 @@ class connector : public io::endpoint {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_CONNECTOR_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/event_cache_visitor.hh b/broker/bam/inc/com/centreon/broker/bam/event_cache_visitor.hh
index 4a893fff3cb..161a2061ab0 100644
--- a/broker/bam/inc/com/centreon/broker/bam/event_cache_visitor.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/event_cache_visitor.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_EVENT_CACHE_VISITOR_HH
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -50,6 +49,6 @@ class event_cache_visitor : public io::stream {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_EVENT_CACHE_VISITOR_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/exp_builder.hh b/broker/bam/inc/com/centreon/broker/bam/exp_builder.hh
index e7fabd2a3ac..8bdfa7ebbd9 100644
--- a/broker/bam/inc/com/centreon/broker/bam/exp_builder.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/exp_builder.hh
@@ -23,9 +23,8 @@
#include "com/centreon/broker/bam/bool_service.hh"
#include "com/centreon/broker/bam/exp_parser.hh"
#include "com/centreon/broker/bam/hst_svc_mapping.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -65,6 +64,6 @@ class exp_builder {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_EXP_BUILDER_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/exp_parser.hh b/broker/bam/inc/com/centreon/broker/bam/exp_parser.hh
index 9a75018ef49..b31f1a7f3d0 100644
--- a/broker/bam/inc/com/centreon/broker/bam/exp_parser.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/exp_parser.hh
@@ -19,9 +19,8 @@
#ifndef CCB_BAM_EXP_PARSER_HH
#define CCB_BAM_EXP_PARSER_HH
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -55,6 +54,6 @@ class exp_parser {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_EXP_PARSER_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/exp_tokenizer.hh b/broker/bam/inc/com/centreon/broker/bam/exp_tokenizer.hh
index fc1380e6462..9fa9b98b366 100644
--- a/broker/bam/inc/com/centreon/broker/bam/exp_tokenizer.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/exp_tokenizer.hh
@@ -19,9 +19,8 @@
#ifndef CCB_BAM_EXP_TOKENIZER_HH
#define CCB_BAM_EXP_TOKENIZER_HH
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -57,6 +56,6 @@ class exp_tokenizer {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_EXP_TOKENIZER_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/factory.hh b/broker/bam/inc/com/centreon/broker/bam/factory.hh
index 274c300f317..328dd1e86dd 100644
--- a/broker/bam/inc/com/centreon/broker/bam/factory.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/factory.hh
@@ -20,9 +20,8 @@
#define CCB_BAM_FACTORY_HH
#include "com/centreon/broker/io/factory.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -46,6 +45,6 @@ class factory : public io::factory {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_FACTORY_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/hst_svc_mapping.hh b/broker/bam/inc/com/centreon/broker/bam/hst_svc_mapping.hh
index ccaac18cbf1..e2b392e2dd6 100644
--- a/broker/bam/inc/com/centreon/broker/bam/hst_svc_mapping.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/hst_svc_mapping.hh
@@ -21,9 +21,8 @@
#include
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -59,6 +58,6 @@ class hst_svc_mapping {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_HST_SVC_MAPPING_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/impact_values.hh b/broker/bam/inc/com/centreon/broker/bam/impact_values.hh
index d96ca3459c2..34cc2c8daa6 100644
--- a/broker/bam/inc/com/centreon/broker/bam/impact_values.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/impact_values.hh
@@ -1,28 +1,27 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2014, 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_IMPACT_VALUES_HH
#define CCB_BAM_IMPACT_VALUES_HH
#include "bbdo/bam/state.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -61,6 +60,6 @@ class impact_values {
};
} // namespace bam
-CCB_END()
+} // namespace com::centreon::broker
#endif // !CCB_BAM_IMPACT_VALUES_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/internal.hh b/broker/bam/inc/com/centreon/broker/bam/internal.hh
index c78bdb46203..80a771c6dd9 100644
--- a/broker/bam/inc/com/centreon/broker/bam/internal.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/internal.hh
@@ -1,30 +1,30 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BAM_INTERNAL_HH
#define CCB_BAM_INTERNAL_HH
#include "bbdo/bam.pb.h"
+#include "broker.pb.h"
#include "com/centreon/broker/io/events.hh"
#include "com/centreon/broker/io/protobuf.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
using pb_inherited_downtime =
@@ -78,6 +78,15 @@ using pb_dimension_truncate_table_signal =
} // namespace bam
-CCB_END()
+/* We have to declare the pb_ba_info also here because we don't control the
+ * order things are created. If the bam stream is created before brokerrpc, its
+ * muxer will be declared with known events (so without pb_ba_info) and if we
+ * want pb_ba_info to be known, thenwe have to force its declaration. */
+namespace extcmd {
+using pb_ba_info =
+ io::protobuf;
+} // namespace extcmd
+
+} // namespace com::centreon::broker
#endif
diff --git a/broker/bam/inc/com/centreon/broker/bam/kpi.hh b/broker/bam/inc/com/centreon/broker/bam/kpi.hh
index ac1f2f315ad..68ba1188c7a 100644
--- a/broker/bam/inc/com/centreon/broker/bam/kpi.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/kpi.hh
@@ -22,10 +22,9 @@
#include "com/centreon/broker/bam/computable.hh"
#include "com/centreon/broker/bam/internal.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declarations.
@@ -45,11 +44,12 @@ class kpi : public computable {
const uint32_t _ba_id;
absl::optional _event;
std::vector _initial_events;
+ std::string _name;
void _event_init();
public:
- kpi(uint32_t kpi_id, uint32_t ba_id);
+ kpi(uint32_t kpi_id, uint32_t ba_id, const std::string& name);
virtual ~kpi() noexcept = default;
kpi& operator=(const kpi&) = delete;
kpi(const kpi&) = delete;
@@ -62,11 +62,12 @@ class kpi : public computable {
virtual void visit(io::stream* visitor) = 0;
virtual bool in_downtime() const;
virtual bool ok_state() const = 0;
+ const std::string& get_name() const { return _name; };
void commit_initial_events(io::stream* visitor);
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_KPI_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/kpi_ba.hh b/broker/bam/inc/com/centreon/broker/bam/kpi_ba.hh
index a515fc45434..4139b726748 100644
--- a/broker/bam/inc/com/centreon/broker/bam/kpi_ba.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/kpi_ba.hh
@@ -24,9 +24,8 @@
#include "com/centreon/broker/bam/internal.hh"
#include "com/centreon/broker/bam/kpi.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -57,7 +56,7 @@ class kpi_ba : public kpi {
const timestamp& event_start_time);
public:
- kpi_ba(uint32_t kpi_id, uint32_t ba_id);
+ kpi_ba(uint32_t kpi_id, uint32_t ba_id, const std::string& ba_name);
~kpi_ba() noexcept = default;
kpi_ba(const kpi_ba&) = delete;
kpi_ba& operator=(const kpi_ba&) = delete;
@@ -79,6 +78,6 @@ class kpi_ba : public kpi {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_KPI_BA_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/kpi_boolexp.hh b/broker/bam/inc/com/centreon/broker/bam/kpi_boolexp.hh
index c9b424c7c36..9bda69d77eb 100644
--- a/broker/bam/inc/com/centreon/broker/bam/kpi_boolexp.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/kpi_boolexp.hh
@@ -22,10 +22,9 @@
#include "bbdo/bam/state.hh"
#include "com/centreon/broker/bam/kpi.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#include "impact_values.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
// Forward declaration.
@@ -49,7 +48,7 @@ class kpi_boolexp : public kpi {
void _open_new_event(io::stream* visitor, int impact, state state);
public:
- kpi_boolexp(uint32_t kpi_id, uint32_t ba_id);
+ kpi_boolexp(uint32_t kpi_id, uint32_t ba_id, const std::string& bool_name);
~kpi_boolexp() noexcept = default;
kpi_boolexp(const kpi_boolexp&) = delete;
kpi_boolexp& operator=(const kpi_boolexp&) = delete;
@@ -68,6 +67,6 @@ class kpi_boolexp : public kpi {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_KPI_BOOLEXP_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/kpi_service.hh b/broker/bam/inc/com/centreon/broker/bam/kpi_service.hh
index aac1446cd7c..7a93fc0f0de 100644
--- a/broker/bam/inc/com/centreon/broker/bam/kpi_service.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/kpi_service.hh
@@ -25,10 +25,9 @@
#include "com/centreon/broker/bam/kpi.hh"
#include "com/centreon/broker/bam/service_listener.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/timestamp.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -61,7 +60,8 @@ class kpi_service : public service_listener, public kpi {
kpi_service(uint32_t kpi_id,
uint32_t ba_id,
uint32_t host_id,
- uint32_t service_id);
+ uint32_t service_id,
+ const std::string& host_serv);
~kpi_service() noexcept = default;
kpi_service(const kpi_service&) = delete;
kpi_service& operator=(const kpi_service&) = delete;
@@ -104,10 +104,10 @@ class kpi_service : public service_listener, public kpi {
bool ok_state() const override;
void update_from(computable* child, io::stream* visitor) override;
std::string object_info() const override;
- void dump(std::ofstream& output) const;
+ void dump(std::ofstream& output) const override;
};
} // namespace bam
-CCB_END()
+} // namespace com::centreon::broker
#endif // !CCB_BAM_KPI_SERVICE_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/monitoring_stream.hh b/broker/bam/inc/com/centreon/broker/bam/monitoring_stream.hh
index 64f708f4450..e1aa396f9f8 100644
--- a/broker/bam/inc/com/centreon/broker/bam/monitoring_stream.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/monitoring_stream.hh
@@ -22,13 +22,12 @@
#include
#include "com/centreon/broker/bam/configuration/applier/state.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/sql/database_config.hh"
#include "com/centreon/broker/sql/mysql.hh"
#include "com/centreon/broker/sql/mysql_multi_insert.hh"
#include "com/centreon/broker/sql/mysql_stmt.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace extcmd {
using pb_ba_info =
@@ -123,6 +122,6 @@ class monitoring_stream : public io::stream {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_MONITORING_STREAM_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/reporting_stream.hh b/broker/bam/inc/com/centreon/broker/bam/reporting_stream.hh
index 2d652c364f0..95fb6d38f09 100644
--- a/broker/bam/inc/com/centreon/broker/bam/reporting_stream.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/reporting_stream.hh
@@ -24,11 +24,10 @@
#include "com/centreon/broker/bam/internal.hh"
#include "com/centreon/broker/bam/timeperiod_map.hh"
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/sql/mysql_multi_insert.hh"
#include "com/centreon/broker/time/timeperiod.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
// Forward declaration.
class database_config;
@@ -139,6 +138,6 @@ class reporting_stream : public io::stream {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_REPORTING_STREAM_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/service_book.hh b/broker/bam/inc/com/centreon/broker/bam/service_book.hh
index 1b8686ab249..d2a0a77f93e 100644
--- a/broker/bam/inc/com/centreon/broker/bam/service_book.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/service_book.hh
@@ -22,7 +22,7 @@
#include "com/centreon/broker/bam/service_listener.hh"
#include "com/centreon/broker/io/stream.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
// Forward declarations.
namespace neb {
@@ -73,6 +73,6 @@ class service_book {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_SERVICE_BOOK_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/service_listener.hh b/broker/bam/inc/com/centreon/broker/bam/service_listener.hh
index 1971e2c07fb..b312c584490 100644
--- a/broker/bam/inc/com/centreon/broker/bam/service_listener.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/service_listener.hh
@@ -20,10 +20,9 @@
#define CCB_BAM_SERVICE_LISTENER_HH
#include "com/centreon/broker/io/stream.hh"
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/neb/internal.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
// Forward declarations.
namespace neb {
@@ -67,6 +66,6 @@ class service_listener {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_SERVICE_LISTENER_HH
diff --git a/broker/bam/inc/com/centreon/broker/bam/timeperiod_map.hh b/broker/bam/inc/com/centreon/broker/bam/timeperiod_map.hh
index 0f5e0e21a40..5219c74aeea 100644
--- a/broker/bam/inc/com/centreon/broker/bam/timeperiod_map.hh
+++ b/broker/bam/inc/com/centreon/broker/bam/timeperiod_map.hh
@@ -19,10 +19,9 @@
#ifndef CCB_BAM_TIMEPERIOD_MAP_HH
#define CCB_BAM_TIMEPERIOD_MAP_HH
-#include "com/centreon/broker/namespace.hh"
#include "com/centreon/broker/time/timeperiod.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
namespace bam {
/**
@@ -53,6 +52,6 @@ class timeperiod_map {
};
} // namespace bam
-CCB_END()
+}
#endif // !CCB_BAM_TIMEPERIOD_MAP_HH
diff --git a/broker/bam/src/availability_builder.cc b/broker/bam/src/availability_builder.cc
index ec11f363779..64e41c92534 100644
--- a/broker/bam/src/availability_builder.cc
+++ b/broker/bam/src/availability_builder.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015, 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 : contact@centreon.com
+/**
+* Copyright 2014-2015, 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/availability_builder.hh"
diff --git a/broker/bam/src/availability_thread.cc b/broker/bam/src/availability_thread.cc
index 6a4f8224f8b..f88336b49e6 100644
--- a/broker/bam/src/availability_thread.cc
+++ b/broker/bam/src/availability_thread.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014, 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 : contact@centreon.com
+/**
+* Copyright 2014, 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/availability_thread.hh"
diff --git a/broker/bam/src/ba.cc b/broker/bam/src/ba.cc
index 83c3d980367..ecc1ffaa49d 100644
--- a/broker/bam/src/ba.cc
+++ b/broker/bam/src/ba.cc
@@ -1,5 +1,5 @@
-/*
- * Copyright 2014-2016, 2021-2023 Centreon
+/**
+ * Copyright 2014-2016, 2021-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
#include "com/centreon/broker/bam/ba.hh"
#include
+
#include
#include "com/centreon/broker/bam/impact_values.hh"
@@ -76,7 +77,7 @@ ba::ba(uint32_t id,
void ba::add_impact(std::shared_ptr const& impact) {
auto it = _impacts.find(impact.get());
if (it == _impacts.end()) {
- impact_info& ii(_impacts[impact.get()]);
+ impact_info& ii = _impacts[impact.get()];
ii.kpi_ptr = impact;
impact->impact_hard(ii.hard_impact);
impact->impact_soft(ii.soft_impact);
@@ -131,7 +132,7 @@ uint32_t ba::get_service_id() const {
*
* @return True if the BA is in downtime, false otherwise.
*/
-bool ba::get_in_downtime() const {
+bool ba::in_downtime() const {
return _in_downtime;
}
@@ -425,26 +426,6 @@ void ba::_open_new_event(io::stream* visitor,
}
}
-/**
- * @brief Recompute all impacts.
- *
- * This method was created to prevent the real values to derive to
- * much from their true value due to the caching system.
- */
-void ba::_recompute() {
- _acknowledgement_hard = 0.0;
- _acknowledgement_soft = 0.0;
- _downtime_hard = 0.0;
- _downtime_soft = 0.0;
- _level_hard = 100.0;
- _level_soft = 100.0;
- for (std::unordered_map::iterator it(_impacts.begin()),
- end(_impacts.end());
- it != end; ++it)
- _apply_impact(it->first, it->second);
- _recompute_count = 0;
-}
-
/**
* Commit the initial events of this ba.
*
@@ -527,7 +508,7 @@ std::shared_ptr ba::_generate_ba_status(
auto ret{std::make_shared()};
BaStatus& status = ret->mut_obj();
status.set_ba_id(get_id());
- status.set_in_downtime(get_in_downtime());
+ status.set_in_downtime(in_downtime());
if (_event)
status.set_last_state_change(_event->obj().start_time());
else
@@ -631,74 +612,52 @@ void ba::set_level_warning(double level) {
}
/**
- * @brief Update this computable with the child modifications.
+ * @brief Update this computable with the child modifications. This function is
+ * called only if child has changes. And it will notify its parents only if it
+ * also changes.
*
* @param child The child that changed.
* @param visitor The visitor to handle events.
*/
void ba::update_from(computable* child, io::stream* visitor) {
auto logger = log_v2::bam();
- logger->trace("ba::update_from");
- auto it = _impacts.find(static_cast(child));
- if (it != _impacts.end()) {
- // Get impact.
- impact_values new_hard_impact;
- impact_values new_soft_impact;
- it->second.kpi_ptr->impact_hard(new_hard_impact);
- it->second.kpi_ptr->impact_soft(new_soft_impact);
- bool kpi_in_downtime(it->second.kpi_ptr->in_downtime());
-
- // Logging.
- SPDLOG_LOGGER_DEBUG(
- logger,
- "BAM: BA {}, '{}' is getting notified of child update (KPI {}, impact "
- "{}, last state change {}, downtime {})",
- _id, _name, it->second.kpi_ptr->get_id(), new_hard_impact.get_nominal(),
- it->second.kpi_ptr->get_last_state_change(), kpi_in_downtime);
-
- // If the new impact is the same as the old, don't update.
- if (it->second.hard_impact == new_hard_impact &&
- it->second.soft_impact == new_soft_impact &&
- it->second.in_downtime == kpi_in_downtime) {
- SPDLOG_LOGGER_DEBUG(
- logger,
- "BAM: BA {} has no changes since last update: hard impact: (ack: {}, "
- "dwnt: {}, nominal: {}), downtime: {}",
- _id, new_hard_impact.get_acknowledgement(),
- new_hard_impact.get_nominal(), new_hard_impact.get_downtime(),
- kpi_in_downtime);
- return;
- }
- timestamp last_state_change(it->second.kpi_ptr->get_last_state_change());
- if (!last_state_change.is_null())
- _last_kpi_update = std::max(_last_kpi_update, last_state_change);
-
- // Discard old data.
- _unapply_impact(it->first, it->second);
-
- // Apply new data.
- SPDLOG_LOGGER_TRACE(
- log_v2::bam(),
- "BAM: BA {} changes: hard impact changed {}, soft impact changed {}, "
- "downtime {} => {}",
- _id, it->second.hard_impact != new_hard_impact,
- it->second.soft_impact != new_soft_impact, it->second.in_downtime,
- kpi_in_downtime);
- it->second.hard_impact = new_hard_impact;
- it->second.soft_impact = new_soft_impact;
- it->second.in_downtime = kpi_in_downtime;
- bool changed = _apply_impact(it->first, it->second);
- SPDLOG_LOGGER_TRACE(log_v2::bam(), "BA has changed: {}", changed);
-
- // Check for inherited downtimes.
- _compute_inherited_downtime(visitor);
-
- // Generate status event.
- visit(visitor);
-
- if (changed)
- notify_parents_of_change(visitor);
- }
+ logger->trace("ba::update_from (BA {})", _id);
+ // Get impact.
+ impact_values new_hard_impact;
+ impact_values new_soft_impact;
+ kpi* kpi_child = static_cast(child);
+ kpi_child->impact_hard(new_hard_impact);
+ kpi_child->impact_soft(new_soft_impact);
+ bool kpi_in_downtime(kpi_child->in_downtime());
+ bool previous_in_downtime = _in_downtime;
+
+ // Logging.
+ SPDLOG_LOGGER_DEBUG(
+ logger,
+ "BAM: BA {}, '{}' is getting notified of child update (KPI {}, impact "
+ "{}, last state change {}, downtime {})",
+ _id, _name, kpi_child->get_id(), new_hard_impact.get_nominal(),
+ kpi_child->get_last_state_change(), kpi_in_downtime);
+
+ timestamp last_state_change(kpi_child->get_last_state_change());
+ if (!last_state_change.is_null())
+ _last_kpi_update = std::max(_last_kpi_update, last_state_change);
+
+ // Apply new data.
+ SPDLOG_LOGGER_TRACE(log_v2::bam(), "BAM: BA {} updated from KPI {}", _id,
+ kpi_child->get_id());
+ bool changed = _apply_changes(kpi_child, new_hard_impact, new_soft_impact,
+ kpi_in_downtime);
+ SPDLOG_LOGGER_TRACE(log_v2::bam(), "BA has changed: {}", changed);
+
+ // Check for inherited downtimes.
+ _compute_inherited_downtime(visitor);
+
+ // Generate status event.
+ visit(visitor);
+
+ if (changed || _in_downtime != previous_in_downtime)
+ notify_parents_of_change(visitor);
}
/**
@@ -708,8 +667,8 @@ void ba::update_from(computable* child, io::stream* visitor) {
* @return A multiline strings with various informations.
*/
std::string ba::object_info() const {
- return fmt::format("BA {}\nname: {}\nstate: {}", _id, _name,
- get_state_hard());
+ return fmt::format("BA {}\nname: {}\nstate: {}\ndowntime: {}", _id, _name,
+ get_state_hard(), _in_downtime);
}
/**
diff --git a/broker/bam/src/ba_best.cc b/broker/bam/src/ba_best.cc
index 6b9ea4660f0..ef52a7aa8de 100644
--- a/broker/bam/src/ba_best.cc
+++ b/broker/bam/src/ba_best.cc
@@ -1,24 +1,25 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-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 : contact@centreon.com
+ */
#include "com/centreon/broker/bam/ba_best.hh"
#include
+
#include
#include "bbdo/bam/ba_status.hh"
@@ -96,29 +97,54 @@ state ba_best::get_state_soft() const {
*
* @param[in] impact Impact information.
*/
-bool ba_best::_apply_impact(kpi* kpi_ptr __attribute__((unused)),
+void ba_best::_apply_impact(kpi* kpi_ptr [[maybe_unused]],
ba::impact_info& impact) {
- const std::array order{0, 3, 4, 2, 1};
-
- auto is_state_better = [&](short current_state, short new_state) -> bool {
+ auto is_state_better = [](short current_state, short new_state) -> bool {
+ const std::array order{0, 3, 4, 2, 1};
assert((unsigned int)current_state < order.size());
assert((unsigned int)new_state < order.size());
return order[new_state] < order[current_state];
};
if (_dt_behaviour == configuration::ba::dt_ignore_kpi && impact.in_downtime)
- return false;
+ return;
- bool retval = false;
- if (is_state_better(_computed_soft_state, impact.soft_impact.get_state())) {
+ if (is_state_better(_computed_soft_state, impact.soft_impact.get_state()))
_computed_soft_state = impact.soft_impact.get_state();
- retval = true;
- }
- if (is_state_better(_computed_hard_state, impact.hard_impact.get_state())) {
+ if (is_state_better(_computed_hard_state, impact.hard_impact.get_state()))
_computed_hard_state = impact.hard_impact.get_state();
- retval = true;
+}
+
+/**
+ * Apply some impact. This method is more complete than _apply_impact().
+ * It takes as argument a child kpi and its impact. This child is already
+ * known, so its previous impact is replaced by the new one.
+ * In other words, this method makes almost the same work as _unapply_impact()
+ * and the _apply_impact() ; the difference is that it returns true if the BA
+ * really changed.
+ *
+ * @param[in] impact Impact information.
+ * @return True if the BA changes, False otherwise.
+ */
+bool ba_best::_apply_changes(kpi* child,
+ const impact_values& new_hard_impact,
+ const impact_values& new_soft_impact,
+ bool in_downtime) {
+ state previous_state = _computed_hard_state;
+
+ _computed_soft_state = _computed_hard_state = state_critical;
+
+ // We recompute all impacts...
+ for (auto it = _impacts.begin(), end = _impacts.end(); it != end; ++it) {
+ if (it->first == child) {
+ it->second.hard_impact = new_hard_impact;
+ it->second.soft_impact = new_soft_impact;
+ it->second.in_downtime = in_downtime;
+ }
+ _apply_impact(it->first, it->second);
}
- return retval;
+
+ return _computed_hard_state != previous_state;
}
/**
@@ -174,11 +200,3 @@ std::string ba_best::get_output() const {
std::string ba_best::get_perfdata() const {
return {};
}
-
-void ba_best::_recompute() {
- _computed_soft_state = state_critical;
- _computed_hard_state = state_critical;
- for (auto it = _impacts.begin(), end = _impacts.end(); it != end; ++it)
- _apply_impact(it->first, it->second);
- _recompute_count = 0;
-}
diff --git a/broker/bam/src/ba_impact.cc b/broker/bam/src/ba_impact.cc
index 1321935767e..970955e0307 100644
--- a/broker/bam/src/ba_impact.cc
+++ b/broker/bam/src/ba_impact.cc
@@ -1,24 +1,25 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-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 : contact@centreon.com
+ */
#include "com/centreon/broker/bam/ba_impact.hh"
#include
+
#include
#include "bbdo/bam/ba_status.hh"
@@ -99,7 +100,7 @@ state ba_impact::get_state_soft() const {
*
* @param[in] impact Impact information.
*/
-bool ba_impact::_apply_impact(kpi* kpi_ptr __attribute__((unused)),
+void ba_impact::_apply_impact(kpi* kpi_ptr [[maybe_unused]],
ba::impact_info& impact) {
// Adjust values.
_acknowledgement_hard += impact.hard_impact.get_acknowledgement();
@@ -108,12 +109,23 @@ bool ba_impact::_apply_impact(kpi* kpi_ptr __attribute__((unused)),
_downtime_soft += impact.soft_impact.get_downtime();
if (_dt_behaviour == configuration::ba::dt_ignore_kpi && impact.in_downtime)
- return false;
- bool retval = impact.hard_impact.get_nominal() != 0 ||
- impact.soft_impact.get_nominal() != 0;
+ return;
_level_hard -= impact.hard_impact.get_nominal();
_level_soft -= impact.soft_impact.get_nominal();
- return retval;
+}
+
+bool ba_impact::_apply_changes(kpi* child,
+ const impact_values& new_hard_impact,
+ const impact_values& new_soft_impact,
+ bool in_downtime) {
+ int32_t previous_level = _level_hard;
+ auto it = _impacts.find(child);
+ _unapply_impact(child, it->second);
+ it->second.hard_impact = new_hard_impact;
+ it->second.soft_impact = new_soft_impact;
+ it->second.in_downtime = in_downtime;
+ _apply_impact(child, it->second);
+ return previous_level != _level_hard;
}
/**
@@ -169,7 +181,7 @@ std::string ba_impact::get_output() const {
for (auto it = _impacts.begin(), end = _impacts.end(); it != end; ++it) {
if (it->second.hard_impact.get_nominal() > eps) {
lst.emplace_back(fmt::format(
- "KPI{} (impact: {})", it->first->get_id(),
+ "KPI {} (impact: {})", it->first->get_name(),
static_cast(it->second.hard_impact.get_nominal())));
}
}
@@ -233,3 +245,23 @@ std::string ba_impact::get_perfdata() const {
"BA_Level={};{};{};0;100", static_cast(_normalize(_level_hard)),
static_cast(_level_warning), static_cast(_level_critical));
}
+
+/**
+ * @brief Recompute all impacts.
+ *
+ * This method was created to prevent the real values to derive to
+ * much from their true value due to the caching system.
+ */
+void ba_impact::_recompute() {
+ _acknowledgement_hard = 0.0;
+ _acknowledgement_soft = 0.0;
+ _downtime_hard = 0.0;
+ _downtime_soft = 0.0;
+ _level_hard = 100.0;
+ _level_soft = 100.0;
+ for (std::unordered_map::iterator it = _impacts.begin(),
+ end = _impacts.end();
+ it != end; ++it)
+ _apply_impact(it->first, it->second);
+ _recompute_count = 0;
+}
diff --git a/broker/bam/src/ba_ratio_number.cc b/broker/bam/src/ba_ratio_number.cc
index c8218be6bcc..4977e563a29 100644
--- a/broker/bam/src/ba_ratio_number.cc
+++ b/broker/bam/src/ba_ratio_number.cc
@@ -1,24 +1,25 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-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 : contact@centreon.com
+ */
#include "com/centreon/broker/bam/ba_ratio_number.hh"
#include
+
#include
#include "bbdo/bam/ba_status.hh"
@@ -32,6 +33,8 @@
using namespace com::centreon::broker;
using namespace com::centreon::broker::bam;
+static constexpr double eps = 0.000001;
+
/**
* Constructor.
*
@@ -87,21 +90,15 @@ state ba_ratio_number::get_state_soft() const {
*
* @param[in] impact Impact information.
*/
-bool ba_ratio_number::_apply_impact(kpi* kpi_ptr __attribute__((unused)),
+void ba_ratio_number::_apply_impact(kpi* kpi_ptr [[maybe_unused]],
ba::impact_info& impact) {
if (_dt_behaviour == configuration::ba::dt_ignore_kpi && impact.in_downtime)
- return false;
+ return;
- bool retval = false;
- if (impact.soft_impact.get_state() == state_critical) {
+ if (impact.soft_impact.get_state() == state_critical)
_level_soft++;
- retval = true;
- }
- if (impact.hard_impact.get_state() == state_critical) {
+ if (impact.hard_impact.get_state() == state_critical)
_level_hard++;
- retval = true;
- }
- return retval;
}
/**
@@ -111,7 +108,7 @@ bool ba_ratio_number::_apply_impact(kpi* kpi_ptr __attribute__((unused)),
*/
void ba_ratio_number::_unapply_impact(kpi* kpi_ptr,
ba::impact_info& impact
- __attribute__((unused))) {
+ [[maybe_unused]]) {
_level_soft = 0.;
_level_hard = 0.;
@@ -123,14 +120,37 @@ void ba_ratio_number::_unapply_impact(kpi* kpi_ptr,
_apply_impact(it->first, it->second);
}
-void ba_ratio_number::_recompute() {
- _level_hard = 0.0;
- _level_soft = 0.0f;
- for (std::unordered_map::iterator it(_impacts.begin()),
- end(_impacts.end());
- it != end; ++it)
+/**
+ * Apply some child changes. This method is more complete than _apply_impact().
+ * It takes as argument a child kpi and its impact. This child is already
+ * known, so its previous impact is replaced by the new one.
+ * In other words, this method makes almost the same work as _unapply_impact()
+ * and the _apply_impact() ; the difference is that it returns true if the BA
+ * really changed.
+ *
+ * @param[in] impact Impact information.
+ * @return True if the BA changes, False otherwise.
+ */
+bool ba_ratio_number::_apply_changes(kpi* child,
+ const impact_values& new_hard_impact,
+ const impact_values& new_soft_impact,
+ bool in_downtime) {
+ double previous_level = _level_hard;
+ _level_soft = 0.;
+ _level_hard = 0.;
+
+ // We recompute all impact, except the one to unapply...
+ for (std::unordered_map::iterator it = _impacts.begin(),
+ end = _impacts.end();
+ it != end; ++it) {
+ if (it->first == child) {
+ it->second.hard_impact = new_hard_impact;
+ it->second.soft_impact = new_soft_impact;
+ it->second.in_downtime = in_downtime;
+ }
_apply_impact(it->first, it->second);
- _recompute_count = 0;
+ }
+ return std::abs(previous_level - _level_hard) > eps;
}
/**
diff --git a/broker/bam/src/ba_ratio_percent.cc b/broker/bam/src/ba_ratio_percent.cc
index da3804df5d6..4c4b2e0fb37 100644
--- a/broker/bam/src/ba_ratio_percent.cc
+++ b/broker/bam/src/ba_ratio_percent.cc
@@ -1,24 +1,25 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-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 : contact@centreon.com
+ */
#include "com/centreon/broker/bam/ba_ratio_percent.hh"
#include
+
#include
#include "bbdo/bam/ba_status.hh"
@@ -32,6 +33,8 @@
using namespace com::centreon::broker;
using namespace com::centreon::broker::bam;
+static constexpr double eps = 0.000001;
+
/**
* Constructor.
*
@@ -89,21 +92,15 @@ state ba_ratio_percent::get_state_soft() const {
*
* @param[in] impact Impact information.
*/
-bool ba_ratio_percent::_apply_impact(kpi* kpi_ptr __attribute__((unused)),
+void ba_ratio_percent::_apply_impact(kpi* kpi_ptr [[maybe_unused]],
ba::impact_info& impact) {
if (_dt_behaviour == configuration::ba::dt_ignore_kpi && impact.in_downtime)
- return false;
+ return;
- bool retval = false;
- if (impact.soft_impact.get_state() == state_critical) {
+ if (impact.soft_impact.get_state() == state_critical)
_level_soft++;
- retval = true;
- }
- if (impact.hard_impact.get_state() == state_critical) {
+ if (impact.hard_impact.get_state() == state_critical)
_level_hard++;
- retval = true;
- }
- return retval;
}
/**
@@ -125,14 +122,37 @@ void ba_ratio_percent::_unapply_impact(kpi* kpi_ptr,
_apply_impact(it->first, it->second);
}
-void ba_ratio_percent::_recompute() {
- _level_hard = 0.0;
- _level_soft = 0.0;
- for (std::unordered_map::iterator it(_impacts.begin()),
- end(_impacts.end());
- it != end; ++it)
+/**
+ * Apply some child changes. This method is more complete than _apply_impact().
+ * It takes as argument a child kpi and its impact. This child is already
+ * known, so its previous impact is replaced by the new one.
+ * In other words, this method makes almost the same work as _unapply_impact()
+ * and the _apply_impact() ; the difference is that it returns true if the BA
+ * really changed.
+ *
+ * @param[in] impact Impact information.
+ * @return True if the BA changes, False otherwise.
+ */
+bool ba_ratio_percent::_apply_changes(kpi* child,
+ const impact_values& new_hard_impact,
+ const impact_values& new_soft_impact,
+ bool in_downtime) {
+ double previous_level = _level_hard;
+ _level_soft = 0.;
+ _level_hard = 0.;
+
+ // We recompute all impact, except the one to unapply...
+ for (std::unordered_map::iterator it = _impacts.begin(),
+ end = _impacts.end();
+ it != end; ++it) {
+ if (it->first == child) {
+ it->second.hard_impact = new_hard_impact;
+ it->second.soft_impact = new_soft_impact;
+ it->second.in_downtime = in_downtime;
+ }
_apply_impact(it->first, it->second);
- _recompute_count = 0;
+ }
+ return std::abs(previous_level - _level_hard) > eps;
}
/**
diff --git a/broker/bam/src/ba_svc_mapping.cc b/broker/bam/src/ba_svc_mapping.cc
index 4aff684dac8..88a70e5691f 100644
--- a/broker/bam/src/ba_svc_mapping.cc
+++ b/broker/bam/src/ba_svc_mapping.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/ba_worst.cc b/broker/bam/src/ba_worst.cc
index 956e8a8e503..2954cfc1326 100644
--- a/broker/bam/src/ba_worst.cc
+++ b/broker/bam/src/ba_worst.cc
@@ -1,24 +1,25 @@
-/*
-** Copyright 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2022-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 : contact@centreon.com
+ */
#include "com/centreon/broker/bam/ba_worst.hh"
#include
+
#include
#include "bbdo/bam/ba_status.hh"
@@ -96,29 +97,59 @@ state ba_worst::get_state_soft() const {
*
* @param[in] impact Impact information.
*/
-bool ba_worst::_apply_impact(kpi* kpi_ptr [[maybe_unused]],
+void ba_worst::_apply_impact(kpi* kpi_ptr [[maybe_unused]],
ba::impact_info& impact) {
- const std::array order{0, 3, 4, 2, 1};
-
- auto is_state_worse = [&](short current_state, short new_state) -> bool {
+ auto is_state_worse = [](short current_state, short new_state) -> bool {
+ const std::array order{0, 3, 4, 2, 1};
assert((unsigned int)current_state < order.size());
assert((unsigned int)new_state < order.size());
return order[new_state] > order[current_state];
};
if (_dt_behaviour == configuration::ba::dt_ignore_kpi && impact.in_downtime)
- return false;
+ return;
- bool retval = false;
- if (is_state_worse(_computed_soft_state, impact.soft_impact.get_state())) {
+ if (is_state_worse(_computed_soft_state, impact.soft_impact.get_state()))
_computed_soft_state = impact.soft_impact.get_state();
- retval = true;
- }
- if (is_state_worse(_computed_hard_state, impact.hard_impact.get_state())) {
+ if (is_state_worse(_computed_hard_state, impact.hard_impact.get_state()))
_computed_hard_state = impact.hard_impact.get_state();
- retval = true;
+}
+
+/**
+ * @brief Apply some child changes. This method is more complete than
+ * _apply_impact(). It takes as argument a child kpi and its impact. This child
+ * is already known, so its previous impact is replaced by the new one. In other
+ * words, this method makes almost the same work as _unapply_impact() and the
+ * _apply_impact() ; the difference is that it returns true if the BA really
+ * changed.
+ *
+ * @param child The kpi that changed
+ * @param new_hard_impact The new hard impact for this child.
+ * @param new_soft_impact The new soft impact for this child.
+ * @param child_in_downtime The child is in downtime (or not).
+ *
+ * @return True if the BA changes, False otherwise.
+ */
+bool ba_worst::_apply_changes(kpi* child,
+ const impact_values& new_hard_impact,
+ const impact_values& new_soft_impact,
+ bool child_in_downtime) {
+ state previous_state = _computed_hard_state;
+
+ _computed_soft_state = _computed_hard_state = state_ok;
+
+ // We recompute all impacts...
+ for (auto it = _impacts.begin(), end = _impacts.end(); it != end; ++it) {
+ /* The changed child is updated in _impacts */
+ if (it->first == child) {
+ it->second.hard_impact = new_hard_impact;
+ it->second.soft_impact = new_soft_impact;
+ it->second.in_downtime = child_in_downtime;
+ }
+ _apply_impact(it->first, it->second);
}
- return retval;
+
+ return _computed_hard_state != previous_state;
}
/**
@@ -150,8 +181,8 @@ std::string ba_worst::get_output() const {
state state = it->second.hard_impact.get_state();
assert(static_cast(state) < 4);
if (state != state_ok) {
- retval.emplace_back(fmt::format("KPI{} is in {} state",
- it->first->get_id(), state_str[state]));
+ retval.emplace_back(fmt::format(
+ "KPI {} is in {} state", it->first->get_name(), state_str[state]));
}
}
return retval;
@@ -189,11 +220,3 @@ std::string ba_worst::get_output() const {
std::string ba_worst::get_perfdata() const {
return {};
}
-
-void ba_worst::_recompute() {
- _computed_soft_state = state_ok;
- _computed_hard_state = state_ok;
- for (auto it = _impacts.begin(), end = _impacts.end(); it != end; ++it)
- _apply_impact(it->first, it->second);
- _recompute_count = 0;
-}
diff --git a/broker/bam/src/bool_and.cc b/broker/bam/src/bool_and.cc
index b7827e41946..b4bfd08c393 100644
--- a/broker/bam/src/bool_and.cc
+++ b/broker/bam/src/bool_and.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014, 2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_call.cc b/broker/bam/src/bool_call.cc
index 61d7e1fc30f..d9ef598ede9 100644
--- a/broker/bam/src/bool_call.cc
+++ b/broker/bam/src/bool_call.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014, 2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_constant.cc b/broker/bam/src/bool_constant.cc
index 35306713e33..5db05c3c153 100644
--- a/broker/bam/src/bool_constant.cc
+++ b/broker/bam/src/bool_constant.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014, 2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_equal.cc b/broker/bam/src/bool_equal.cc
index 471fcb3d9a9..290b1d59788 100644
--- a/broker/bam/src/bool_equal.cc
+++ b/broker/bam/src/bool_equal.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014-2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_expression.cc b/broker/bam/src/bool_expression.cc
index ddae66dbd62..91786490f2f 100644
--- a/broker/bam/src/bool_expression.cc
+++ b/broker/bam/src/bool_expression.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014, 2021-2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_less_than.cc b/broker/bam/src/bool_less_than.cc
index e2c6ecac6b6..ec6090d4285 100644
--- a/broker/bam/src/bool_less_than.cc
+++ b/broker/bam/src/bool_less_than.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014, 2021-2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_more_than.cc b/broker/bam/src/bool_more_than.cc
index 7b1a65bce18..2f6b25e340a 100644
--- a/broker/bam/src/bool_more_than.cc
+++ b/broker/bam/src/bool_more_than.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014, 2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_not.cc b/broker/bam/src/bool_not.cc
index f012089888a..f0b8be0f03c 100644
--- a/broker/bam/src/bool_not.cc
+++ b/broker/bam/src/bool_not.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014, 2022-2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_not_equal.cc b/broker/bam/src/bool_not_equal.cc
index 4879a96d3de..77de82ca2a2 100644
--- a/broker/bam/src/bool_not_equal.cc
+++ b/broker/bam/src/bool_not_equal.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2016-2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_operation.cc b/broker/bam/src/bool_operation.cc
index fb01d18872b..12bef11453b 100644
--- a/broker/bam/src/bool_operation.cc
+++ b/broker/bam/src/bool_operation.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014-2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_or.cc b/broker/bam/src/bool_or.cc
index 0c15a6cbc72..f85d11d3a3e 100644
--- a/broker/bam/src/bool_or.cc
+++ b/broker/bam/src/bool_or.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014, 2021, 2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_service.cc b/broker/bam/src/bool_service.cc
index 406f29cc4fd..deda9bfede3 100644
--- a/broker/bam/src/bool_service.cc
+++ b/broker/bam/src/bool_service.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014, 2021-2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/bool_value.cc b/broker/bam/src/bool_value.cc
index 8979e7a3fd6..a4e7191de70 100644
--- a/broker/bam/src/bool_value.cc
+++ b/broker/bam/src/bool_value.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
+/**
+* Copyright 2014 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/bool_value.hh"
diff --git a/broker/bam/src/bool_xor.cc b/broker/bam/src/bool_xor.cc
index 258b52bbcb3..69bf05d54d3 100644
--- a/broker/bam/src/bool_xor.cc
+++ b/broker/bam/src/bool_xor.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014, 2022-2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/computable.cc b/broker/bam/src/computable.cc
index b4ebea097bb..af9871894b3 100644
--- a/broker/bam/src/computable.cc
+++ b/broker/bam/src/computable.cc
@@ -1,5 +1,5 @@
-/*
- * Copyright 2014-2023 Centreon
+/**
+ * Copyright 2014-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,7 @@
*/
#include "com/centreon/broker/bam/computable.hh"
+
#include "com/centreon/broker/log_v2.hh"
using namespace com::centreon::broker::bam;
@@ -27,6 +28,9 @@ using namespace com::centreon::broker::bam;
* @param[in] parent Parent node.
*/
void computable::add_parent(std::shared_ptr const& parent) {
+ for (auto it = _parents.begin(), end = _parents.end(); it != end; ++it)
+ if (it->lock().get() == parent.get())
+ return;
_parents.push_back(std::weak_ptr(parent));
}
diff --git a/broker/bam/src/configuration/applier/ba.cc b/broker/bam/src/configuration/applier/ba.cc
index aef6d67e0b5..8442b3e1421 100644
--- a/broker/bam/src/configuration/applier/ba.cc
+++ b/broker/bam/src/configuration/applier/ba.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2017, 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 : contact@centreon.com
+/**
+* Copyright 2014-2017, 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/configuration/applier/ba.hh"
diff --git a/broker/bam/src/configuration/applier/bool_expression.cc b/broker/bam/src/configuration/applier/bool_expression.cc
index 6c6d938961a..74bc6f13cc2 100644
--- a/broker/bam/src/configuration/applier/bool_expression.cc
+++ b/broker/bam/src/configuration/applier/bool_expression.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2016 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 : contact@centreon.com
+/**
+* Copyright 2014-2016 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/bool_expression.hh"
diff --git a/broker/bam/src/configuration/applier/kpi.cc b/broker/bam/src/configuration/applier/kpi.cc
index 83fb3edd414..568cc914ea3 100644
--- a/broker/bam/src/configuration/applier/kpi.cc
+++ b/broker/bam/src/configuration/applier/kpi.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015, 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 : contact@centreon.com
+/**
+* Copyright 2014-2015, 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/configuration/applier/kpi.hh"
@@ -267,11 +267,12 @@ std::shared_ptr applier::kpi::_new_kpi(
std::shared_ptr my_kpi;
if (cfg.is_service()) {
log_v2::bam()->info(
- "BAM: creating new KPI {} of service ({}, {}) impacting BA {}",
- cfg.get_id(), cfg.get_host_id(), cfg.get_service_id(), cfg.get_ba_id());
- auto obj{std::make_shared(cfg.get_id(), cfg.get_ba_id(),
- cfg.get_host_id(),
- cfg.get_service_id())};
+ "BAM: creating new KPI {} of service {} ({}, {}) impacting BA {}",
+ cfg.get_id(), cfg.get_name(), cfg.get_host_id(), cfg.get_service_id(),
+ cfg.get_ba_id());
+ auto obj{std::make_shared(
+ cfg.get_id(), cfg.get_ba_id(), cfg.get_host_id(), cfg.get_service_id(),
+ cfg.get_name())};
obj->set_acknowledged(cfg.is_acknowledged());
obj->set_downtimed(cfg.is_downtimed());
obj->set_impact_critical(cfg.get_impact_critical());
@@ -282,21 +283,21 @@ std::shared_ptr applier::kpi::_new_kpi(
_book->listen(cfg.get_host_id(), cfg.get_service_id(), obj.get());
my_kpi = std::static_pointer_cast(obj);
} else if (cfg.is_ba()) {
- log_v2::bam()->info("BAM: creating new KPI {} of BA {} impacting BA {}",
- cfg.get_id(), cfg.get_indicator_ba_id(),
+ log_v2::bam()->info("BAM: creating new KPI {} of BA {}:{} impacting BA {}",
+ cfg.get_id(), cfg.get_indicator_ba_id(), cfg.get_name(),
cfg.get_ba_id());
- std::shared_ptr obj(
- std::make_shared(cfg.get_id(), cfg.get_ba_id()));
+ std::shared_ptr obj(std::make_shared(
+ cfg.get_id(), cfg.get_ba_id(), cfg.get_name()));
obj->set_impact_critical(cfg.get_impact_critical());
obj->set_impact_unknown(cfg.get_impact_unknown());
obj->set_impact_warning(cfg.get_impact_warning());
my_kpi = std::static_pointer_cast(obj);
} else if (cfg.is_boolexp()) {
log_v2::bam()->info(
- "BAM: creating new KPI {} of boolean expression {} impacting BA {}",
- cfg.get_id(), cfg.get_boolexp_id(), cfg.get_ba_id());
- std::shared_ptr obj(
- std::make_shared(cfg.get_id(), cfg.get_ba_id()));
+ "BAM: creating new KPI {} of boolean expression {}:{} impacting BA {}",
+ cfg.get_id(), cfg.get_boolexp_id(), cfg.get_name(), cfg.get_ba_id());
+ std::shared_ptr obj(std::make_shared(
+ cfg.get_id(), cfg.get_ba_id(), cfg.get_name()));
obj->set_impact(cfg.get_impact_critical());
my_kpi = std::static_pointer_cast(obj);
} else
diff --git a/broker/bam/src/configuration/applier/state.cc b/broker/bam/src/configuration/applier/state.cc
index b269b173c87..e2b118ec352 100644
--- a/broker/bam/src/configuration/applier/state.cc
+++ b/broker/bam/src/configuration/applier/state.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014-2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/src/configuration/ba.cc b/broker/bam/src/configuration/ba.cc
index 9d70aa50ac7..8749f947202 100644
--- a/broker/bam/src/configuration/ba.cc
+++ b/broker/bam/src/configuration/ba.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
+/**
+* Copyright 2014 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/configuration/ba.hh"
diff --git a/broker/bam/src/configuration/bool_expression.cc b/broker/bam/src/configuration/bool_expression.cc
index 3d30656f385..c9cb3bfb043 100644
--- a/broker/bam/src/configuration/bool_expression.cc
+++ b/broker/bam/src/configuration/bool_expression.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
+/**
+* Copyright 2014 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/configuration/bool_expression.hh"
diff --git a/broker/bam/src/configuration/kpi.cc b/broker/bam/src/configuration/kpi.cc
index 82b844ba394..fbd6fab817b 100644
--- a/broker/bam/src/configuration/kpi.cc
+++ b/broker/bam/src/configuration/kpi.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
+/**
+* Copyright 2014 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/configuration/kpi.hh"
@@ -41,7 +41,8 @@ kpi::kpi(uint32_t id,
bool ignore_acknowledgement,
double warning,
double critical,
- double unknown)
+ double unknown,
+ const std::string& name)
: _id(id),
_state_type(state_type),
_host_id(host_id),
@@ -57,71 +58,13 @@ kpi::kpi(uint32_t id,
_ignore_acknowledgement(ignore_acknowledgement),
_impact_warning(warning),
_impact_critical(critical),
- _impact_unknown(unknown) {
+ _impact_unknown(unknown),
+ _name(name) {
_event.set_kpi_id(_id);
_event.set_ba_id(_ba_id);
_event.set_start_time(::time(nullptr));
}
-/**
- * Copy constructor.
- *
- * @param[in] other The copy.
- */
-kpi::kpi(kpi const& other)
- : _id(other._id),
- _state_type(other._state_type),
- _host_id(other._host_id),
- _service_id(other._service_id),
- _ba_id(other._ba_id),
- _indicator_ba_id(other._indicator_ba_id),
- _meta_id(other._meta_id),
- _boolexp_id(other._boolexp_id),
- _status(other._status),
- _downtimed(other._downtimed),
- _acknowledged(other._acknowledged),
- _ignore_downtime(other._ignore_downtime),
- _ignore_acknowledgement(other._ignore_acknowledgement),
- _impact_warning(other._impact_warning),
- _impact_critical(other._impact_critical),
- _impact_unknown(other._impact_unknown),
- _event(other._event) {}
-
-/**
- * Destructor.
- */
-kpi::~kpi() {}
-
-/**
- * Assignment operator.
- *
- * @param[in] other The copy.
- *
- * @return This object.
- */
-kpi& kpi::operator=(kpi const& other) {
- if (&other != this) {
- _id = other._id;
- _state_type = other._state_type;
- _host_id = other._host_id;
- _service_id = other._service_id;
- _ba_id = other._ba_id;
- _indicator_ba_id = other._indicator_ba_id;
- _meta_id = other._meta_id;
- _boolexp_id = other._boolexp_id;
- _status = other._status;
- _downtimed = other._downtimed;
- _acknowledged = other._acknowledged;
- _ignore_downtime = other._ignore_downtime;
- _ignore_acknowledgement = other._ignore_acknowledgement;
- _impact_warning = other._impact_warning;
- _impact_critical = other._impact_critical;
- _impact_unknown = other._impact_unknown;
- _event = other._event;
- }
- return *this;
-}
-
/**
* @brief more efficient than MessageDifferencier
*
diff --git a/broker/bam/src/configuration/reader_v2.cc b/broker/bam/src/configuration/reader_v2.cc
index ceb49a5d01c..56f4102cd69 100644
--- a/broker/bam/src/configuration/reader_v2.cc
+++ b/broker/bam/src/configuration/reader_v2.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2017, 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 : contact@centreon.com
+/**
+* Copyright 2014-2017, 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/configuration/reader_v2.hh"
@@ -90,7 +90,10 @@ void reader_v2::_load(state::kpis& kpis) {
"g.average_impact),"
" COALESCE(COALESCE(k.drop_unknown, uu.impact), "
"g.average_impact),"
- " k.last_state_change, k.in_downtime, k.last_impact"
+ " k.last_state_change, k.in_downtime, k.last_impact,"
+ " kpiba.name AS ba_name, mbb.name AS boolean_name, "
+ " CONCAT(hst.host_name, '/', serv.service_description) AS "
+ "service_name"
" FROM mod_bam_kpi AS k"
" INNER JOIN mod_bam AS mb"
" ON k.id_ba = mb.ba_id"
@@ -107,6 +110,14 @@ void reader_v2::_load(state::kpis& kpis) {
" WHERE activate='1'"
" GROUP BY id_ba) AS g"
" ON k.id_ba=g.id_ba"
+ " LEFT JOIN mod_bam as kpiba"
+ " ON k.id_indicator_ba=kpiba.ba_id"
+ " LEFT JOIN mod_bam_boolean AS mbb"
+ " ON mbb.boolean_id= k.boolean_id"
+ " LEFT JOIN service as serv"
+ " ON k.service_id = serv.service_id"
+ " LEFT JOIN host as hst"
+ " ON k.host_id = hst.host_id"
" WHERE k.activate='1'"
" AND mb.activate='1'"
" AND pr.poller_id={}",
@@ -117,16 +128,28 @@ void reader_v2::_load(state::kpis& kpis) {
try {
database::mysql_result res(future.get());
while (_mysql.fetch_row(res)) {
+ std::string kpi_name;
+ uint32_t service_id = res.value_as_u32(3);
+ uint32_t boolean_id = res.value_as_u32(7);
+ uint32_t id_indicator_ba = res.value_as_u32(5);
+
+ if (service_id > 0)
+ kpi_name = "Service " + res.value_as_str(21);
+ else if (boolean_id > 0)
+ kpi_name = "Boolean rule " + res.value_as_str(20);
+ else
+ kpi_name = "Business Activity " + res.value_as_str(19);
+
// KPI object.
uint32_t kpi_id(res.value_as_u32(0));
kpis[kpi_id] = kpi(kpi_id, // ID.
res.value_as_i32(1), // State type.
res.value_as_u32(2), // Host ID.
- res.value_as_u32(3), // Service ID.
+ service_id, // Service ID.
res.value_as_u32(4), // BA ID.
- res.value_as_u32(5), // BA indicator ID.
+ id_indicator_ba, // BA indicator ID.
res.value_as_u32(6), // Meta-service ID.
- res.value_as_u32(7), // Boolean expression ID.
+ boolean_id, // Boolean expression ID.
res.value_as_i32(8), // Status.
res.value_as_f32(9), // Downtimed.
res.value_as_f32(10), // Acknowledged.
@@ -134,7 +157,8 @@ void reader_v2::_load(state::kpis& kpis) {
res.value_as_bool(12), // Ignore acknowledgement.
res.value_as_f64(13), // Warning.
res.value_as_f64(14), // Critical.
- res.value_as_f64(15)); // Unknown.
+ res.value_as_f64(15), // Unknown.
+ kpi_name);
// KPI state.
if (!res.value_is_null(16)) {
diff --git a/broker/bam/src/configuration/state.cc b/broker/bam/src/configuration/state.cc
index 764cf881714..9905c879b47 100644
--- a/broker/bam/src/configuration/state.cc
+++ b/broker/bam/src/configuration/state.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-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 : contact@centreon.com
+/**
+* Copyright 2014-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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/configuration/state.hh"
diff --git a/broker/bam/src/connector.cc b/broker/bam/src/connector.cc
index 6a2f83f2076..6d33845ade3 100644
--- a/broker/bam/src/connector.cc
+++ b/broker/bam/src/connector.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015, 2021, 2023 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 : contact@centreon.com
+/**
+* Copyright 2014-2015, 2021, 2023 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/connector.hh"
diff --git a/broker/bam/src/event_cache_visitor.cc b/broker/bam/src/event_cache_visitor.cc
index 6242ad6bc4f..57f98fa6675 100644
--- a/broker/bam/src/event_cache_visitor.cc
+++ b/broker/bam/src/event_cache_visitor.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015, 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 : contact@centreon.com
+/**
+* Copyright 2014-2015, 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/event_cache_visitor.hh"
diff --git a/broker/bam/src/exp_builder.cc b/broker/bam/src/exp_builder.cc
index df218096b99..923714dba08 100644
--- a/broker/bam/src/exp_builder.cc
+++ b/broker/bam/src/exp_builder.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2016 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 : contact@centreon.com
+/**
+* Copyright 2016 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/exp_builder.hh"
diff --git a/broker/bam/src/exp_parser.cc b/broker/bam/src/exp_parser.cc
index 81bbaa3bc25..3841747d803 100644
--- a/broker/bam/src/exp_parser.cc
+++ b/broker/bam/src/exp_parser.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2016 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 : contact@centreon.com
+/**
+* Copyright 2016 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/exp_parser.hh"
diff --git a/broker/bam/src/exp_tokenizer.cc b/broker/bam/src/exp_tokenizer.cc
index c7536aba439..448c6e10680 100644
--- a/broker/bam/src/exp_tokenizer.cc
+++ b/broker/bam/src/exp_tokenizer.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2016 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 : contact@centreon.com
+/**
+* Copyright 2016 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/exp_tokenizer.hh"
diff --git a/broker/bam/src/factory.cc b/broker/bam/src/factory.cc
index 9ebce4e907e..e7781556bf9 100644
--- a/broker/bam/src/factory.cc
+++ b/broker/bam/src/factory.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2016, 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 : contact@centreon.com
+/**
+* Copyright 2014-2016, 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/factory.hh"
diff --git a/broker/bam/src/hst_svc_mapping.cc b/broker/bam/src/hst_svc_mapping.cc
index 40ac81ff8ac..70887131558 100644
--- a/broker/bam/src/hst_svc_mapping.cc
+++ b/broker/bam/src/hst_svc_mapping.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014, 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 : contact@centreon.com
+/**
+* Copyright 2014, 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/hst_svc_mapping.hh"
diff --git a/broker/bam/src/impact_values.cc b/broker/bam/src/impact_values.cc
index d576fc623fc..7bd1d37b5ee 100644
--- a/broker/bam/src/impact_values.cc
+++ b/broker/bam/src/impact_values.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
+/**
+* Copyright 2014 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/impact_values.hh"
diff --git a/broker/bam/src/kpi.cc b/broker/bam/src/kpi.cc
index 02ad2d7d725..03082745f24 100644
--- a/broker/bam/src/kpi.cc
+++ b/broker/bam/src/kpi.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015, 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 : contact@centreon.com
+/**
+* Copyright 2014-2015, 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/kpi.hh"
@@ -29,7 +29,8 @@ static constexpr double eps = 0.000001;
/**
* Constructor.
*/
-kpi::kpi(uint32_t kpi_id, uint32_t ba_id) : _id(kpi_id), _ba_id(ba_id) {}
+kpi::kpi(uint32_t kpi_id, uint32_t ba_id, const std::string& name)
+ : _id(kpi_id), _ba_id(ba_id), _name(name) {}
/**
* Get KPI ID.
diff --git a/broker/bam/src/kpi_ba.cc b/broker/bam/src/kpi_ba.cc
index 6a154db3867..463447dcd14 100644
--- a/broker/bam/src/kpi_ba.cc
+++ b/broker/bam/src/kpi_ba.cc
@@ -1,5 +1,5 @@
-/*
- * Copyright 2014-2015, 2021-2023 Centreon
+/**
+ * Copyright 2014-2015, 2021-2024 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,7 +27,8 @@ using namespace com::centreon::broker::bam;
/**
* Default constructor.
*/
-kpi_ba::kpi_ba(uint32_t kpi_id, uint32_t ba_id) : kpi(kpi_id, ba_id) {}
+kpi_ba::kpi_ba(uint32_t kpi_id, uint32_t ba_id, const std::string& ba_name)
+ : kpi(kpi_id, ba_id, ba_name) {}
/**
* Get the impact introduced by a CRITICAL state of the BA.
@@ -145,7 +146,7 @@ void kpi_ba::visit(io::stream* visitor) {
last_ba_update);
}
// If state changed, close event and open a new one.
- else if (_ba->get_in_downtime() != _event->in_downtime() ||
+ else if (_ba->in_downtime() != _event->in_downtime() ||
ba_state != _event->status()) {
_event->set_end_time(last_ba_update.get_time_t());
visitor->write(std::make_shared(*_event));
@@ -240,7 +241,7 @@ void kpi_ba::_open_new_event(io::stream* visitor,
_event->set_start_time(event_start_time.get_time_t());
_event->set_end_time(-1);
_event->set_impact_level(impact);
- _event->set_in_downtime(_ba->get_in_downtime());
+ _event->set_in_downtime(_ba->in_downtime());
_event->set_output(_ba->get_output());
_event->set_perfdata(_ba->get_perfdata());
_event->set_status(com::centreon::broker::State(ba_state));
@@ -263,7 +264,7 @@ bool kpi_ba::ok_state() const {
* @return True if this KPI is in downtime.
*/
bool kpi_ba::in_downtime() const {
- return _ba->get_in_downtime();
+ return _ba->in_downtime();
}
/**
@@ -305,7 +306,7 @@ std::string kpi_ba::object_info() const {
* @param output An output stream.
*/
void kpi_ba::dump(std::ofstream& output) const {
- output << fmt::format("\"{}\" -> \"{}\"", object_info(), _ba->get_id());
+ output << fmt::format("\"{}\" -> \"{}\"", object_info(), _ba->object_info());
_ba->dump(output);
dump_parents(output);
}
diff --git a/broker/bam/src/kpi_boolexp.cc b/broker/bam/src/kpi_boolexp.cc
index 4bd64f53af1..7731ac4ac2e 100644
--- a/broker/bam/src/kpi_boolexp.cc
+++ b/broker/bam/src/kpi_boolexp.cc
@@ -28,8 +28,10 @@ using namespace com::centreon::broker::bam;
/**
* Default constructor.
*/
-kpi_boolexp::kpi_boolexp(uint32_t kpi_id, uint32_t ba_id)
- : kpi(kpi_id, ba_id) {}
+kpi_boolexp::kpi_boolexp(uint32_t kpi_id,
+ uint32_t ba_id,
+ const std::string& bool_name)
+ : kpi(kpi_id, ba_id, bool_name) {}
/**
* Return true if in downtime.
diff --git a/broker/bam/src/kpi_service.cc b/broker/bam/src/kpi_service.cc
index 3fe4326aa87..d66ccb2fe50 100644
--- a/broker/bam/src/kpi_service.cc
+++ b/broker/bam/src/kpi_service.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2014-2015, 2021-2023 Centreon
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -42,8 +42,9 @@ static bool time_is_undefined(uint64_t t) {
kpi_service::kpi_service(uint32_t kpi_id,
uint32_t ba_id,
uint32_t host_id,
- uint32_t service_id)
- : kpi(kpi_id, ba_id),
+ uint32_t service_id,
+ const std::string& host_serv)
+ : kpi(kpi_id, ba_id, host_serv),
_host_id(host_id),
_service_id(service_id),
_acknowledged(false),
@@ -718,8 +719,9 @@ void kpi_service::update_from(computable* child [[maybe_unused]],
* @return A multiline strings with various informations.
*/
std::string kpi_service::object_info() const {
- return fmt::format("KPI {} with service ({}, {})\nstate: {}", get_id(),
- get_host_id(), get_service_id(), get_state_hard());
+ return fmt::format("KPI {} with service ({}, {})\nstate: {}\ndowntime: {}",
+ get_id(), get_host_id(), get_service_id(),
+ get_state_hard(), _downtimed);
}
/**
diff --git a/broker/bam/src/main.cc b/broker/bam/src/main.cc
index 17c24d5afb3..888485e1490 100644
--- a/broker/bam/src/main.cc
+++ b/broker/bam/src/main.cc
@@ -1,20 +1,21 @@
-/*
-** Copyright 2011-2015, 2020-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 : contact@centreon.com
-*/
+/**
+ * Copyright 2011-2015, 2020-2023 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 : contact@centreon.com
+ */
+
#include "bbdo/bam/ba_duration_event.hh"
#include "bbdo/bam/ba_status.hh"
#include "bbdo/bam/dimension_ba_bv_relation_event.hh"
@@ -169,6 +170,10 @@ void broker_module_init(void const* arg) {
e.register_event(bam::pb_dimension_truncate_table_signal::static_type(),
"DimensionTruncateTableSignal",
&bam::pb_dimension_truncate_table_signal::operations);
+ /* Let's register the ba_info event to be sure it is declared in case
+ * brokerrpc is not already instanciated. */
+ e.register_event(make_type(io::extcmd, extcmd::de_ba_info), "ba_info",
+ &extcmd::pb_ba_info::operations);
}
}
}
diff --git a/broker/bam/src/reporting_stream.cc b/broker/bam/src/reporting_stream.cc
index 267b4067c55..dc7eb59ed2e 100644
--- a/broker/bam/src/reporting_stream.cc
+++ b/broker/bam/src/reporting_stream.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015,2017, 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 : contact@centreon.com
+/**
+* Copyright 2014-2015,2017, 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 : contact@centreon.com
*/
#include
diff --git a/broker/bam/src/service_book.cc b/broker/bam/src/service_book.cc
index 49162bdbeef..3144ce54626 100644
--- a/broker/bam/src/service_book.cc
+++ b/broker/bam/src/service_book.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-2015, 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 : contact@centreon.com
+/**
+* Copyright 2014-2015, 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/service_book.hh"
diff --git a/broker/bam/src/service_listener.cc b/broker/bam/src/service_listener.cc
index 91238966b59..d4d033be5aa 100644
--- a/broker/bam/src/service_listener.cc
+++ b/broker/bam/src/service_listener.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014-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 : contact@centreon.com
+/**
+* Copyright 2014-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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/service_listener.hh"
diff --git a/broker/bam/src/timeperiod_map.cc b/broker/bam/src/timeperiod_map.cc
index 5784af8ff55..63f7cb7b39b 100644
--- a/broker/bam/src/timeperiod_map.cc
+++ b/broker/bam/src/timeperiod_map.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
+/**
+* Copyright 2014 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/timeperiod_map.hh"
diff --git a/broker/bam/test/ba/kpi_ba.cc b/broker/bam/test/ba/kpi_ba.cc
index e3cae43916b..fe1e517d1f2 100644
--- a/broker/bam/test/ba/kpi_ba.cc
+++ b/broker/bam/test/ba/kpi_ba.cc
@@ -1,24 +1,26 @@
-/*
-** Copyright 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.
-** 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2021-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 : contact@centreon.com
+ */
#include "com/centreon/broker/bam/kpi_ba.hh"
+
#include
#include
+
#include "com/centreon/broker/bam/ba_impact.hh"
#include "com/centreon/broker/bam/ba_worst.hh"
#include "com/centreon/broker/bam/configuration/applier/state.hh"
@@ -80,7 +82,8 @@ TEST_F(KpiBA, KpiBa) {
/* Construction of kpi_services */
for (int i = 0; i < 2; i++) {
- auto s = std::make_shared(i + 1, 2, 3, 1 + i);
+ auto s = std::make_shared(i + 1, 2, 3, 1 + i,
+ fmt::format("service {}", i));
s->set_downtimed(false);
s->set_impact_critical(100);
s->set_impact_unknown(0);
@@ -94,11 +97,11 @@ TEST_F(KpiBA, KpiBa) {
}
/* Construction of kpi_ba */
- auto kpi_ba_child = std::make_shared(3, 2);
+ auto kpi_ba_child = std::make_shared(3, 2, "ba 2");
kpi_ba_child->set_impact_critical(100);
kpi_ba_child->set_impact_warning(75);
- auto kpi_ba = std::make_shared(4, 1);
+ auto kpi_ba = std::make_shared(4, 1, "ba 1");
kpi_ba->set_impact_critical(100);
kpi_ba->set_impact_warning(75);
@@ -158,7 +161,7 @@ TEST_F(KpiBA, KpiBa) {
ASSERT_EQ(it->end_time, -1);
ASSERT_EQ(test_ba->get_output(),
"Status is CRITICAL - At least one KPI is in a CRITICAL state: "
- "KPI3 is in CRITICAL state");
+ "KPI ba 2 is in CRITICAL state");
/* No perfdata on Worst BA */
ASSERT_EQ(test_ba->get_perfdata(), "");
}
@@ -187,7 +190,8 @@ TEST_F(KpiBA, KpiBaPb) {
/* Construction of kpi_services */
for (int i = 0; i < 2; i++) {
- auto s = std::make_shared(i + 1, 2, 3, 1 + i);
+ auto s = std::make_shared(i + 1, 2, 3, 1 + i,
+ fmt::format("service {}", i));
s->set_downtimed(false);
s->set_impact_critical(100);
s->set_impact_unknown(0);
@@ -201,11 +205,11 @@ TEST_F(KpiBA, KpiBaPb) {
}
/* Construction of kpi_ba */
- auto kpi_ba_child = std::make_shared(3, 2);
+ auto kpi_ba_child = std::make_shared(3, 2, "ba 2");
kpi_ba_child->set_impact_critical(100);
kpi_ba_child->set_impact_warning(75);
- auto kpi_ba = std::make_shared(4, 1);
+ auto kpi_ba = std::make_shared(4, 1, "ba 1");
kpi_ba->set_impact_critical(100);
kpi_ba->set_impact_warning(75);
@@ -285,11 +289,15 @@ TEST_F(KpiBA, KpiBaDt) {
test_ba_child->set_name("test-ba-child");
test_ba_child->set_downtime_behaviour(bam::configuration::ba::dt_inherit);
- std::vector> kpis;
+ absl::FixedArray, 2> kpis{
+ std::make_shared(1, 2, 3, 1,
+ fmt::format("service {}", 0)),
+ std::make_shared(2, 2, 3, 2,
+ fmt::format("service {}", 1)),
+ };
/* Construction of kpi_services */
- for (int i = 0; i < 2; i++) {
- auto s = std::make_shared(i + 1, 2, 3, 1 + i);
+ for (auto& s : kpis) {
s->set_downtimed(false);
s->set_impact_critical(100);
s->set_impact_unknown(0);
@@ -299,15 +307,14 @@ TEST_F(KpiBA, KpiBaDt) {
// test_ba_child->add_impact(s);
// s->add_parent(test_ba_child);
- kpis.push_back(s);
}
/* Construction of kpi_ba */
- auto kpi_ba_child = std::make_shared(3, 2);
+ auto kpi_ba_child = std::make_shared(3, 2, "ba 2");
kpi_ba_child->set_impact_critical(100);
kpi_ba_child->set_impact_warning(75);
- auto kpi_ba = std::make_shared(4, 1);
+ auto kpi_ba = std::make_shared(4, 1, "ba 1");
kpi_ba->set_impact_critical(100);
kpi_ba->set_impact_warning(75);
@@ -324,9 +331,9 @@ TEST_F(KpiBA, KpiBaDt) {
test_ba->add_impact(kpi_ba_child);
kpi_ba_child->add_parent(test_ba);
- for (int i = 0; i < 2; i++) {
- test_ba_child->add_impact(kpis[i]);
- kpis[i]->add_parent(test_ba_child);
+ for (auto& k : kpis) {
+ test_ba_child->add_impact(k);
+ k->add_parent(test_ba_child);
}
time_t now{time(nullptr)};
@@ -369,6 +376,8 @@ TEST_F(KpiBA, KpiBaDt) {
/* ba2 set to critical, event open because there was no previous
* state */
auto it = events.rbegin();
+
+ test_ba->dump("/tmp/test_ba.dot");
ASSERT_EQ(it->typ, test_visitor::test_event::ba);
ASSERT_EQ(it->ba_id, 1u);
ASSERT_TRUE(it->in_downtime);
@@ -399,7 +408,8 @@ TEST_F(KpiBA, KpiBaDtPb) {
/* Construction of kpi_services */
for (int i = 0; i < 2; i++) {
- auto s = std::make_shared(i + 1, 2, 3, 1 + i);
+ auto s = std::make_shared(i + 1, 2, 3, 1 + i,
+ fmt::format("service {}", i));
s->set_downtimed(false);
s->set_impact_critical(100);
s->set_impact_unknown(0);
@@ -413,11 +423,11 @@ TEST_F(KpiBA, KpiBaDtPb) {
}
/* Construction of kpi_ba */
- auto kpi_ba_child = std::make_shared(3, 2);
+ auto kpi_ba_child = std::make_shared(3, 2, "ba 2");
kpi_ba_child->set_impact_critical(100);
kpi_ba_child->set_impact_warning(75);
- auto kpi_ba = std::make_shared(4, 1);
+ auto kpi_ba = std::make_shared(4, 1, "ba 1");
kpi_ba->set_impact_critical(100);
kpi_ba->set_impact_warning(75);
@@ -510,7 +520,8 @@ TEST_F(KpiBA, KpiBaDtOff) {
/* Construction of kpi_services */
for (int i = 0; i < 2; i++) {
- auto s = std::make_shared(i + 1, 2, 3, 1 + i);
+ auto s = std::make_shared(i + 1, 2, 3, 1 + i,
+ fmt::format("service {}", i));
s->set_downtimed(false);
s->set_impact_critical(100);
s->set_impact_unknown(0);
@@ -524,11 +535,11 @@ TEST_F(KpiBA, KpiBaDtOff) {
}
/* Construction of kpi_ba */
- auto kpi_ba_child = std::make_shared(3, 2);
+ auto kpi_ba_child = std::make_shared(3, 2, "ba 2");
kpi_ba_child->set_impact_critical(100);
kpi_ba_child->set_impact_warning(75);
- auto kpi_ba = std::make_shared(4, 1);
+ auto kpi_ba = std::make_shared(4, 1, "ba 1");
kpi_ba->set_impact_critical(100);
kpi_ba->set_impact_warning(75);
@@ -591,7 +602,7 @@ TEST_F(KpiBA, KpiBaDtOff) {
dt->was_started = true;
dt->was_cancelled = true;
kpis[0]->service_update(dt, _visitor.get());
- ASSERT_TRUE(!test_ba->get_in_downtime());
+ ASSERT_TRUE(!test_ba->in_downtime());
auto events = _visitor->queue();
@@ -630,7 +641,8 @@ TEST_F(KpiBA, KpiBaDtOffPb) {
/* Construction of kpi_services */
for (int i = 0; i < 2; i++) {
- auto s = std::make_shared(i + 1, 2, 3, 1 + i);
+ auto s = std::make_shared(i + 1, 2, 3, 1 + i,
+ fmt::format("service {}", i));
s->set_downtimed(false);
s->set_impact_critical(100);
s->set_impact_unknown(0);
@@ -644,11 +656,11 @@ TEST_F(KpiBA, KpiBaDtOffPb) {
}
/* Construction of kpi_ba */
- auto kpi_ba_child = std::make_shared(3, 2);
+ auto kpi_ba_child = std::make_shared(3, 2, "ba 2");
kpi_ba_child->set_impact_critical(100);
kpi_ba_child->set_impact_warning(75);
- auto kpi_ba = std::make_shared(4, 1);
+ auto kpi_ba = std::make_shared(4, 1, "ba 1");
kpi_ba->set_impact_critical(100);
kpi_ba->set_impact_warning(75);
@@ -717,7 +729,7 @@ TEST_F(KpiBA, KpiBaDtOffPb) {
dt_obj.set_cancelled(true);
kpis[0]->service_update(dt, _visitor.get());
}
- ASSERT_TRUE(!test_ba->get_in_downtime());
+ ASSERT_TRUE(!test_ba->in_downtime());
auto events = _visitor->queue();
@@ -756,7 +768,8 @@ TEST_F(KpiBA, KpiBaOkDtOff) {
/* Construction of kpi_services */
for (int i = 0; i < 2; i++) {
- auto s = std::make_shared(i + 1, 2, 3, 1 + i);
+ auto s = std::make_shared(i + 1, 2, 3, 1 + i,
+ fmt::format("service {}", i));
s->set_downtimed(false);
s->set_impact_critical(100);
s->set_impact_unknown(0);
@@ -770,11 +783,11 @@ TEST_F(KpiBA, KpiBaOkDtOff) {
}
/* Construction of kpi_ba */
- auto kpi_ba_child = std::make_shared(3, 2);
+ auto kpi_ba_child = std::make_shared(3, 2, "ba 2");
kpi_ba_child->set_impact_critical(100);
kpi_ba_child->set_impact_warning(75);
- auto kpi_ba = std::make_shared(4, 1);
+ auto kpi_ba = std::make_shared(4, 1, "ba 1");
kpi_ba->set_impact_critical(100);
kpi_ba->set_impact_warning(75);
@@ -821,7 +834,7 @@ TEST_F(KpiBA, KpiBaOkDtOff) {
dt->actual_end_time = -1;
dt->was_started = true;
kpis[0]->service_update(dt, _visitor.get());
- ASSERT_FALSE(test_ba->get_in_downtime());
+ ASSERT_FALSE(test_ba->in_downtime());
/* Let's remove the downtime from the service. */
dt = std::make_shared();
@@ -833,7 +846,7 @@ TEST_F(KpiBA, KpiBaOkDtOff) {
dt->was_started = true;
dt->was_cancelled = true;
kpis[0]->service_update(dt, _visitor.get());
- ASSERT_FALSE(test_ba->get_in_downtime());
+ ASSERT_FALSE(test_ba->in_downtime());
}
/**
@@ -860,7 +873,8 @@ TEST_F(KpiBA, KpiBaOkDtOffPb) {
/* Construction of kpi_services */
for (int i = 0; i < 2; i++) {
- auto s = std::make_shared(i + 1, 2, 3, 1 + i);
+ auto s = std::make_shared(i + 1, 2, 3, 1 + i,
+ fmt::format("service {}", i));
s->set_downtimed(false);
s->set_impact_critical(100);
s->set_impact_unknown(0);
@@ -874,11 +888,11 @@ TEST_F(KpiBA, KpiBaOkDtOffPb) {
}
/* Construction of kpi_ba */
- auto kpi_ba_child = std::make_shared(3, 2);
+ auto kpi_ba_child = std::make_shared(3, 2, "ba 2");
kpi_ba_child->set_impact_critical(100);
kpi_ba_child->set_impact_warning(75);
- auto kpi_ba = std::make_shared(4, 1);
+ auto kpi_ba = std::make_shared(4, 1, "ba 1");
kpi_ba->set_impact_critical(100);
kpi_ba->set_impact_warning(75);
@@ -928,7 +942,7 @@ TEST_F(KpiBA, KpiBaOkDtOffPb) {
dt_obj.set_started(true);
kpis[0]->service_update(dt, _visitor.get());
}
- ASSERT_FALSE(test_ba->get_in_downtime());
+ ASSERT_FALSE(test_ba->in_downtime());
/* Let's remove the downtime from the service. */
dt = std::make_shared();
@@ -943,7 +957,7 @@ TEST_F(KpiBA, KpiBaOkDtOffPb) {
dt_obj.set_cancelled(true);
kpis[0]->service_update(dt, _visitor.get());
}
- ASSERT_FALSE(test_ba->get_in_downtime());
+ ASSERT_FALSE(test_ba->in_downtime());
}
/**
@@ -974,7 +988,8 @@ TEST_F(KpiBA, KpiBaWorstImpact) {
/* Construction of kpi_services */
for (int i = 0; i < 2; i++) {
- auto s = std::make_shared(i + 1, 2, 3, 1 + i);
+ auto s = std::make_shared(i + 1, 2, 3, 1 + i,
+ fmt::format("service {}", i));
s->set_downtimed(false);
s->set_impact_critical(100);
s->set_impact_unknown(0);
@@ -986,12 +1001,12 @@ TEST_F(KpiBA, KpiBaWorstImpact) {
}
/* Construction of kpi_ba */
- auto kpi_ba_child = std::make_shared(3, 2);
+ auto kpi_ba_child = std::make_shared(3, 2, "ba 2");
kpi_ba_child->set_impact_critical(100);
kpi_ba_child->set_impact_warning(75);
kpi_ba_child->set_impact_unknown(27);
- auto kpi_ba = std::make_shared(4, 1);
+ auto kpi_ba = std::make_shared(4, 1, "ba 1");
kpi_ba->set_impact_critical(100);
kpi_ba->set_impact_warning(75);
@@ -1070,7 +1085,8 @@ TEST_F(KpiBA, KpiBaWorstImpactPb) {
/* Construction of kpi_services */
for (int i = 0; i < 2; i++) {
- auto s = std::make_shared(i + 1, 2, 3, 1 + i);
+ auto s = std::make_shared(i + 1, 2, 3, 1 + i,
+ fmt::format("service {}", i));
s->set_downtimed(false);
s->set_impact_critical(100);
s->set_impact_unknown(0);
@@ -1082,12 +1098,12 @@ TEST_F(KpiBA, KpiBaWorstImpactPb) {
}
/* Construction of kpi_ba */
- auto kpi_ba_child = std::make_shared(3, 2);
+ auto kpi_ba_child = std::make_shared(3, 2, "ba 2");
kpi_ba_child->set_impact_critical(100);
kpi_ba_child->set_impact_warning(75);
kpi_ba_child->set_impact_unknown(27);
- auto kpi_ba = std::make_shared(4, 1);
+ auto kpi_ba = std::make_shared(4, 1, "ba 1");
kpi_ba->set_impact_critical(100);
kpi_ba->set_impact_warning(75);
diff --git a/broker/bam/test/ba/kpi_service.cc b/broker/bam/test/ba/kpi_service.cc
index 7954c41ac00..a0a017bea86 100644
--- a/broker/bam/test/ba/kpi_service.cc
+++ b/broker/bam/test/ba/kpi_service.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014, 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 : contact@centreon.com
+/**
+* Copyright 2014, 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/kpi_service.hh"
@@ -73,7 +73,7 @@ TEST_F(BamBA, KpiServiceRecompute) {
test_ba->set_level_warning(25);
std::shared_ptr kpi{
- std::make_shared(1, 1, 1, 1)};
+ std::make_shared(1, 1, 1, 1, "host_1/serv_1")};
kpi->set_impact_critical(100.0);
kpi->set_state_hard(bam::state_ok);
@@ -97,7 +97,7 @@ TEST_F(BamBA, KpiServiceRecompute) {
/* Here is an occasion to checkout output from ba when it is critical */
ASSERT_EQ(test_ba->get_output(),
"Status is CRITICAL - Level = 0 - 1 KPI out of 1 impacts the "
- "BA for 100 points - KPI1 (impact: 100)");
+ "BA for 100 points - KPI host_1/serv_1 (impact: 100)");
ASSERT_EQ(test_ba->get_perfdata(), "BA_Level=0;25;0;0;100");
}
}
@@ -128,7 +128,8 @@ TEST_F(BamBA, KpiServiceImpactState) {
std::vector results{0, 0, 1, 1, 1, 2};
for (int i = 0; i < 3; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(
+ i + 1, 1, i + 1, 1, fmt::format("host_{}/serv_1", i + 1));
s->set_impact_warning(10);
s->set_impact_critical(20);
s->set_state_hard(bam::state_ok);
@@ -165,14 +166,14 @@ TEST_F(BamBA, KpiServiceImpactState) {
* totally */
ASSERT_EQ(test_ba->get_output(),
"Status is OK - Level = 90 (warn: 70 - crit: 40) - 1 KPI "
- "out of 3 impacts the BA: KPI1 (impact: 10)");
+ "out of 3 impacts the BA: KPI host_1/serv_1 (impact: 10)");
ASSERT_EQ(test_ba->get_perfdata(), "BA_Level=90;70;40;0;100");
} else if (j == 2) {
/* Here is an occasion to test get_output for a status WARNING */
std::regex re(
"Status is WARNING - Level = 70 - 3 KPIs out of 3 impact "
- "the BA for 30 points - KPI. \\(impact: 10\\), KPI. \\(impact: "
- "10\\), KPI. \\(impact: 10\\)");
+ "the BA for 30 points - KPI.+ \\(impact: 10\\), KPI.+ \\(impact: "
+ "10\\), KPI.+ \\(impact: 10\\)");
ASSERT_TRUE(std::regex_search(test_ba->get_output(), re));
ASSERT_EQ(test_ba->get_perfdata(), "BA_Level=70;70;40;0;100");
}
@@ -248,7 +249,8 @@ TEST_F(BamBA, KpiServiceBestState) {
std::vector results{0, 0, 1, 1, 1, 2};
for (size_t i = 0; i < 3; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_ok);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -305,7 +307,8 @@ TEST_F(BamBA, KpiServiceWorstState) {
std::vector results{1, 1, 1, 2, 2, 2};
for (int i = 0; i < 3; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_impact_warning(10);
s->set_impact_critical(20);
s->set_state_hard(bam::state_ok);
@@ -403,7 +406,8 @@ TEST_F(BamBA, KpiServiceRatioNum) {
std::stack results{{2, 1, 1, 0}};
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_ok);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -459,7 +463,8 @@ TEST_F(BamBA, KpiServiceRatioPercent) {
std::stack results({2, 1, 0, 0});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_ok);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -500,7 +505,8 @@ TEST_F(BamBA, KpiServiceDtInheritAllCritical) {
std::stack results({true, false, false, false});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -531,7 +537,7 @@ TEST_F(BamBA, KpiServiceDtInheritAllCritical) {
kpis[j]->service_update(dt, _visitor.get());
short val = results.top();
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
results.pop();
}
}
@@ -547,7 +553,8 @@ TEST_F(BamBA, KpiServiceDtInheritAllCriticalPb) {
std::stack results({true, false, false, false});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -580,7 +587,7 @@ TEST_F(BamBA, KpiServiceDtInheritAllCriticalPb) {
kpis[j]->service_update(dt, _visitor.get());
short val = results.top();
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
results.pop();
}
}
@@ -596,7 +603,8 @@ TEST_F(BamBA, KpiServiceDtInheritOneOK) {
std::stack results({false, false, false, false});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
if (i == 0)
s->set_state_hard(bam::state_ok);
else
@@ -631,7 +639,7 @@ TEST_F(BamBA, KpiServiceDtInheritOneOK) {
kpis[j]->service_update(dt, _visitor.get());
short val = results.top();
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
results.pop();
}
@@ -651,7 +659,8 @@ TEST_F(BamBA, KpiServiceDtInheritOneOKPb) {
std::stack results({false, false, false, false});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
if (i == 0)
s->set_state_hard(bam::state_ok);
else
@@ -688,7 +697,7 @@ TEST_F(BamBA, KpiServiceDtInheritOneOKPb) {
kpis[j]->service_update(dt, _visitor.get());
short val = results.top();
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
results.pop();
}
@@ -708,7 +717,8 @@ TEST_F(BamBA, KpiServiceIgnoreDt) {
std::stack results({false, false, false, false});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -739,7 +749,7 @@ TEST_F(BamBA, KpiServiceIgnoreDt) {
kpis[j]->service_update(dt, _visitor.get());
short val = results.top();
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
results.pop();
}
}
@@ -755,7 +765,8 @@ TEST_F(BamBA, KpiServiceIgnoreDtPb) {
std::stack results({false, false, false, false});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -789,7 +800,7 @@ TEST_F(BamBA, KpiServiceIgnoreDtPb) {
kpis[j]->service_update(dt, _visitor.get());
short val = results.top();
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
results.pop();
}
}
@@ -805,7 +816,8 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpi) {
std::stack results({false, false, false, false});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -836,7 +848,7 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpi) {
kpis[j]->service_update(dt, _visitor.get());
short val = results.top();
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
results.pop();
}
}
@@ -852,7 +864,8 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpiPb) {
std::stack results({false, false, false, false});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -886,7 +899,7 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpiPb) {
kpis[j]->service_update(dt, _visitor.get());
short val = results.top();
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
results.pop();
}
}
@@ -907,7 +920,8 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpiImpact) {
results.push(2);
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
if (i == 3)
s->set_state_hard(bam::state_ok);
else
@@ -961,7 +975,8 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpiImpactPb) {
std::stack results({0, 0, 1, 2});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
if (i == 3)
s->set_state_hard(bam::state_ok);
else
@@ -1016,7 +1031,8 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpiBest) {
std::stack results({0, 2, 1, 0});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
switch (i) {
case 0:
case 1:
@@ -1072,7 +1088,8 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpiBestPb) {
std::stack results({0, 2, 1, 0});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
switch (i) {
case 0:
case 1:
@@ -1132,7 +1149,8 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpiWorst) {
std::stack results({0, 0, 1, 2});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
switch (i) {
case 0:
case 1:
@@ -1188,7 +1206,8 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpiWorstPb) {
std::stack results({0, 0, 1, 2});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
switch (i) {
case 0:
case 1:
@@ -1249,7 +1268,8 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpiRatio) {
std::stack results({0, 1, 2, 2});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -1296,7 +1316,8 @@ TEST_F(BamBA, KpiServiceDtIgnoreKpiRatioPb) {
std::stack results({0, 1, 2, 2});
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -1347,7 +1368,8 @@ TEST_F(BamBA, KpiServiceDt) {
std::vector results{false, false, false, true};
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -1379,7 +1401,7 @@ TEST_F(BamBA, KpiServiceDt) {
kpis[j]->service_update(dt, _visitor.get());
short val = *it;
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
++it;
}
@@ -1493,7 +1515,7 @@ TEST_F(BamBA, KpiServiceDt) {
++it;
} while (it->typ != test_visitor::test_event::kpi);
}
- ASSERT_FALSE(test_ba->get_in_downtime());
+ ASSERT_FALSE(test_ba->in_downtime());
}
TEST_F(BamBA, KpiServiceDtPb) {
@@ -1507,7 +1529,8 @@ TEST_F(BamBA, KpiServiceDtPb) {
std::vector results{false, false, false, true};
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -1542,7 +1565,7 @@ TEST_F(BamBA, KpiServiceDtPb) {
kpis[j]->service_update(dt, _visitor.get());
short val = *it;
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
++it;
}
@@ -1656,7 +1679,7 @@ TEST_F(BamBA, KpiServiceDtPb) {
++it;
} while (it->typ != test_visitor::test_event::kpi);
}
- ASSERT_FALSE(test_ba->get_in_downtime());
+ ASSERT_FALSE(test_ba->in_downtime());
}
TEST_F(BamBA, KpiServiceDtInherited_set) {
@@ -1670,7 +1693,8 @@ TEST_F(BamBA, KpiServiceDtInherited_set) {
std::vector results{false, false, false, true};
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -1702,7 +1726,7 @@ TEST_F(BamBA, KpiServiceDtInherited_set) {
kpis[j]->service_update(dt, _visitor.get());
short val = *it;
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
++it;
}
@@ -1714,7 +1738,7 @@ TEST_F(BamBA, KpiServiceDtInherited_set) {
dt->was_started = true;
kpis[0]->service_update(dt, _visitor.get());
}
- ASSERT_TRUE(test_ba->get_in_downtime());
+ ASSERT_TRUE(test_ba->in_downtime());
}
TEST_F(BamBA, KpiServiceDtInherited_setPb) {
@@ -1728,7 +1752,8 @@ TEST_F(BamBA, KpiServiceDtInherited_setPb) {
std::vector results{false, false, false, true};
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -1763,7 +1788,7 @@ TEST_F(BamBA, KpiServiceDtInherited_setPb) {
kpis[j]->service_update(dt, _visitor.get());
short val = *it;
- ASSERT_EQ(test_ba->get_in_downtime(), val);
+ ASSERT_EQ(test_ba->in_downtime(), val);
++it;
}
@@ -1775,7 +1800,7 @@ TEST_F(BamBA, KpiServiceDtInherited_setPb) {
dt_obj.set_started(true);
kpis[0]->service_update(dt, _visitor.get());
}
- ASSERT_TRUE(test_ba->get_in_downtime());
+ ASSERT_TRUE(test_ba->in_downtime());
}
TEST_F(BamBA, KpiServiceDtInherited_unset) {
@@ -1788,7 +1813,8 @@ TEST_F(BamBA, KpiServiceDtInherited_unset) {
std::vector> kpis;
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -1820,7 +1846,7 @@ TEST_F(BamBA, KpiServiceDtInherited_unset) {
kpis[j]->service_update(dt, _visitor.get());
}
- ASSERT_FALSE(test_ba->get_in_downtime());
+ ASSERT_FALSE(test_ba->in_downtime());
}
TEST_F(BamBA, KpiServiceDtInherited_unsetPb) {
@@ -1833,7 +1859,8 @@ TEST_F(BamBA, KpiServiceDtInherited_unsetPb) {
std::vector> kpis;
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -1866,7 +1893,7 @@ TEST_F(BamBA, KpiServiceDtInherited_unsetPb) {
kpis[j]->service_update(dt, _visitor.get());
}
- ASSERT_FALSE(test_ba->get_in_downtime());
+ ASSERT_FALSE(test_ba->in_downtime());
}
TEST_F(BamBA, KpiServiceAcknowledgement) {
@@ -1879,7 +1906,8 @@ TEST_F(BamBA, KpiServiceAcknowledgement) {
std::vector> kpis;
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
@@ -1926,7 +1954,8 @@ TEST_F(BamBA, KpiServiceAcknowledgementPb) {
std::vector> kpis;
for (int i = 0; i < 4; i++) {
- auto s = std::make_shared(i + 1, 1, i + 1, 1);
+ auto s = std::make_shared(i + 1, 1, i + 1, 1,
+ fmt::format("service {}", i));
s->set_state_hard(bam::state_critical);
s->set_state_soft(s->get_state_hard());
test_ba->add_impact(s);
diff --git a/broker/bam/test/configuration/applier-boolexp.cc b/broker/bam/test/configuration/applier-boolexp.cc
index 60659b4763c..277c913ef33 100644
--- a/broker/bam/test/configuration/applier-boolexp.cc
+++ b/broker/bam/test/configuration/applier-boolexp.cc
@@ -1,4 +1,4 @@
-/*
+/**
* Copyright 2018 Centreon
**
** Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/broker/bam/test/exp_builder/availability_builder.cc b/broker/bam/test/exp_builder/availability_builder.cc
index 4dae1d48d0c..9f92361f8e4 100644
--- a/broker/bam/test/exp_builder/availability_builder.cc
+++ b/broker/bam/test/exp_builder/availability_builder.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 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 : contact@centreon.com
+/**
+* Copyright 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/availability_builder.hh"
#include
diff --git a/broker/bam/test/exp_builder/exp_builder.cc b/broker/bam/test/exp_builder/exp_builder.cc
index b9c9e186605..17962d5f824 100644
--- a/broker/bam/test/exp_builder/exp_builder.cc
+++ b/broker/bam/test/exp_builder/exp_builder.cc
@@ -638,7 +638,7 @@ TEST_F(BamExpBuilder, KpiBoolexpWithService) {
exp->set_expression(b);
b->add_parent(exp);
- auto kpi = std::make_shared(1, 1);
+ auto kpi = std::make_shared(1, 1, "test_boool_exp");
kpi->link_boolexp(exp);
exp->add_parent(kpi);
@@ -682,7 +682,7 @@ TEST_F(BamExpBuilder, KpiBoolexpReversedImpactWithService) {
exp->set_expression(b);
b->add_parent(exp);
- auto kpi = std::make_shared(1, 1);
+ auto kpi = std::make_shared(1, 1, "test_boool_exp");
kpi->link_boolexp(exp);
exp->add_parent(kpi);
@@ -902,7 +902,7 @@ TEST_F(BamExpBuilder, BoolexpKpiServiceAndBoolExpression) {
exp->set_expression(b);
b->add_parent(exp);
- auto kpi = std::make_shared(1, 1);
+ auto kpi = std::make_shared(1, 1, "test_boool_exp");
kpi->set_impact(100);
kpi->link_boolexp(exp);
exp->add_parent(kpi);
@@ -1008,7 +1008,7 @@ TEST_F(BamExpBuilder, BoolexpKpiServiceAndBoolExpressionAndOperator) {
exp->set_expression(b);
b->add_parent(exp);
- auto kpi = std::make_shared(1, 1);
+ auto kpi = std::make_shared(1, 1, "test_boool_exp");
kpi->set_impact(100);
kpi->link_boolexp(exp);
exp->add_parent(kpi);
diff --git a/broker/bam/test/exp_parser/get_postfix.cc b/broker/bam/test/exp_parser/get_postfix.cc
index 43a6557aa49..847e08f4dc2 100644
--- a/broker/bam/test/exp_parser/get_postfix.cc
+++ b/broker/bam/test/exp_parser/get_postfix.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2016 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 : contact@centreon.com
+/**
+* Copyright 2016 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 : contact@centreon.com
*/
#include
diff --git a/broker/bam/test/exp_tokenizer/next.cc b/broker/bam/test/exp_tokenizer/next.cc
index 429947db89a..575181737b5 100644
--- a/broker/bam/test/exp_tokenizer/next.cc
+++ b/broker/bam/test/exp_tokenizer/next.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2016 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 : contact@centreon.com
+/**
+* Copyright 2016 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 : contact@centreon.com
*/
#include
diff --git a/broker/bam/test/monitoring_stream.cc b/broker/bam/test/monitoring_stream.cc
index d59e8745357..b40d0ef5fd9 100644
--- a/broker/bam/test/monitoring_stream.cc
+++ b/broker/bam/test/monitoring_stream.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2014 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 : contact@centreon.com
+/**
+* Copyright 2014 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 : contact@centreon.com
*/
#include "com/centreon/broker/bam/monitoring_stream.hh"
diff --git a/broker/bam/test/test-visitor.hh b/broker/bam/test/test-visitor.hh
index 59d2ba1b420..973843acd7d 100644
--- a/broker/bam/test/test-visitor.hh
+++ b/broker/bam/test/test-visitor.hh
@@ -26,7 +26,7 @@
#include "com/centreon/broker/bam/internal.hh"
#include "com/centreon/broker/io/stream.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
class test_visitor : public io::stream {
public:
class test_event {
@@ -148,6 +148,6 @@ class test_visitor : public io::stream {
}
}
};
-CCB_END()
+}
#endif // !CCB_TEST_VISITOR_HH
diff --git a/broker/bam/test/time/check_timeperiod.cc b/broker/bam/test/time/check_timeperiod.cc
index c5da7f935ed..634c7c87eee 100644
--- a/broker/bam/test/time/check_timeperiod.cc
+++ b/broker/bam/test/time/check_timeperiod.cc
@@ -1,19 +1,19 @@
-/*
-** Copyright 2013-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 : contact@centreon.com
+/**
+* Copyright 2013-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 : contact@centreon.com
*/
#include
diff --git a/broker/core/inc/com/centreon/broker/bbdo/acceptor.hh b/broker/core/inc/com/centreon/broker/bbdo/acceptor.hh
index e5e02f78a46..66ecb05f7ae 100644
--- a/broker/core/inc/com/centreon/broker/bbdo/acceptor.hh
+++ b/broker/core/inc/com/centreon/broker/bbdo/acceptor.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2013,2015,2017 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2013,2015,2017-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BBDO_ACCEPTOR_HH
#define CCB_BBDO_ACCEPTOR_HH
@@ -22,7 +22,7 @@
#include "com/centreon/broker/io/endpoint.hh"
#include "com/centreon/broker/io/extension.hh"
-CCB_BEGIN()
+namespace com::centreon::broker {
// Forward declaration.
namespace processing {
@@ -47,15 +47,14 @@ class acceptor : public io::endpoint {
time_t _timeout;
uint32_t _ack_limit;
std::list> _extensions;
+ const bool _grpc_serialized;
public:
- acceptor(std::string name,
- bool negotiate,
- time_t timeout,
- bool one_peer_retention_mode = false,
- bool coarse = false,
+ acceptor(std::string name, bool negotiate, time_t timeout,
+ bool one_peer_retention_mode = false, bool coarse = false,
uint32_t ack_limit = 1000,
- std::list>&& extensions = {});
+ std::list>&& extensions = {},
+ bool grpc_serialized = false);
~acceptor() noexcept;
acceptor(const acceptor&) = delete;
acceptor& operator=(const acceptor&) = delete;
@@ -70,6 +69,6 @@ class acceptor : public io::endpoint {
};
} // namespace bbdo
-CCB_END()
+} // namespace com::centreon::broker
#endif // !CCB_BBDO_ACCEPTOR_HH
diff --git a/broker/core/inc/com/centreon/broker/bbdo/connector.hh b/broker/core/inc/com/centreon/broker/bbdo/connector.hh
index eb949126ba7..934938bdb84 100644
--- a/broker/core/inc/com/centreon/broker/bbdo/connector.hh
+++ b/broker/core/inc/com/centreon/broker/bbdo/connector.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2013,2015,2017, 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2013,2015,2017, 2021-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BBDO_CONNECTOR_HH
#define CCB_BBDO_CONNECTOR_HH
@@ -22,9 +22,8 @@
#include "com/centreon/broker/io/endpoint.hh"
#include "com/centreon/broker/io/extension.hh"
-CCB_BEGIN()
+namespace com::centreon::broker::bbdo {
-namespace bbdo {
/**
* @class connector connector.hh "com/centreon/broker/bbdo/connector.hh"
* @brief BBDO connector.
@@ -38,23 +37,20 @@ class connector : public io::endpoint {
time_t _timeout;
uint32_t _ack_limit;
std::list> _extensions;
+ const bool _grpc_serialized;
std::shared_ptr _open(std::shared_ptr stream);
public:
- connector(bool negotiate,
- time_t timeout,
- bool connector_is_input,
- bool coarse = false,
- uint32_t ack_limit = 1000,
- std::list>&& extensions = {});
+ connector(bool negotiate, time_t timeout, bool connector_is_input,
+ bool coarse = false, uint32_t ack_limit = 1000,
+ std::list>&& extensions = {},
+ bool grpc_serialized = false);
~connector() noexcept = default;
connector(const connector&) = delete;
connector& operator=(const connector&) = delete;
std::shared_ptr open() override;
};
-} // namespace bbdo
-
-CCB_END()
+} // namespace com::centreon::broker::bbdo
#endif // !CCB_BBDO_CONNECTOR_HH
diff --git a/broker/core/inc/com/centreon/broker/bbdo/factory.hh b/broker/core/inc/com/centreon/broker/bbdo/factory.hh
index 60787db2a65..ad38b720071 100644
--- a/broker/core/inc/com/centreon/broker/bbdo/factory.hh
+++ b/broker/core/inc/com/centreon/broker/bbdo/factory.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2013 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 : contact@centreon.com
-*/
+/**
+ * Copyright 2013-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BBDO_FACTORY_HH
#define CCB_BBDO_FACTORY_HH
@@ -22,9 +22,8 @@
#include "com/centreon/broker/io/extension.hh"
#include "com/centreon/broker/io/factory.hh"
-CCB_BEGIN()
+namespace com::centreon::broker::bbdo {
-namespace bbdo {
/**
* @class factory factory.hh "com/centreon/broker/bbdo/factory.hh"
* @brief BBDO protocol factory.
@@ -42,13 +41,10 @@ class factory : public io::factory {
factory& operator=(factory const& other) = delete;
bool has_endpoint(config::endpoint& cfg, io::extension* ext) override;
io::endpoint* new_endpoint(
- config::endpoint& cfg,
- bool& is_acceptor,
+ config::endpoint& cfg, bool& is_acceptor,
std::shared_ptr cache =
std::shared_ptr()) const override;
};
-} // namespace bbdo
-
-CCB_END()
+} // namespace com::centreon::broker::bbdo
#endif // !CCB_BBDO_FACTORY_HH
diff --git a/broker/core/inc/com/centreon/broker/bbdo/internal.hh b/broker/core/inc/com/centreon/broker/bbdo/internal.hh
index 454bf35d2b5..440ce2e182f 100644
--- a/broker/core/inc/com/centreon/broker/bbdo/internal.hh
+++ b/broker/core/inc/com/centreon/broker/bbdo/internal.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2013,2017,2020-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 : contact@centreon.com
-*/
+/**
+ * Copyright 2013,2017,2020-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BBDO_INTERNAL_HH
#define CCB_BBDO_INTERNAL_HH
@@ -23,16 +23,14 @@
#include "bbdo/events.hh"
#include "bbdo/extcmd.pb.h"
#include "com/centreon/broker/io/protobuf.hh"
-#include "com/centreon/broker/namespace.hh"
#define BBDO_VERSION_MAJOR 2
#define BBDO_VERSION_MINOR 0
#define BBDO_VERSION_PATCH 0
constexpr uint32_t BBDO_HEADER_SIZE = 16u;
-CCB_BEGIN()
+namespace com::centreon::broker::bbdo {
-namespace bbdo {
using pb_welcome =
com::centreon::broker::io::protobuf;
@@ -45,14 +43,14 @@ using pb_stop =
com::centreon::broker::io::protobuf;
-using pb_bench = com::centreon::broker::io::
- protobuf;
+using pb_bench =
+ com::centreon::broker::io::protobuf;
// Load/unload of BBDO protocol.
void load();
void unload();
-} // namespace bbdo
-CCB_END()
+} // namespace com::centreon::broker::bbdo
#endif // !CCB_BBDO_INTERNAL_HH
diff --git a/broker/core/inc/com/centreon/broker/bbdo/stream.hh b/broker/core/inc/com/centreon/broker/bbdo/stream.hh
index 31afbd3f7e9..264e0b4e440 100644
--- a/broker/core/inc/com/centreon/broker/bbdo/stream.hh
+++ b/broker/core/inc/com/centreon/broker/bbdo/stream.hh
@@ -1,20 +1,20 @@
-/*
-** Copyright 2013,2017-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 : contact@centreon.com
-*/
+/**
+ * Copyright 2013,2017-2023 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 : contact@centreon.com
+ */
#ifndef CCB_BBDO_STREAM_HH
#define CCB_BBDO_STREAM_HH
@@ -23,9 +23,7 @@
#include "com/centreon/broker/io/extension.hh"
#include "com/centreon/broker/io/stream.hh"
-CCB_BEGIN()
-
-namespace bbdo {
+namespace com::centreon::broker::bbdo {
/**
* @class stream stream.hh "com/centreon/broker/bbdo/stream.hh"
* @brief BBDO stream.
@@ -64,9 +62,7 @@ class stream : public io::stream {
std::deque> _buf;
public:
- buffer(uint32_t event_id,
- uint32_t source_id,
- uint32_t dest_id,
+ buffer(uint32_t event_id, uint32_t source_id, uint32_t dest_id,
std::vector&& v)
: _event_id(event_id), _source_id(source_id), _dest_id(dest_id) {
_buf.push_back(v);
@@ -90,8 +86,7 @@ class stream : public io::stream {
}
~buffer() noexcept = default;
- bool matches(uint32_t event_id,
- uint32_t source_id,
+ bool matches(uint32_t event_id, uint32_t source_id,
uint32_t dest_id) const noexcept {
return event_id == _event_id && source_id == _source_id &&
dest_id == _dest_id;
@@ -99,12 +94,10 @@ class stream : public io::stream {
std::vector to_vector() {
size_t s = 0;
- for (auto& v : _buf)
- s += v.size();
+ for (auto& v : _buf) s += v.size();
std::vector retval;
retval.reserve(s);
- for (auto& v : _buf)
- retval.insert(retval.end(), v.begin(), v.end());
+ for (auto& v : _buf) retval.insert(retval.end(), v.begin(), v.end());
_buf.clear();
return retval;
}
@@ -137,6 +130,14 @@ class stream : public io::stream {
uint32_t _ack_limit;
uint32_t _events_received_since_last_ack;
time_t _last_sent_ack;
+ const bool _grpc_serialized;
+
+ /**
+ * @brief when we bypass bbdo serialization, we store object received by grpc
+ * layer in this queue
+ *
+ */
+ std::deque