Unverified Commit 985c8ba2 authored by sc979's avatar sc979 Committed by GitHub
Browse files

enh(core): replace centcore with gorgoned (#8414)



* enh(core): generate centreon gorgone configuration file (#8160)

* enh(core): add gorgone configuration file generation

* fix: folder paths

* fix(core): naming of file and field type

* enh(core): update configuration file to take in account last modif

* fix(core): correct path to private key

* enh(core): add nodes module

* enh(core): store stats in cache dir

* enh(core): enable broker stats collection

* enh(poller) Update poller form to manage gorgone (#8184)

* enh(gorgone) Update config form to manage gorgone options  (#8197)

* enh(chore) replace centcore by gorgone (#8172)

* remove centcore perl script (#8209)

* fix(UI): do not display gorgone options on central's form (#8206)

* fix(UI): do not display gorgone options on central

* remove duplicated code (#8215)

* enh(admin): adapt broker stats page to new folder tree (#8216)

* enh(core): update script to manage gorgone configuration file (#8229)

* enh: exception management

* enh(update): generate gorgone conf file on update

* fix(translation): avoid empty gettext translation

* enh(core): Add a yaml configuration loader (#8270)

* MON-4737 enh(core): split gorgone configuration in different files (#8276)

* enh(core): adapt upgrade script to latest modifications (#8284)

* adapt update script

* enh: add more check brefore trying to create the conf files

* fix: correct path in the template

* enh(core): update gorgone configuration files (#8293)

* update configuration location

* enh(gorgone): Added API to communicate with the Gorgone server (#8294)

* enh(install): fix default keys pathes (#8302)

* fix db name configuration template

* replace remote data folder

* fix rest api test

* enh(UI): Add nowrap style to badge class - from aladdinchan (#8314)

* fix(ui): Add hash:8 suffix to font files to avoid asset conflicts and optimize Webpack config (#8305)

* Mon 4640 remove deprecated engine fields (#8233)

* fix(CI): add new tests to clapi diff

* fix(core): source install (#8396)

* enh(core): add gorgone user and copy ssh keys

* fix(api): fix options retrieval issue (#8412)

* fix(core): manage the gorgone configuration files (#8400)

* fix(core): duplicate SSH key on source upgrade (#8421)
Co-authored-by: default avatarloiclau <loic.lau@gmail.com>
Co-authored-by: default avatarColin Gagnaire <cgagnaire@centreon.com>
Co-authored-by: default avatarLaurent Calvet <lcalvet@centreon.com>
Co-authored-by: default avatarBruno d'Auria <bdauria@centreon.com>
Co-authored-by: default avatarMatthieu Kermagoret <mkermagoret@centreon.com>
Co-authored-by: default avatarLaurent Pinsivy <lpinsivy@centreon.com>
Co-authored-by: default avatarKevin Duret <duret.kevin@gmail.com>
Co-authored-by: default avatarLaurent Calvet <laurent@callapa.com>
Co-authored-by: default avatarKevin Duret <kduret@centreon.com>
parent cc536dfe
......@@ -279,19 +279,7 @@ POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
Copyright (C) 2008-2020 CENTREON - contact@centreon.com
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -307,34 +295,3 @@ the "copyright" line and a pointer to where the full notice is found.
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
#!/usr/bin/perl
################################################################################
# Copyright 2005-2015 Centreon
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
# GPL Licence 2.0.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation ; either version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, see <http://www.gnu.org/licenses>.
#
# Linking this program statically or dynamically with other modules is making a
# combined work based on this program. Thus, the terms and conditions of the GNU
# General Public License cover the whole combination.
#
# As a special exception, the copyright holders of this program give Centreon
# permission to link this program with independent modules to produce an executable,
# regardless of the license terms of these independent modules, and to copy and
# distribute the resulting executable under terms of Centreon choice, provided that
# Centreon also meet, for each linked independent module, the terms and conditions
# of the license of that module. An independent module is a module which is not
# derived from this program. If you modify this program, you may extend this
# exception to your version of the program, but you are not obliged to do so. If you
# do not wish to do so, delete this exception statement from your version.
#
####################################################################################
use warnings;
use centreon::script::centcore;
centreon::script::centcore->new()->run();
__END__
=head1 NAME
centcore - a daemon to manage pollers.
=head1 SYNOPSIS
centcore [options]
=head1 OPTIONS
=over 8
=item B<--config>
Specify the path to the main configuration file (default: /etc/centreon/conf.pm).
=item B<--help>
Print a brief help message and exits.
=back
=head1 DESCRIPTION
B<centcore> manage pollers: push configurations, send commands, get perfdata/logs (if ndoutils).
=cut
......@@ -62,7 +62,8 @@
"symfony/expression-language": "4.4.*",
"ext-json": "*",
"justinrainbow/json-schema": "^5.2",
"ext-openssl": "*"
"ext-openssl": "*",
"symfony/http-client": "4.4.*"
},
"autoload": {
"psr-4": {
......
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "974738fcc53912bf96c3cdb71a260284",
"content-hash": "894e514772bfd5100e007255225c60dd",
"packages": [
{
"name": "curl/curl",
......@@ -2584,6 +2584,131 @@
"homepage": "https://symfony.com",
"time": "2020-02-28T13:15:16+00:00"
},
{
"name": "symfony/http-client",
"version": "v4.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-client.git",
"reference": "65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-client/zipball/65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2",
"reference": "65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"psr/log": "^1.0",
"symfony/http-client-contracts": "^1.1.8|^2",
"symfony/polyfill-php73": "^1.11",
"symfony/service-contracts": "^1.0|^2"
},
"provide": {
"php-http/async-client-implementation": "*",
"php-http/client-implementation": "*",
"psr/http-client-implementation": "1.0",
"symfony/http-client-implementation": "1.1"
},
"require-dev": {
"guzzlehttp/promises": "^1.3.1",
"nyholm/psr7": "^1.0",
"php-http/httplug": "^1.0|^2.0",
"psr/http-client": "^1.0",
"symfony/dependency-injection": "^4.3|^5.0",
"symfony/http-kernel": "^4.4",
"symfony/process": "^4.2|^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\HttpClient\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony HttpClient component",
"homepage": "https://symfony.com",
"time": "2020-02-25T13:55:11+00:00"
},
{
"name": "symfony/http-client-contracts",
"version": "v1.1.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-client-contracts.git",
"reference": "088bae75cfa2ec5eb6d33dce17dbd8613150ce6e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/088bae75cfa2ec5eb6d33dce17dbd8613150ce6e",
"reference": "088bae75cfa2ec5eb6d33dce17dbd8613150ce6e",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"suggest": {
"symfony/http-client-implementation": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\HttpClient\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Generic abstractions related to HTTP clients",
"homepage": "https://symfony.com",
"keywords": [
"abstractions",
"contracts",
"decoupling",
"interfaces",
"interoperability",
"standards"
],
"time": "2019-11-07T12:44:51+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v4.4.5",
......@@ -4693,17 +4818,17 @@
"source": {
"type": "git",
"url": "https://github.com/minkphp/Mink.git",
"reference": "ccef1987654e9c2fd0600ce68711ac668ad330eb"
"reference": "07c6a9fe3fa98c2de074b25d9ed26c22904e3887"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/minkphp/Mink/zipball/ccef1987654e9c2fd0600ce68711ac668ad330eb",
"reference": "ccef1987654e9c2fd0600ce68711ac668ad330eb",
"url": "https://api.github.com/repos/minkphp/Mink/zipball/07c6a9fe3fa98c2de074b25d9ed26c22904e3887",
"reference": "07c6a9fe3fa98c2de074b25d9ed26c22904e3887",
"shasum": ""
},
"require": {
"php": ">=5.3.1",
"symfony/css-selector": "^2.7|^3.0|^4.0"
"symfony/css-selector": "^2.7|^3.0|^4.0|^5.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20",
......@@ -4720,7 +4845,7 @@
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.7.x-dev"
"dev-master": "1.8.x-dev"
}
},
"autoload": {
......@@ -4746,7 +4871,7 @@
"testing",
"web"
],
"time": "2020-03-10T12:33:27+00:00"
"time": "2020-03-11T15:45:53+00:00"
},
{
"name": "behat/mink-extension",
......@@ -4809,30 +4934,30 @@
},
{
"name": "behat/mink-selenium2-driver",
"version": "v1.3.1",
"version": "v1.4.0",
"source": {
"type": "git",
"url": "https://github.com/minkphp/MinkSelenium2Driver.git",
"reference": "473a9f3ebe0c134ee1e623ce8a9c852832020288"
"reference": "312a967dd527f28980cce40850339cd5316da092"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/473a9f3ebe0c134ee1e623ce8a9c852832020288",
"reference": "473a9f3ebe0c134ee1e623ce8a9c852832020288",
"url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/312a967dd527f28980cce40850339cd5316da092",
"reference": "312a967dd527f28980cce40850339cd5316da092",
"shasum": ""
},
"require": {
"behat/mink": "~1.7@dev",
"instaclick/php-webdriver": "~1.1",
"php": ">=5.3.1"
"php": ">=5.4"
},
"require-dev": {
"symfony/phpunit-bridge": "~2.7"
"mink/driver-testsuite": "dev-master"
},
"type": "mink-driver",
"extra": {
"branch-alias": {
"dev-master": "1.3.x-dev"
"dev-master": "1.4.x-dev"
}
},
"autoload": {
......@@ -4845,15 +4970,15 @@
"MIT"
],
"authors": [
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
},
{
"name": "Pete Otaqui",
"email": "pete@otaqui.com",
"homepage": "https://github.com/pete-otaqui"
},
{
"name": "Konstantin Kudryashov",
"email": "ever.zet@gmail.com",
"homepage": "http://everzet.com"
}
],
"description": "Selenium2 (WebDriver) driver for Mink framework",
......@@ -4866,7 +4991,7 @@
"testing",
"webdriver"
],
"time": "2016-03-05T09:10:18+00:00"
"time": "2020-03-11T14:43:21+00:00"
},
{
"name": "behat/transliterator",
......@@ -6784,131 +6909,6 @@
"homepage": "https://symfony.com",
"time": "2020-02-04T09:01:01+00:00"
},
{
"name": "symfony/http-client",
"version": "v4.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-client.git",
"reference": "65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-client/zipball/65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2",
"reference": "65ccb6ca4a5a7bf7c244b8a28195fa188521b3d2",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"psr/log": "^1.0",
"symfony/http-client-contracts": "^1.1.8|^2",
"symfony/polyfill-php73": "^1.11",
"symfony/service-contracts": "^1.0|^2"
},
"provide": {
"php-http/async-client-implementation": "*",
"php-http/client-implementation": "*",
"psr/http-client-implementation": "1.0",
"symfony/http-client-implementation": "1.1"
},
"require-dev": {
"guzzlehttp/promises": "^1.3.1",
"nyholm/psr7": "^1.0",
"php-http/httplug": "^1.0|^2.0",
"psr/http-client": "^1.0",
"symfony/dependency-injection": "^4.3|^5.0",
"symfony/http-kernel": "^4.4",
"symfony/process": "^4.2|^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "4.4-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\HttpClient\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony HttpClient component",
"homepage": "https://symfony.com",
"time": "2020-02-25T13:55:11+00:00"
},
{
"name": "symfony/http-client-contracts",
"version": "v1.1.8",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-client-contracts.git",
"reference": "088bae75cfa2ec5eb6d33dce17dbd8613150ce6e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/088bae75cfa2ec5eb6d33dce17dbd8613150ce6e",
"reference": "088bae75cfa2ec5eb6d33dce17dbd8613150ce6e",
"shasum": ""
},
"require": {
"php": "^7.1.3"
},
"suggest": {
"symfony/http-client-implementation": ""
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Contracts\\HttpClient\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Generic abstractions related to HTTP clients",
"homepage": "https://symfony.com",
"keywords": [
"abstractions",
"contracts",
"decoupling",
"interfaces",
"interoperability",
"standards"
],
"time": "2019-11-07T12:44:51+00:00"
},
{
"name": "symfony/phpunit-bridge",
"version": "v4.4.5",
......
......@@ -124,6 +124,11 @@ services:
Centreon\Domain\Proxy\Interfaces\ProxyRepositoryInterface:
class: Centreon\Infrastructure\Proxy\ProxyRepositoryRDB
Centreon\Domain\Gorgone\Interfaces\GorgoneServiceInterface:
class: Centreon\Domain\Gorgone\GorgoneService
public: true
# Monitoring resources
Centreon\Domain\Monitoring\Interfaces\ResourceServiceInterface:
class: Centreon\Domain\Monitoring\ResourceService
......@@ -139,4 +144,4 @@ services:
class: Centreon\Infrastructure\Monitoring\TimelineRepositoryRDB
calls:
- method: setSqlRequestTranslator
arguments: ['@sqlRequestTranslator']
\ No newline at end of file
arguments: ['@sqlRequestTranslator']
<?php
/*
* Copyright 2005 - 2019 Centreon (https://www.centreon.com/)
*
......@@ -41,7 +42,7 @@ $_SERVER += $_ENV;
$_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev';
$_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV'];
$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] =
(int) $_SERVER['APP_DEBUG']
(int)$_SERVER['APP_DEBUG']
|| filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0';
if (!isset($GLOBALS['constants']) && !isset($GLOBALS['conf_centreon'])) {
......
<?php
/*
* Copyright 2005 - 2019 Centreon (https://www.centreon.com/)
*
......
<?php
/*
* Copyright 2005 - 2019 Centreon (https://www.centreon.com/)
*
* 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
*
*/
// Url where the stats are sent.
const CENTREON_STATS_URL = 'https://statistics.centreon.com';
......@@ -2006,10 +2006,14 @@ components:
type: boolean
description: "Indicates whether it's the default server"
example: true
ssh_port:
gorgone_communication_type:
type: integer
description: "SSH port of the server"
example: 22
description: "Communication type used by Gorgone to communicate with the server"
example: 1
gorgone_port:
type: integer
description: "Port used by Gorgone to communicate with the server"
example: 5556
last_restart:
type: string
format: date-time
......@@ -2070,7 +2074,7 @@ components:
type: integer
description: "ID of the master Remote Server linked to the server"
example: null
remote_server_centcore_ssh_proxy:
remote_server_use_as_proxy:
type: boolean
description: "Indicates whether Remote Servers are used as SSH proxies"
example: true
......
......@@ -105,8 +105,8 @@ This part can be used set the operation of the CentCore process.
:align: center
* **Enable Broker Statistics Collection** field enables the retrieval of statistics from the Centreon Broker by CentCore. This can be a blocking option because the reading of the pipe can be a blocking action
* **Timeout value for Centcore commands** field can be used to define a timeout for local commands and commands via SSH process.
* **Illegal characters for Centcore commands** field allows to define characters which will be removed from commands forwarded by the process..
* **Timeout value for Gorgone commands** field can be used to define a timeout for local commands and commands via SSH process.
* **Illegal characters for Gorgone commands** field allows to define characters which will be removed from commands forwarded by the process..
.. _ldapconfiguration:
......@@ -252,5 +252,5 @@ This part can be used to configure the enabling of the logging of activity on Ce
* **RRDTool debug** box enables logging of the RRDTool graph engine debugging
* **LDAP User Import debug** box enables logging of debugging of the import of LDAP users
* **SQL debug** box enables the logging of SQL requests executed by the Centreon interface
* **Centcore Engine debug** box enables logging of Centcore process debugging
* **Centreon Gorgone debug** box enables logging of Gorgone process debugging
* **Centreontrapd debug** box enables logging of the Centreontrapd process debugging
......@@ -25,7 +25,7 @@ Once the installation is complete, you must integrate this remote poller into th
.. note::
If your poller is attached to a Remote Server, but you prefer to send externals commands and configuration
directly from the Central server to this poller, please disable the **Use the Remote Server as a proxy for SSH**
directly from the Central server to this poller, please disable the **Use the Remote Server as a proxy**
option.
#. Go to the **Configuration > Pollers > Engine configuration** menu.
......
......@@ -13,8 +13,8 @@ Show
In order to list available instances, use the **SHOW** action::
[root@centreon ~]# ./centreon -u admin -p centreon -o INSTANCE -a show