Comments (10)
I believe the process would be:
- Remove the Nagios service dir:
docker exec nagios rm etc/service/nagios
- Do your work.
- Recreate the symbolic link to start it again:
docker exec nagios ln -s /etc/sv/nagios /etc/service
My container name is nagios, but yours may not be so you would need to adapt the commands accordingly.
from docker-nagios.
This doesn't actually appear to work. Hopefully Jason can enlighten us as I hate having to restart the container every time I change something with the config.
from docker-nagios.
I don't really understand why you would do this? The point of this container is that it's running an up to date Nagios, if you're going to replace Nagios in the container, why not just create a fresh container for the older version?
Replacing files inside a running container is also a bad idea, if the container is updated you'd have to replace the files every time, a better way to do it would be to use a Docker file FROM jasonrivers/nagios - But I still don't understand the point, The image is created with Nagios, if you want an older version of Nagios, personally I would create a fresh container.
Which version of Nagios are you trying to run?
from docker-nagios.
from docker-nagios.
Use docker cp to copy the configs out of the container, you shouldn't store your configs in the container, you should use a volume to store configs in. (using -v when running the container).
If you wish to add extras to the image, you can create a Dockerfile with FROM jasonrivers/nagios and then add in any extra applications you want.
The point of Docker is that you can regenerate the image easily and re-create the container at any time, if you store you configuration inside the container then you lose that ability.
from docker-nagios.
from docker-nagios.
Since you didn't originally mount the container to a volume to write your data, try using the docker cp utility.
$: docker cp --help
Usage: docker cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH
Copy files/folders between a container and the local filesystem
Options:
-a, --archive Archive mode (copy all uid/gid information)
-L, --follow-link Always follow symbol link in SRC_PATH
Docker containers aren't designed to be used in the same way a traditional server would use them. E.g. If you run nagios on the host machine, you might periodically update configs manually and copy out data. To do this same setup on docker, you would keep a copy of your nagios config and build a new container everytime you want to update the container. You could also use a docker volume to mount the directory in the container where data is stored, to somewhere on the localhost, so that could be reused in other containers and easily saved for other use.
As an example, here is what my nagios repo looks like...
/nagios-repo/
----etc/ *where config is stored*
----libexec/ *where plugins are stored*
----Dockerfile
----Readme
----nagios_key.pem *ssh-key*
Then my dockerfile looks like
From jasonrivers/nagios
# Put Config Files in place
COPY ./etc/ /opt/nagios/etc
RUN mkdir -p /home/nagios/.ssh/
COPY ./libexec/ /opt/nagios/libexec/
# Setup Nagios Key Communication
COPY nagios_key.pem /opt/nagios/.ssh/nagios_key.pem
RUN chown nagios:nagios /opt/nagios/.ssh/nagios_key.pem && chmod 700 /opt/nagios/.ssh/nagios_key.pem
CMD [ "/usr/local/bin/start_nagios" ]
Anytime I need to update or change my nagios config. I take the following steps:
- Update config in repo
docker build . -t nagios
docker run -d --name nagios_container -p 0.0.0.0:3000:80 nagios
The only difference is that you are wanting to save data so will need to add a volume that mounts from a dir on your host to somewhere in the container where the data is stored.
from docker-nagios.
How Can eject the commadn "service restart nagios in the docker" ? I do change in the configuration file to add a new host. Thanks
from docker-nagios.
Restart the container.
from docker-nagios.
... or if the UI is running, just click the "Process Info" link near the bottom of the right hand menu (under "System" heading), then click "Restart the Nagios Process" link on the right under the "Process commands" heading.
from docker-nagios.
Related Issues (20)
- Error: Failed to create IO broker set: Cannot allocate memory HOT 6
- Nagios script request : check_apc.pl HOT 1
- Apache2 and NSCA not removing PID on reboot HOT 4
- Unable to get process status HOT 5
- Segmentation fault (core dumped) running nagios HOT 8
- NRPE plugin not installed in the container? HOT 2
- ENVs are not populated using notify_by_xmpp
- Nagios service does not start HOT 1
- HTTPS Options? HOT 2
- wrong data from remote server
- No map shown when using Umlaut in alias HOT 2
- postfix username and password for AWS SES HOT 1
- Not using nsca fills up the docker log file
- Web UI doesnt showup any config data
- Ruby missing from the Dockerfile
- permiussion denied
- Not work the config SMTP to send email
- Performance issues HOT 1
- there's already an NSCA server running (PID 16). Bailing out... HOT 2
- Adding comments does not work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-nagios.