Time

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Time

Post by jsmurphy »

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_time1.png
Nagios XI Screenshot:
nagios_time1.png
ideas?
You do not have the required permissions to view the files attached to this post.
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

Re: Time

Post by yancy »

jsmurphy,

What date format is defined in nagios.cfg?

date_format=<option>
http://nagios.sourceforge.net/docs/nagioscore-3-en.pdf
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Time

Post by jsmurphy »

Hey Yancy,

date_format=euro

The date is fine, the time is the problem

Cheers,
John
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Time

Post by scottwilkerson »

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..
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Time

Post by jsmurphy »

It does have an offloaded SQL server but the time there is set correctly:

nagiossql:/home # date
Fri Jan 4 08:29:53 EST 2013
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Time

Post by nscott »

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.
Nicholas Scott
Former Nagios employee
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Time

Post by jsmurphy »

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
Last edited by jsmurphy on Thu Jan 03, 2013 7:43 pm, edited 1 time in total.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Time

Post by jsmurphy »

Alright solved...

/etc/sysconfig/clock was set to UTC :roll:. 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.
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Time

Post by nscott »

Awesome, as soon as you find another place to set the time, the core committers will find a new place to make you set it. ;) Thanks for sharing the results js.
Nicholas Scott
Former Nagios employee
Locked