manios / docker-nagios

Docker image for Nagios Core in Alpine Linux with basic plugins, available for x86, x64 , ARM v6, ARM v7 and ARM64.
https://www.nagios.org/
Other
60 stars 28 forks source link

[DOC] Add documentation to install additional modules on starting nagios #80

Open CRCinAU opened 3 months ago

CRCinAU commented 3 months ago

One of the things that is always lacking is "damn, I wish I had package X, or module Y" etc...

It should be documented that you can add packages on nagios startup via a CMD override.

eg, in a docker-compose.yaml file, we can do something like:

  nagios:
    container_name: nagios
    image: manios/nagios:latest
    command: /plugins/bootstrap_nagios
    restart: unless-stopped
    ... rest of config ...
    volumes:
      - /path/on/host/for/nagios/plugins:/plugins
    ... any other volumes ...

In the /plugins directory, the bootstrap_nagios script will contain something like:

#!/bin/sh
set -eu
apk update
apk add python3 py3-requests mariadb-client perl-socket6 perl-net-dns

/usr/local/bin/start_nagios

This installs the alpine packages I need for some of my custom plugins.

This is generally MUCH simpler than forking / publishing your own docker containers with minor tweaks...