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

[Enhancement] include two optional perl modules in build #70

Open bradyr opened 6 months ago

bradyr commented 6 months ago

Greetings -- I am wondering if it would be possible to include the following additional modules in the base config/build which would allow for out-of-the-box compatibility with additional notification methods (slack, teams):

perl-lwp-protocol-https 
perl-json

With these additional modules installed, one could drop in the "popular" teams and slack notification scripts in the custom plugins directory, reference it and nagios would be able to fire off notifications to those platforms as well as email if the user wants.

thanks for your consideration.

martijnv commented 6 months ago

One way to do this would be to create a Dockerfile with the following contents:

FROM manios/nagios:latest

RUN apk update && apk add perl-json && apk add perl-lwp-protocol-https

And then create your image:

$ docker build -t my/nagios:latest .

And then use that. This works like a charm in my case.

bradyr commented 6 months ago

@martijnv thanks for the advice -- I was also able to test that out using a Dockerfile and build command like that. I'm running my setup in docker compose so I need to figure out the best way to incorporate it into that config so that when i do a compose pull and/or up/down that i get those modules added in.

thanks again.