Skip to content

feat(gorgone): trigger nodesync on RS after config import#3172

Open
vuntz wants to merge 1 commit into
developfrom
MON-194473-gorgone-nodesync-rs
Open

feat(gorgone): trigger nodesync on RS after config import#3172
vuntz wants to merge 1 commit into
developfrom
MON-194473-gorgone-nodesync-rs

Conversation

@vuntz

@vuntz vuntz commented Feb 16, 2026

Copy link
Copy Markdown
Member

Description

When the central Gorgone syncs configuration to a Remote Server (RS) via SENDEXPORTFILE, the RS database gets updated with new poller/server information. However, the RS's Gorgone nodes module is unaware of these changes until its next periodic resync (every 600 seconds by default). This means newly added or removed pollers behind the RS are not discovered promptly.

This PR triggers a CENTREONNODESSYNC action on the RS after the CentreonWorker import completes, so the RS immediately discovers node changes. It uses the same ADDLISTENER + callback pattern as the statistics module.

Fixes MON-194473

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software
  • Updating documentation (missing information, typo...)

Target serie

  • 23.10.x
  • 24.04.x
  • 24.10.x
  • 25.10.x
  • master

How this pull request can be tested ?

  1. Set up a Central + Remote Server (ZMQ or SSH) with at least one poller behind the RS.
  2. Add a new poller behind the RS in the Central UI.
  3. Deploy the configuration to the RS (triggering SENDEXPORTFILE).
  4. Check RS Gorgone logs for the following sequence:
    • [listener] add token '<worker_token>' — listener registered
    • [listener] trigger event '<worker_token>' — CentreonWorker completed
    • [legacycmd] -class- triggering nodesync after import task completion
    • [nodes] action nodesresync proceed / [nodes] Finish resync
  5. Verify the newly added poller appears in the RS's proxy connections without waiting for the 600s periodic resync cycle.

Edge cases to verify:

  • If CentreonWorker fails, nodesync should not be triggered (check GORGONE_ACTION_FINISH_OK guard).
  • If the nodes module is not loaded on the RS, the import and broker reload should still succeed (non-fatal "unknown action" error).

Checklist

  • I have followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have made corresponding changes to the documentation.
  • I have rebased my development branch on the base branch (master, maintenance).

When the central syncs configuration to a Remote Server via
SENDEXPORTFILE, the RS database gets updated but the nodes module
is unaware until its next periodic resync (600s default). This adds
a listener on the CentreonWorker command token so that upon successful
completion, CENTREONNODESSYNC is triggered immediately, allowing the
RS to discover node changes without delay.

Also adds the nodes module to the ZMQ RS example config for
consistency with the SSH RS config.

Ref: MON-194473
@vuntz vuntz requested a review from a team as a code owner February 16, 2026 16:06
@vuntz vuntz requested a review from lucie-tirand February 16, 2026 16:06
@coderabbitai

coderabbitai Bot commented Feb 16, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch MON-194473-gorgone-nodesync-rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

Copy link
Copy Markdown

Logo
Checkmarx One – Scan Summary & Details3190537e-50a5-4f30-8f1b-bfcfc8da69cf

Great job! No new security vulnerabilities introduced in this pull request

@Tpo76

Tpo76 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

🤖 This is an automatic comment generated by an internal tool.

Complexity Classification: Standard

Justification: Automatic classification failed; defaulting to standard.

Metric Value
WIP Points 2
SLA Track Standard SLA (2 work days)
First review SLA 1 work day

A maintainer can override this classification at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants