Hey guys,
Ever since the 1.2 update (currently running 1.3) I've been having some issues with the time displaying incorrectly and I've mostly managed to work through the issues on my test server but I've still got one last little issue that I don't seem to be able to correct.
From the XI interface, information retrieved from Nagios Core is displaying 11 hours behind (or exactly +0 GMT/UTC) yet everywhere else including the actual Nagios Core interface it's displaying the proper time. Info:
Date
[root@nagios ~]# date
Wed Jan 2 13:56:16 EST 2013
nagios.cfg
use_timezone=Australia/Melbourne
php.ini
date.timezone = Australia/Melbourne
apache nagios.conf
<Directory "/usr/local/nagios/sbin">
SetEnv TZ "Australia/Melbourne"
...
<Directory "/usr/local/nagios/share">
SetEnv TZ "Australia/Melbourne"
...
Nagios Core Screenshot:
Nagios XI Screenshot:
ideas?
Time
Re: Time
jsmurphy,
What date format is defined in nagios.cfg?
date_format=<option>
http://nagios.sourceforge.net/docs/nagioscore-3-en.pdf
What date format is defined in nagios.cfg?
date_format=<option>
http://nagios.sourceforge.net/docs/nagioscore-3-en.pdf
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Time
John,
Does this machine have an offloaded MySQL server?
If so, could the date/timezone be off on the MySQL server?
It would be possible that the dates could be screwed up in XI's view as they are read from dates in the MySQL server..
Does this machine have an offloaded MySQL server?
If so, could the date/timezone be off on the MySQL server?
It would be possible that the dates could be screwed up in XI's view as they are read from dates in the MySQL server..
Re: Time
I have a few questions, do ever notice the time display in the Nagios XI being on 12 hours, instead of 24? As in does it spin up past 12 and hit 13:00 hours? Because maybes its a date formatting issue and its off by an hour.
Also can you verify you're getting the right time when you login to MySQL and try:
mysql> SELECT UNIX_TIMESTAMP('2013-01-03 00:00:00');
Does that give a the *correct* timestamp? It should yield 1357192800.
Also can you verify you're getting the right time when you login to MySQL and try:
mysql> SELECT UNIX_TIMESTAMP('2013-01-03 00:00:00');
Does that give a the *correct* timestamp? It should yield 1357192800.
Nicholas Scott
Former Nagios employee
Former Nagios employee
Re: Time
As far as I've noticed the time is always displayed in 24 hour format in XI.
Running the requested command for the test server mysql I get the following:
mysql> SELECT UNIX_TIMESTAMP("2013-01-03 00:00:00");
+---------------------------------------+
| UNIX_TIMESTAMP("2013-01-03 00:00:00") |
+---------------------------------------+
| 1357171200 |
+---------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT NOW();
+---------------------+
| NOW() |
+---------------------+
| 2013-01-04 00:13:26 |
+---------------------+
1 row in set (0.00 sec)
Right... so MySQL definitely thinks the timezone is UTC, though it's making less and less sense by the minute:
mysql> SELECT @@global.time_zone, @@session.time_zone;
+--------------------+---------------------+
| @@global.time_zone | @@session.time_zone |
+--------------------+---------------------+
| SYSTEM | SYSTEM |
+--------------------+---------------------+
1 row in set (0.00 sec)
[root@nagios ~]# su - mysql
-bash-4.1$ echo $TZ
Australia/Melbourne
Running the requested command for the test server mysql I get the following:
mysql> SELECT UNIX_TIMESTAMP("2013-01-03 00:00:00");
+---------------------------------------+
| UNIX_TIMESTAMP("2013-01-03 00:00:00") |
+---------------------------------------+
| 1357171200 |
+---------------------------------------+
1 row in set (0.00 sec)
mysql> SELECT NOW();
+---------------------+
| NOW() |
+---------------------+
| 2013-01-04 00:13:26 |
+---------------------+
1 row in set (0.00 sec)
Right... so MySQL definitely thinks the timezone is UTC, though it's making less and less sense by the minute:
mysql> SELECT @@global.time_zone, @@session.time_zone;
+--------------------+---------------------+
| @@global.time_zone | @@session.time_zone |
+--------------------+---------------------+
| SYSTEM | SYSTEM |
+--------------------+---------------------+
1 row in set (0.00 sec)
[root@nagios ~]# su - mysql
-bash-4.1$ echo $TZ
Australia/Melbourne
Last edited by jsmurphy on Thu Jan 03, 2013 7:43 pm, edited 1 time in total.
Re: Time
Alright solved...
/etc/sysconfig/clock was set to UTC
. Now I've just got to sort out production as that seems to be a separate issue, but I think now that I know where every possible place to set the date time is it shouldn't be too hard to stamp out.
/etc/sysconfig/clock was set to UTC