Nous installerons le moteur Centreon-Engine. La préparation de compilation prendra 20 minutes avec cette nouvelle version.
6 Pré Requis
Tout d'abord, Il faudra créer un utilisateur centreon-engine
sudo groupadd -g 6001 centreon-engine
sudo useradd -u 6001 -g centreon-engine -m -r -d /var/lib/centreon-engine -c "Centreon-engine Admin" centreon-engine
L'installation, au préalable, de Centreon Clib est obligatoire.
Il faut aussi installer des paquets supplémentaires.
Il faut aussi installer des paquets supplémentaires.
sudo apt-get install libcgsi-gsoap-dev zlib1g-dev libssl-dev libxerces-c-dev -y
7 Installation
7.1 Compilation
Les sources étant téléchargés avec le binaire clib, installons les librairies C++ nécessaires.
cd ~/centreon-engine/
conan install .. -s compiler.libcxx=libstdc++11 --build=missing
Attention il y a un problème de versioning dans les sources. Si vous n'avez pas modifié comme précédemment le fichier CMakeList.txt, il faut indiquer la version 21.10.1 dans les fichiers CMakeLists.txt de chaque source.
Modifiez la ligne suivante dans le fichier CMakeLists.txt.
il y a
set(CENTREON_ENGINE_PATCH 0)
il faut
set(CENTREON_ENGINE_PATCH 1)
Préparons la compilation.
cmake \
-DWITH_CENTREON_CLIB_INCLUDE_DIR=/usr/include \
-DWITH_CENTREON_CLIB_LIBRARY_DIR=/usr/lib \
-DWITH_PREFIX=/usr \
-DWITH_PREFIX_BIN=/usr/sbin \
-DWITH_PREFIX_CONF_ENGINE=/etc/centreon-engine \
-DWITH_USER_ENGINE=centreon-engine \
-DWITH_GROUP_ENGINE=centreon-engine \
-DWITH_LOGROTATE_SCRIPT=1 \
-DWITH_VAR_DIR=/var/log/centreon-engine \
-DWITH_RW_DIR=/var/lib/centreon-engine/rw \
-DWITH_STARTUP_SCRIPT=systemd \
-DWITH_STARTUP_DIR=/lib/systemd/system \
-DWITH_PKGCONFIG_SCRIPT=1 \
-DWITH_PKGCONFIG_DIR=/usr/lib/pkgconfig \
-DWITH_TESTING=0 .
Extrait du résultat
--
--
-- Configuration Summary
-- ---------------------
--
-- Project
-- - Name Centreon Engine
-- - Version 21.10.1
--
-- System
-- - Name Linux
-- - Version 5.15.32-v8+
-- - Processor aarch64
--
-- Build
-- - Compiler /usr/bin/c++ (GNU)
-- - Extra compilation flags -std=c++14
-- - Build static core library yes
-- - External commands module enabled
-- - Unit tests disabled
-- - pkg-config script enabled
-- - logrotate script enabled
-- - Startup script Systemd script
--
-- Install
-- - Prefix /usr
-- - Binary prefix /usr/sbin
-- - Configuration prefix /etc/centreon-engine
-- - Library prefix /usr/lib/centreon-engine
-- - Include prefix /usr/include/centreon-engine
-- - var directory /var/log/centreon-engine
-- - Log archive directory /var/log/centreon-engine/archives
-- - RW directory /var/lib/centreon-engine/rw
-- - pkg-config directory /usr/lib/pkgconfig
-- - logrotate directory /etc/logrotate.d
-- - Startup directory /lib/systemd/system
-- - User centreon-engine
-- - Group centreon-engine
-- - Package None
--
-- Libraries
-- - clib include directory /usr/include
-- - clib library directory centreon_clib
-- Configuring done
CMake Warning (dev) at CMakeLists.txt:652 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "centreon_clib_shared" of target "centenginestats"
does not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:644 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "centreon_clib_shared" of target "centengine" does
not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:630 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "centreon_clib_shared" of target "cce_core" does not
exist.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at modules/external_commands/CMakeLists.txt:55 (add_dependencies):
Policy CMP0046 is not set: Error on non-existent dependency in
add_dependencies. Run "cmake --help-policy CMP0046" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
The dependency target "centreon_clib_shared" of target "externalcmd" does
not exist.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Generating done
-- Build files have been written to: /home/kermith/centreon-engine
Ensuite compilons cette configuration et installons dans le système de fichiers.
make && sudo make install
Pour vérifier, avant de continuer, le bon fonctionnement de la librairie partagée, saisissez la commande suivante:
centengine -V
[1621200227] [10748] Centreon Engine 21.10.1
[1621200227] [10748]
[1621200227] [10748] Copyright 1999-2009 Ethan Galstad
[1621200227] [10748] Copyright 2009-2010 Nagios Core Development Team and Community Contributors
[1621200227] [10748] Copyright 2011-2021 Centreon
[1621200227] [10748]
[1621200227] [10748] This program is free software: you can redistribute it and/or
[1621200227] [10748] modify it under the terms of the GNU General Public License version 2
[1621200227] [10748] as published by the Free Software Foundation.
[1621200227] [10748]
[1621200227] [10748] Centreon Engine is distributed in the hope that it will be useful,
[1621200227] [10748] but WITHOUT ANY WARRANTY; without even the implied warranty of
[1621200227] [10748] MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
[1621200227] [10748] General Public License for more details.
[1621200227] [10748]
[1621200227] [10748] You should have received a copy of the GNU General Public License
[1621200227] [10748] along with this program. If not, see
[1540917958] [62218] <http://www.gnu.org/licenses/>.
Mettre le service centengine en démarrage automatique. Nous verrons plus loin la création d'un cgroup centreon nécessaire au démarrage du service (paragraphe 9.1)
sudo systemctl enable centengine.service && sudo systemctl daemon-reload
L'installation de Centreon-Engine est terminée, il faut passer à l'installation des plugins.