Page 2 of 2
Re: bug on duration
Posted: Tue Jan 10, 2017 4:48 am
by Frédéric GRANAT
Hi,
Already done if you take a look at the previous posts :
I performed the steps :
1) Setting the System Timezone
2) PHP Timezone
Re: bug on duration
Posted: Tue Jan 10, 2017 9:30 am
by rkennedy
Please run the 5 commands again so we can see what everything is currently set to -
Code: Select all
grep "date.timezone" /etc/php.ini
ls -l /etc/localtime
php -r 'echo date("D M j G:i:s T Y")."\n";'
date
mysql -unagiosxi -pn@gweb -e "SELECT NOW();"
Re: bug on duration
Posted: Fri Jan 20, 2017 3:51 am
by Frédéric GRANAT
Hi,
I performed the last step : "Syncing the system clock with NTP" of Changing_The_XI_System_Time.pdf
That doesn' solve my problem :
Code: Select all
[root@nagiosxi ~]# grep "date.timezone" /etc/php.ini
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = Europe/Paris
[root@nagiosxi ~]# ls -l /etc/localtime
lrwxrwxrwx 1 root root 32 Jan 9 09:55 /etc/localtime -> /usr/share/zoneinfo/Europe/Paris
[root@nagiosxi ~]# php -r 'echo date("D M j G:i:s T Y")."\n";'
Fri Jan 20 9:50:46 CET 2017
[root@nagiosxi ~]# date
Fri Jan 20 09:50:51 CET 2017
[root@nagiosxi ~]# mysql -unagiosxi -pn@gweb -e "SELECT NOW();"
+---------------------+
| NOW() |
+---------------------+
| 2017-01-20 09:50:57 |
+---------------------+
[root@nagiosxi ~]#
Re: bug on duration
Posted: Fri Jan 20, 2017 11:45 am
by rkennedy
Got it - everything is lining up at this point. I would like to take a step back to a question I made earlier -
Is your database hosted local, or offloaded?
You may need to restart nagios / ndo2db / mysql / httpd after adjusting the time all around, as they may be holding pre-cached timezones. Are you still experiencing the issue after doing so?
Re: bug on duration
Posted: Mon Jan 23, 2017 6:15 am
by Frédéric GRANAT
Hi,
Code: Select all
[root@nagiosxi ~]# service ndo2db restart
Stopping ndo2db: done.
Starting ndo2db: done.
[root@nagiosxi ~]# service mysqld restart
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
[root@nagiosxi ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using nagiosxi.cg.ahp for ServerName
[ OK ]
[root@nagiosxi ~]# date
Mon Jan 23 12:13:53 CET 2017
[root@nagiosxi ~]#
As you can see date always displays CET whereas I set Timezone=Europe/Paris
Re: bug on duration
Posted: Mon Jan 23, 2017 1:53 pm
by tgriep
France is in the CET timezone so that should be OK.
Is the issue for the negative times for the duration fixed now?
Re: bug on duration
Posted: Tue Jan 24, 2017 8:52 am
by Frédéric GRANAT
Problem is solved (difference between CET and Europe\Paris was disturbing me, but if you say it's normal)
Re: bug on duration
Posted: Tue Jan 24, 2017 9:47 am
by tgriep
Glad that it is working now. I will mark this post as solved and lock it up but if you have a new issue, please open a new post.