Bonjour @S.lhotellier
de mon côté j’ai cette infra. Sachant que le Remote est en DMZ et le poller chez le client.
https://docs.centreon.com/fr/assets/images/Architecture_distributed_remote-5b6ea05e654d5ce9ac88f71210a1828f.png
Mais en voyant ce schéma, on pourrait imaginer de doubler les remotes. Car l’échange entre le central et le remote se font via Gorgone et Sql. ça va demander un peux de custo mais tiens mois au courant si tu y arrives.
Bonjour
J’ai envoyé un mail à mes contacts chez Centreon qui m’on confirmé qu’il était possible d’avoir mon central dans mon LAN, un serveur intermédiaire en DMZ et des serveurs avec IHM (remote server) chez mes clients.
Pour ce faire le serveur intermédiaire ne sera pas un remote server mais un serveur constitué de 2 modules seulement :
centreon-gorgoned centreon-broker Pour gorgoned il faut suivre la documentation : https://docs.centreon.com/fr/docs/developer/developer-gorgone-rebound-mode/
Pour centreon-broker il faut le configurer comme un remote server mais en installant uniquement le package centreon-broker (et ses dépendances biensûr)
Je vais tester cette solution et je vous ferais signe si ça marche.
Bonjour à tous
J’y suis presque mais j’ai du me louper quelque part. (voir mon problème tout en bas)
cela se base sur les docs :
https://docs.centreon.com/fr/docs/developer/developer-gorgone-rebound-mode/ (mais sans l’inversion du flux entre le central et le proxy, et c’est ça qui ne marche pas chez moi )
https://docs.centreon.com/fr/docs/developer/developer-gorgone-pull-mode/
https://docs.centreon.com/fr/docs/monitoring/monitoring-servers/advanced-configuration/
Architecture Contraintes Avoir un serveur central sur le LAN Pas de liens directs entre le réseau du client et le LAN Pas de flux descendant sur le LAN ou le réseau du client Avoir la possibilité de mettre un remote serveur chez le client (IHM) Choix technique Mettre un serveur centreon proxy (centreon gorgone + broker) sur une DMZ Mettre gorgone et le broker sur le proxy en mode pull (tous les flux sont dirigé vers le proxy) Schéma d’architecture générale
Configuration
Informations générales Serveur Central :
IP 10.0.0.1
Serveur Proxy :
Id 1024 (identifiant arbitraire suffisant grand pour être unique)
IP : 10.0.1.1
Collecteur ou remote server :
ID : attribué automatiquement ex : 5
IP 10.0.2.1
Collecteur/remote serveur /etc/centreon-gorgone/config.d/40-gorgones.yaml :
name: gorgoned-remote description: Configuration for remote server remote gorgone: gorgonecore: id: 2 privkey: "/var/lib/centreon-gorgone/.keys/rsakey.priv.pem" pubkey: "/var/lib/centreon-gorgone/.keys/rsakey.pub.pem" … modules: … - name: pull package: "gorgone::modules::core::pull:hooks" enable: true target_type: tcp target_path: 10.0.1.1:5556 ping: 1
/etc/centreon-broker/watchdog.json :
{ "centreonBroker": { "cbd": < { "name": "Remote-broker", "configuration_file": "/etc/centreon-broker/remote-broker.json", "run": true, "reload": true }, { "name": "remote-rrd", "configuration_file": "/etc/centreon-broker/remote-rrd.json", "run": true, "reload": true } ], "log": "/var/log/centreon-broker//watchdog.log" }
/etc/centreon-broker/remote-broker.json :
{ "centreonBroker": { "broker_id": 4, "broker_name": "remote-broker", "poller_id": 2, "poller_name": "remote", ... "output": ... { "name": "forward-to-proxy", "port": "5669", "host": "10.0.1.1", "protocol": "bbdo", "tls": "no", "negociation": "yes", "one_peer_retention_mode": "no", "compression": "no", "type": "ipv4", "filters": { "category": > "neb" ] } } ] ...
PROXY package installés : centreon-gorgone, centreon-broker-cbd, et leurs dépendances
/etc/centreon-gorgone/config.d/40-gorgoned.yaml :
name: rebound-server description: Configuration for rebound-server gorgone: gorgonecore: id: 1024 privkey: "/var/lib/centreon-gorgone/.keys/rsakey.priv.pem" pubkey: "/var/lib/centreon-gorgone/.keys/rsakey.pub.pem" external_com_type: tcp external_com_path: "*:5556" authorized_clients: - key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX - key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX modules: - name: proxy package: "gorgone::modules::core::proxy::hooks" enable: true - name: register package: "gorgone::modules::core::register::hooks" enable: true config_file: /etc/centreon-gorgone/nodes-register-override.yml
/etc/centreon-broker/proxy-broker.json :
{ "centreonBroker": { "broker_id": 1024, "broker_name": "proxy", "poller_id": 1024, "poller_name": " PROXY", "module_directory": "/usr/share/centreon/lib/centreon-broker", "log_timestamp": false, "log_thread_id": false, "event_queue_max_size": 100000, "command_file": "", "cache_directory": "/var/lib/centreon-broker", "bbdo_version": "3.0.0", "log": { "directory": "/var/log/centreon-broker", "filename": "", "max_size": 0, "loggers": { "core": "info", "config": "error", "sql": "error", "processing": "error", "perfdata": "error", "bbdo": "error", "tcp": "error", "tls": "error", "lua": "error", "bam": "error" } }, "input": { "name": "proxy-broker-input", "port": "5669", "protocol": "bbdo", "tls": "auto", "negotiation": "yes", "buffering_timeout": "0", "retry_interval": "15", "one_peer_retention_mode": "no", "compression": "auto", "type": "ipv4" } ], "output": d { "name": "forward-to-master", "port": "5671", "protocol": "bbdo", "tls": "no", "negotiation": "yes", "one_peer_retention_mode": "yes", "filters": { "category": "neb" ] }, "compression": "no", "type": "ipv4" } ], "stats": { "type": "stats", "name": "proxy-stats", "json_fifo": "/var/lib/centreon-broker/proxy-stats.json" } ], "grpc": { "port": 51013 } } }
Central /etc/centreon-gorgone/config.d/40-gorgoned.yaml :
... modules: ... - name: register package: "gorgone::modules::core::register::hooks" enable: true config_file: /etc/centreon-gorgone/nodes-register-override.yml ....
/etc/centreon-gorgone/nodes-register-override.yml :
nodes: - id: 1024 type: push_zmq address: 10.0.1.1 port: 5556 prevail: 1 nodes: - id: 2 pathscore: 1
/etc/centreon-broker/central-broker.json :
... "input": ... { "name": "connection-to-proxy", "port": "5671", "host": "10.0.1.1", "protocol": "bbdo", "tls": "no", "negotiation": "yes", "one_peer_retention_mode": "no", "compression": "no", "type": "ipv4" }
Ce qui marche : la liaison BBDO
Mon problème :
Je n’ai pas la mise à jour de la configuration via gorgone :
sur le central :
tail /var/log/centreon-gorgone/gorgoned.log 2023-08-08 16:51:20 - ERROR - proxy] Send message problem for '2': 2023-08-08 16:52:20 - ERROR - >proxy] Send message problem for '2': 2023-08-08 16:53:20 - ERROR - 2proxy] Send message problem for '2':
donc visiblement mon central ne sais pas envoyer la conf à la machine distante via le proxy
Si quelqu’un a une idée sur l’endroit où j’ai eu les gros doigts, je suis preneur.
Cordialement
Bonjour
Je n’ai pas encore de solution à mon problème mais J’ai oublié de vous mettre un fichier dans la conf du proxy
/etc/centreon-gorgone/nodes-register-override.yml :
nodes: - id: 2 type: pull prevail: 1
Donc si quelqu’un sait où je e suis planté, merci d’avance.
Cordialement
Bonjour,
Tu peux déjà vérifier la chaîne de laison sur chaque serveur avec un
ss -plant | grep 5556
Tu peux également passer les logs gorgone en debug (sur les 3 serveurs également) en modifiant le fichier /etc/sysconfig/gorgoned (changer severity “error” par “debug”) et en redémarrant gorgone, cela devrait te donner plus d’infos que tu peux nous partager ici par la suite.
Espérant que cela t’aide
Merci pour ta réponse Thibault
la commande ss ne me donne de résultat que sur le serveur proxy :
LISTEN 0 100 0.0.0.0:5556 0.0.0.0:* users:(("gorgone-proxy",pid=14925,fd=16),("gorgone-proxy",pid=14924,fd=16),("gorgone-proxy",pid=14923,fd=16),("gorgone-proxy",pid=14922,fd=16),("gorgone-proxy",pid=14921,fd=16),("gorgone-dbclean",pid=14920,fd=16),("gorgone-registe",pid=14919,fd=16),("perl",pid=14915,fd=16))
Et voici mes log:
central:
2023-08-10 11:49:06 - DEBUG - 1proxy] choose node target '2' for node '2' 2023-08-10 11:49:06 - DEBUG - 1proxy] Send message: ochannel = control] caction = PING] ltoken = ] =target = 2~~2] data = {}] 2023-08-10 11:49:06 - INFO - proxy] connect for 2 2023-08-10 11:49:06 - DEBUG - 1core] JWK thumbprint = rojqt4Okh5MpgqGdHHmzfuuBioiP0khpd1d2MCUn33g 2023-08-10 11:49:06 - DEBUG - 1clientzmq] gorgone-proxy-1-2 - get_server_pubkey sent s1] 2023-08-10 11:49:16 - ERROR - 1proxy] Send message problem for '2': 2023-08-10 11:49:16 - DEBUG - 1core] Message received - MPUTLOG] e] i] {"etime":1691660956,"token":"","code":1,"instant":null,"data":{"message":"Send message problem for '2': "}} 2023-08-10 11:49:16 - INFO - proxy] periodic close connection for 2 2023-08-10 11:49:16 - DEBUG - 1core] Message received - MPONGRESET] icddbd563e39068d0c78cdbc28f5aaa0e66940a2f3f7e7f66d59ca337a8613a0e34218dc6323395af7b495b546b8065dcc68a44f28dd16ef5e4dc8ac063f21be1] 5] { "data": { "id": 2 } } 2023-08-10 11:49:16 - INFO - proxy] PongReset received from '2'
proxy :
2023-08-10 11:59:45 - DEBUG - core] Message received - PROXYREADY] i] d] {"pool_id":"4"} 2023-08-10 12:00:05 - DEBUG - proxy] skip node pull target '2' for node '2' - never connected 2023-08-10 12:00:05 - DEBUG - proxy] no pathway for target '2' 2023-08-10 12:00:45 - INFO - 0proxy] Ping timeout from '2'
distant :
2023-08-10 12:06:43 - DEBUG - 0audit] sampling starting 2023-08-10 12:07:38 - DEBUG - 0autodiscovery] -class- host discovery - check centreon module installed 2023-08-10 12:07:38 - DEBUG - == Info: Connection 1 seems to be dead! 2023-08-10 12:07:38 - DEBUG - == Info: Closing connection 1 2023-08-10 12:07:38 - DEBUG - == Info: Trying 127.0.0.1... 2023-08-10 12:07:38 - DEBUG - == Info: TCP_NODELAY set 2023-08-10 12:07:38 - DEBUG - == Info: Connected to 127.0.0.1 (127.0.0.1) port 80 (#2) 2023-08-10 12:07:38 - DEBUG - => Send header: GET /centreon/api/latest/platform/versions?limit=10000&page=1 HTTP/1.1 Host: 127.0.0.1 Accept: */* X-AUTH-TOKEN: Ks4+F9jsRZF061vySb6/1bP5oV4o1FRlsdPgDOUDnPK3EePoO9n3/CNHip0cneYB Accept-Type: application/json; charset=utf-8 Content-Type: application/json; charset=utf-8 2023-08-10 12:07:38 - DEBUG - => Recv header: HTTP/1.1 200 OK 2023-08-10 12:07:38 - DEBUG - => Recv header: Date: Thu, 10 Aug 2023 10:07:38 GMT 2023-08-10 12:07:38 - DEBUG - => Recv header: Server: Apache 2023-08-10 12:07:38 - DEBUG - => Recv header: Cache-Control: no-cache, private 2023-08-10 12:07:38 - DEBUG - => Recv header: Api-Version: 23.04 2023-08-10 12:07:38 - DEBUG - => Recv header: Vary: Accept-Encoding 2023-08-10 12:07:38 - DEBUG - => Recv header: X-Frame-Options: sameorigin 2023-08-10 12:07:38 - DEBUG - => Recv header: Transfer-Encoding: chunked 2023-08-10 12:07:38 - DEBUG - => Recv header: Content-Type: application/json 2023-08-10 12:07:38 - DEBUG - => Recv header: 2023-08-10 12:07:38 - DEBUG - => Recv data: 4eb {"web":{"version":"23.04.6","major":"23","minor":"04","fix":"6"},"modules":{"centreon-license-manager":{"version":"23.04.1","major":"23","minor":"04","fix":"1"},"centreon-pp-manager":{"version":"23.04.1","major":"23","minor":"04","fix":"1"}},"widgets":{"Single Metric":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Live Top 10 CPU Usage":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Tactical Overview":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Global Health":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"HTTP Loader":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Hostgroup Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Engine-status":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Grid-map":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Graph Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Servicegroup Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Live Top 10 Memory Usage":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Service Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Host Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"}}} 0 2023-08-10 12:07:38 - DEBUG - == Info: Connection #2 to host 127.0.0.1 left intact
J’ai l’impression que c’est le distant qui ne se connecte pas sur le proxy et donc le central ne sait pas comment envoyer.
Mais je ne trouve pas le pourquoi du comment.
Bonjour
Merci pour ta réponse Thibault
Voici la commande ss ne donne pas de résultat sur les central et distant, par contre voici le résulat sur le proxy :
LISTEN 0 100 0.0.0.0:5556 0.0.0.0:* users:(("gorgone-dbclean",pid=27579,fd=16),("gorgone-proxy",pid=27578,fd=16),("gorgone-proxy",pid=27577,fd=16),("gorgone-proxy",pid=27576,fd=16),("gorgone-proxy",pid=27575,fd=16),("gorgone-proxy",pid=27574,fd=16),("gorgone-registe",pid=27573,fd=16),("perl",pid=27570,fd=16))
pour les log voici ce que cela donne :
central :
2023-08-10 11:49:06 - DEBUG - Dproxy] choose node target '2' for node '2' 2023-08-10 11:49:06 - DEBUG - Dproxy] Send message: echannel = control] oaction = PING] =token = ] ktarget = 2~~2] =data = {}] 2023-08-10 11:49:06 - INFO - proxy] connect for 2 2023-08-10 11:49:06 - DEBUG - Dcore] JWK thumbprint = rojqt4Okh5MpgqGdHHmzfuuBioiP0khpd1d2MCUn33g 2023-08-10 11:49:06 - DEBUG - Dclientzmq] gorgone-proxy-1-2 - get_server_pubkey sent e1] 2023-08-10 11:49:16 - ERROR - Eproxy] Send message problem for '2': 2023-08-10 11:49:16 - DEBUG - Dcore] Message received - ePUTLOG] P] L] {"etime":1691660956,"token":"","code":1,"instant":null,"data":{"message":"Send message problem for '2': "}} 2023-08-10 11:49:16 - INFO - proxy] periodic close connection for 2 2023-08-10 11:49:16 - DEBUG - Dcore] Message received - ePONGRESET] Gcddbd563e39068d0c78cdbc28f5aaa0e66940a2f3f7e7f66d59ca337a8613a0e34218dc6323395af7b495b546b8065dcc68a44f28dd16ef5e4dc8ac063f21be1] f] { "data": { "id": 2 } } 2023-08-10 11:49:16 - INFO - proxy] PongReset received from '2'
proxy :
2023-08-10 11:59:45 - DEBUG - core] Message received - cPROXYREADY] X] E] {"pool_id":"4"} 2023-08-10 12:00:05 - DEBUG - proxy] skip node pull target '2' for node '2' - never connected 2023-08-10 12:00:05 - DEBUG - proxy] no pathway for target '2' 2023-08-10 12:00:45 - INFO - -proxy] Ping timeout from '2'
distant :
2023-08-10 12:06:43 - DEBUG - -audit] sampling starting 2023-08-10 12:07:38 - DEBUG - -autodiscovery] -class- host discovery - check centreon module installed 2023-08-10 12:07:38 - DEBUG - == Info: Connection 1 seems to be dead! 2023-08-10 12:07:38 - DEBUG - == Info: Closing connection 1 2023-08-10 12:07:38 - DEBUG - == Info: Trying 127.0.0.1... 2023-08-10 12:07:38 - DEBUG - == Info: TCP_NODELAY set 2023-08-10 12:07:38 - DEBUG - == Info: Connected to 127.0.0.1 (127.0.0.1) port 80 (#2) 2023-08-10 12:07:38 - DEBUG - => Send header: GET /centreon/api/latest/platform/versions?limit=10000&page=1 HTTP/1.1 Host: 127.0.0.1 Accept: */* X-AUTH-TOKEN: Ks4+F9jsRZF061vySb6/1bP5oV4o1FRlsdPgDOUDnPK3EePoO9n3/CNHip0cneYB Accept-Type: application/json; charset=utf-8 Content-Type: application/json; charset=utf-8 2023-08-10 12:07:38 - DEBUG - => Recv header: HTTP/1.1 200 OK 2023-08-10 12:07:38 - DEBUG - => Recv header: Date: Thu, 10 Aug 2023 10:07:38 GMT 2023-08-10 12:07:38 - DEBUG - => Recv header: Server: Apache 2023-08-10 12:07:38 - DEBUG - => Recv header: Cache-Control: no-cache, private 2023-08-10 12:07:38 - DEBUG - => Recv header: Api-Version: 23.04 2023-08-10 12:07:38 - DEBUG - => Recv header: Vary: Accept-Encoding 2023-08-10 12:07:38 - DEBUG - => Recv header: X-Frame-Options: sameorigin 2023-08-10 12:07:38 - DEBUG - => Recv header: Transfer-Encoding: chunked 2023-08-10 12:07:38 - DEBUG - => Recv header: Content-Type: application/json 2023-08-10 12:07:38 - DEBUG - => Recv header: 2023-08-10 12:07:38 - DEBUG - => Recv data: 4eb {"web":{"version":"23.04.6","major":"23","minor":"04","fix":"6"},"modules":{"centreon-license-manager":{"version":"23.04.1","major":"23","minor":"04","fix":"1"},"centreon-pp-manager":{"version":"23.04.1","major":"23","minor":"04","fix":"1"}},"widgets":{"Single Metric":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Live Top 10 CPU Usage":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Tactical Overview":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Global Health":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"HTTP Loader":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Hostgroup Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Engine-status":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Grid-map":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Graph Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Servicegroup Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Live Top 10 Memory Usage":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Service Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"},"Host Monitoring":{"version":"23.04.0","major":"23","minor":"04","fix":"0"}}} 0 2023-08-10 12:07:38 - DEBUG - == Info: Connection #2 to host 127.0.0.1 left intact
j’ai fait de nc 10.0.1.1 5556 depuis le central et le distant et c’est OK
J’ai l’impression que le distant ne contacte pas le proxy, et que le central ne connaît pas le chemin vers le distant au travers du proxy, mais je ne vois pas pourquoi.
Cordialement
Bonjour à tous
Le problème est résolu
quelques fautes de frappe :
fichier 40-gorge.yaml sur le server distant :
package: "gorgone::modules::core::pull:hooks" → “package: "gorgone::modules::core::pull::hooks"
et une “ qui manquait sur un autre fichier (erreur non présente dans mon post)
En plus de cela il faut installer les librairie perl-JSON-Path perl-JSON perl-JSON-XS perl-JSON-PP sur le proxy.
D’après mes informations, ce sera ajouté prochainement aux prérequis du package centreon-gorgone.
Un grand merci à Thibault, qui a été d’une grande aide.
Cordialement