Comments (5)
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.
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.
@JasonRiversThanks for responding! I run the date command and the time and date was correct om the host amd docker container.
from docker-nagios.
@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.
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)
- 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.