-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to stop nagios in container #51
Comments
I believe the process would be:
My container name is nagios, but yours may not be so you would need to adapt the commands accordingly. |
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. |
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? |
Ok. Perhaps I’m thinking the complete wrong way.
Inside my original used container which is now active since many months is many data and statistics. How can I move this data to a new container without loosing configuration and so on??
Regards
… Am 31.01.2018 um 20:17 schrieb Jason Rivers ***@***.***>:
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?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
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. |
But now months of data are inside the container. How to get it out? How to use it then in container again?
In the moment I mount an external path to container the container will not start.
Using Docker on a Synology system.
… Am 31.01.2018 um 20:30 schrieb Jason Rivers ***@***.***>:
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.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Since you didn't originally mount the container to a volume to write your data, try using the docker cp utility.
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...
Then my dockerfile looks like
Anytime I need to update or change my nagios config. I take the following steps:
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. |
How Can eject the commadn "service restart nagios in the docker" ? I do change in the configuration file to add a new host. Thanks |
Restart the container. |
... 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. |
How can I stop nagios inside container without automatic stop of complete docker container. I want to replace /opt/nagios with an "old" one with backup data inside...
The text was updated successfully, but these errors were encountered: