bug on duration

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: bug on duration

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: bug on duration

Post 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();"
Former Nagios Employee
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: bug on duration

Post 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 ~]#
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: bug on duration

Post 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?
Former Nagios Employee
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: bug on duration

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: bug on duration

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: bug on duration

Post by Frédéric GRANAT »

Problem is solved (difference between CET and Europe\Paris was disturbing me, but if you say it's normal)
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: bug on duration

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked