Skip to content

feat(docker): support custom plugins and dependencies in centreon-engine container#3486

Open
Tpo76 wants to merge 3 commits into
developfrom
MON-201883-feat-docker-support-custom-plugins-and-dependencies-in-centreon-engine-container
Open

feat(docker): support custom plugins and dependencies in centreon-engine container#3486
Tpo76 wants to merge 3 commits into
developfrom
MON-201883-feat-docker-support-custom-plugins-and-dependencies-in-centreon-engine-container

Conversation

@Tpo76

@Tpo76 Tpo76 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

MON-201883

Adds two mechanisms to let users extend the centreon-engine container with their own plugins and dependencies, without modifying the base image.

Changes

Custom scripts — volume mount point

A dedicated directory /usr/lib/nagios/plugins/custom/ is created and owned by centreon-engine in the Dockerfile. Users mount their scripts there via docker-compose:

volumes:
  - ./my-plugins:/usr/lib/nagios/plugins/custom:ro

Scripts must be executable (chmod +x).

Runtime APT dependencies — custom-deps.json

New entrypoint script 41-custom-deps.sh (runs after 40-engine.sh) reads /etc/centreon-engine/custom-deps.json at startup and installs the listed APT packages:

{
  "apt": ["snmp", "python3-requests", "libnet-snmp-perl"]
}

Package names are validated against Debian naming rules in check_custom_deps.py before being passed to apt-get.

Hot-reload is handled by 46-custom-deps-watcher_background.sh: same inotify pattern as the existing 45-plugin-watcher_background.sh, re-installs whenever custom-deps.json changes.

Mount in docker-compose:

volumes:
  - ./custom-deps.json:/etc/centreon-engine/custom-deps.json:ro

No sudoers changes required — apt/apt-get are already allowed.

Custom image build

For pip3/cpan/compiled dependencies, users extend the published image:

FROM centreon/centreon-engine:24.10
USER root
RUN apt-get update && apt-get install -y --no-install-recommends \
    python3-boto3 libnet-snmp-perl && \
    rm -rf /var/lib/apt/lists/*
USER centreon-engine

Test plan

  • Build with existing .deb mount → unchanged behaviour
  • Mount a script directory → verify centreon-engine can call /usr/lib/nagios/plugins/custom/my-script.sh
  • Mount custom-deps.json with "apt": ["snmp"]dpkg -l snmp shows installed after startup
  • Modify custom-deps.json while container is running → package installs without restart
  • Invalid package name in custom-deps.json → skipped with warning, valid packages still installed

🤖 Generated with Claude Code

…ainer

- Add /usr/lib/nagios/plugins/custom/ mount point for user scripts
- Add 41-custom-deps.sh: installs APT packages from custom-deps.json at startup
- Add 46-custom-deps-watcher_background.sh: hot-reloads custom-deps.json via inotify
- Add check_custom_deps.py: validates and parses the apt package list
@coderabbitai

coderabbitai Bot commented Jun 26, 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.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 028cbb0e-976b-467a-8b35-c5c6a21336f6

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
  • Commit unit tests in branch MON-201883-feat-docker-support-custom-plugins-and-dependencies-in-centreon-engine-container

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.

@Tpo76 Tpo76 added the build-docker-collect Trigger dockerize engine/broker images label Jun 26, 2026
@Tpo76 Tpo76 marked this pull request as ready for review June 26, 2026 14:27
@Tpo76 Tpo76 requested a review from a team as a code owner June 26, 2026 14:27
@Tpo76 Tpo76 requested review from kduret and tuntoja and removed request for a team June 26, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build-docker-collect Trigger dockerize engine/broker images skip-workflow-collect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant