Code Monkey home page Code Monkey logo

Comments (5)

thinkitdata avatar thinkitdata commented on July 20, 2024

Hello, I also ran into this awhile back and while this isn't the most elegant solution it worked well for me.

From w/in your nagios container:
In order to change timezone, remove the /etc/localtime and assign symbolic link to your desired city.

root@08ec913f43f8:/usr/share/zoneinfo# rm /etc/localtime
root@08ec913f43f8:/usr/share/zoneinfo# ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
root@08ec913f43f8:/usr/share/zoneinfo# date
Thu Feb 23 08:57:53 EST 2017

Thanks for the excellent work Jason in making this image.

After noting that you're asking about "Wrong Date" the above may NOT help your situation. Nonetheless, that is something I've had to do.... ;-)

-Greg

from docker-nagios.

JasonRivers avatar JasonRivers commented on July 20, 2024

Thanks for this information @thinkitdata. Sorry for the lack of response @darox Work has been a little hectic.
I'm trying to work out how best to deal with this, IIRC the image currently uses UTC, (I could be wrong), perhaps mounting /etc/localtime from the host system is a good idea, alternatives would be to have an environment variable to set this, but this means that one must know exactly what the file is on disk, which could be an issue.

I think my preference would be mounting /etc/localtime from the host, as assuming the host time is correct, the container will also have the correct time, at the very least, the container will have the same timezone as the host in this case, which is probably the best-case-scenario.

Thanks for the kind words @thinkitdata

@darox Please could you confirm if this is a timezone issue or if it's more than that? it would be useful to run the command "date" on both the docker host, and within the container at roughly the same time (a few seconds either way isn't an issue).

/J

from docker-nagios.

darox avatar darox commented on July 20, 2024

@JasonRiversThanks for responding! I run the date command and the time and date was correct om the host amd docker container.

from docker-nagios.

JasonRivers avatar JasonRivers commented on July 20, 2024

@darox Thanks for this, so the only thing that's wrong is nagios? I may have to look a little deeper in to this, Please could you paste a screenshot of the date command and the nagios page taken roughly at the same time?

from docker-nagios.

panov-andy avatar panov-andy commented on July 20, 2024

The shortest possible way I found to fix timezone issue was Dockerfile like this:

FROM jasonrivers/nagios
ENV TZ=Europe/Berlin
RUN echo "SetEnv TZ $TZ" > /etc/apache2/conf-available/timezone.conf

PassEnv doesn't work for me.
ENV is not required, so it's possible pass Europe/Berlin directly.
Waiting for update :) 👍

Update:
Sorry, I found useful NAGIOS_TIMEZONE in the documentation which solves my problem :)

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.