'Scheduled Downtime' page shows datetime in local time

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

'Scheduled Downtime' page shows datetime in local time

Post by mon-team »

Hello,
the 'Home' --> 'Schedule Downtime' page shows start and end date, for every downtime, in local time instead that in UTC.
It seems to pick up the browser timezone.
Infact, on a PC set in UTC timezone start date and end date are correct but if i open that page with a PC set in local time the start/end date are in local time.

Obviouslly the datetime for the downtime have been set in utc time.

Nagios server is in UTC:
[[email protected] API]# timedatectl
Local time: Mon 2020-06-15 10:31:49 UTC
Universal time: Mon 2020-06-15 10:31:49 UTC
RTC time: Mon 2020-06-15 10:31:49
Time zone: Etc/UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a

as well in the php.ini:
date.timezone = Etc/UTC


Is this a bug?
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: 'Scheduled Downtime' page shows datetime in local time

Post by jbrunkow »

Thankyou for providing the system and PHP time zone, but the time could also be defined in several other places. Can you check that as well? I do not believe that Nagios will ask the browser for what time zone it is in. Navigate to the Admin section using the bar on top > click System Settings under System Config on the left pane > and take a look at what Timezone is set under Timezone Settings on the General tab of the System Settings page. Is that set to UTC as well?

Please refer to the following linked documentation for more details on how to check and set time zones for certain components.
SYSTEM TIME DOCUMENT
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

Re: 'Scheduled Downtime' page shows datetime in local time

Post by mon-team »

Hello,
i've done all checks and everything look fine:

* admin--> system settings: datetime is utc
* php-ini : datetime is UTC
* datetime on the server is UTC, and the server is in synch with an NTP server
* System profile shows also that time is UTC

I checked also the file /etc/localtime which is a symbolic link to the valid file /usr/share/zoneinfo/Etc/UTC.
Our system has also been set in UTC, every check and component shows data in this format.
I'm running a Nagios XI 5.6.1 on a CentOS 7.6.1810.

What other checks could i do?

Regards
Francesco
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: 'Scheduled Downtime' page shows datetime in local time

Post by jbrunkow »

Apparently the Scheduled Downtime feature does actually read the time from the browser. I apologize for doubting your explanation, as it turns out you were right.

You can also run the following commands as root on your machine as an alternative way to check the time zones on your system.

Code: Select all

mysql -h 127.0.0.1 -uroot -pnagiosxi -e 'SELECT NOW(); SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;'
date
ls -l /etc/localtime
php -r 'echo date("D M j G:i:s T Y")."\n";'
grep "date.timezone =" /etc/php.ini
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

Re: 'Scheduled Downtime' page shows datetime in local time

Post by mon-team »

Hello,
no problem, it sounded strange also to me.
Just a question: do you think this can be considered a bug? Or however a behavior to fix?

On my side i expect to see every datetime in UTC, if i set this timezone ( and in effect all datetime on my Nagios installation are aligned, in UTC).

Regards
Francesco
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: 'Scheduled Downtime' page shows datetime in local time

Post by ssax »

Not a bug, the intended functionality is that it will convert the server time into whatever TZ your workstation/browser is using.

The only way around that would be to force a different TZ (UTC in this case) with a browser add-on.

I can submit a feature request on your behalf for this if you'd like? Please keep in mind that the decision to implement the enhancement is at the discretion of our development team.
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: 'Scheduled Downtime' page shows datetime in local time

Post by jbrunkow »

I think that is how it is intended to work, sorry I wasn't aware of that right away.

There is quite possibly a workaround that could force XI to only use that timezone. Have you tried changing the time zone to UTC on the computer you are having issues with? I believe most browsers inherit the time zone from their host. You could also try disabling that cookie in whatever browser you are using...

We could, however, submit a request to our developers that this feature be changed in future releases. Maybe we could add an option to turn it off! :P
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

Re: 'Scheduled Downtime' page shows datetime in local time

Post by mon-team »

Yes,
i've tried, with a browser running on a PC in UTC timezone the datetime in Schedule Downtime are in UTC.

The fact is that all our servers are in UTC, but usually (both admin and simple Nagios users) have their own PC with a different timezone. This page is the only one showing datetime based on the browser timezone.

In my opinion this is a bit confusing, however...i hope that my personal feedback can contribute to the growth and usability of Nagios XI! ;)
Thanks for your support!

Regards,
Francesco
User avatar
jbrunkow
Posts: 441
Joined: Fri Mar 13, 2020 10:45 am

Re: 'Scheduled Downtime' page shows datetime in local time

Post by jbrunkow »

I have just submitted a request for this to be added to a future release. The irony is that it looks like it was made that way by a feature request to begin with!

I will let you know if I hear anything back from them.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked