Code Monkey home page Code Monkey logo

Comments (2)

JasonRivers avatar JasonRivers commented on July 20, 2024 1

Hi,
The error is slightly odd as it references /usr/local/nagios - I'll make some assumptions, please correct me if I'm incorrect.

Your main nagios.cfg on your system is located in /usr/local/nagios/etc/nagios.cfg, But references other files or directories with the full path of /usr/local/nagios/etc/file.cfg - which of course doesn't work in the container because it's expecting the config in /opt/nagios/etc.

There's 2 things you can do here,

  1. you can modify your nagios config to reference the directory in the container (/opt/nagios/etc) - you may not want to do this if you're still on the fence about using the image from what you have currently running.
  2. When starting the container, you can mount /usr/local/nagios inside the container as well as /opt/nagios/etc - this way any references will work unchanged, EG:
docker run -d --name nagios4 \
  -v /usr/local/nagios/etc:/opt/nagios/etc    \
  -v /usr/local/nagios:/usr/local/nagios      \
  -v /usr/local/nagios/var:/opt/nagios/var    \
  -p 80:80 jasonrivers/Nagios

Hope this helps.

If my assumptions are incorrect, please could you show the contents of /usr/lib/nagios and /usr/lib/nagios/etc

from docker-nagios.

aliabas7 avatar aliabas7 commented on July 20, 2024

Well, mounting /usr/local/nagios inside the container made it work like a charm, for a second I thought I'm still looking at my local nagios box lol - Many thanks Jason.

from docker-nagios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.