bug on duration
-
Frédéric GRANAT
- Posts: 445
- Joined: Mon Nov 19, 2012 11:36 am
bug on duration
Hi,
Duration field displays negative values (.jpg attached)
Please help me.
Frederic
Duration field displays negative values (.jpg attached)
Please help me.
Frederic
You do not have the required permissions to view the files attached to this post.
Re: bug on duration
Please show us the full output of these commands -
It is important, that all of these times line up to be the same. Is your database hosted local, or offloaded?
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
Hi,
Here it is :
Here it is :
Code: Select all
[nagios@nagiosxi root]$ grep "date.timezone" /etc/php.ini
; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
date.timezone = America/New_York
You have new mail in /var/spool/mail/root
[nagios@nagiosxi root]$ ls -l /etc/localtime
-rw-r--r--. 1 root root 2945 Dec 1 14:57 /etc/localtime
[nagios@nagiosxi root]$ php -r 'echo date("D M j G:i:s T Y")."\n";'
Thu Dec 15 3:11:28 EST 2016
[nagios@nagiosxi root]$ date
Thu Dec 15 09:11:55 CET 2016
[nagios@nagiosxi root]$ mysql -unagiosxi -pn@gweb -e "SELECT NOW();"
+---------------------+
| NOW() |
+---------------------+
| 2016-12-15 09:12:11 |
+---------------------+
[nagios@nagiosxi root]$
Re: bug on duration
It looks like your timezones are set to EST, and CET, and off quite a bit - you'll want to set all these to be the same timezone, whichever one your prefer. Take a look at this doc for information on how to do so - https://assets.nagios.com/downloads/nag ... 1444063497[nagios@nagiosxi root]$ php -r 'echo date("D M j G:i:s T Y")."\n";'
Thu Dec 15 3:11:28 EST 2016
[nagios@nagiosxi root]$ date
Thu Dec 15 09:11:55 CET 2016
[nagios@nagiosxi root]$ mysql -unagiosxi -pn@gweb -e "SELECT NOW();"
+---------------------+
| NOW() |
+---------------------+
| 2016-12-15 09:12:11 |
+---------------------+
[nagios@nagiosxi root]$
Former Nagios Employee
-
Frédéric GRANAT
- Posts: 445
- Joined: Mon Nov 19, 2012 11:36 am
Re: bug on duration
Hi,
I performed the steps :
1) Setting the System Timezone
2) PHP Timezone
set to Europe/Paris
That solved my problem (negative duration).
Remark : if I perform date I have : Wed Jan 4 11:52:33 CET 2017
Is it a problem to have CET whereas I set Europe in previous steps ?
Rgds,
frederic
I performed the steps :
1) Setting the System Timezone
2) PHP Timezone
set to Europe/Paris
That solved my problem (negative duration).
Remark : if I perform date I have : Wed Jan 4 11:52:33 CET 2017
Is it a problem to have CET whereas I set Europe in previous steps ?
Rgds,
frederic
Re: bug on duration
date should be showing the output of your EU timezone if you changed it, there's a script located at /usr/local/nagiosxi/scripts/change_timezone.sh that should help take care of it.
You can see odd issues if all of the timezones don't match up, as different components may rely on date, where as others rely on php's date/time.
You can see odd issues if all of the timezones don't match up, as different components may rely on date, where as others rely on php's date/time.
Former Nagios Employee
-
Frédéric GRANAT
- Posts: 445
- Joined: Mon Nov 19, 2012 11:36 am
Re: bug on duration
Hi,
Please tell me how to use that script.
Frederic
Please tell me how to use that script.
Frederic
Re: bug on duration
If you want to set your server to the Paris timezone, you would run the command like the example below.
Try that and let us know if the issue is resolved.
Code: Select all
/usr/local/nagiosxi/scripts/change_timezone.sh --zone Europe/ParisBe 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
Hi,
Done, but it still shows CET when running date :
Done, but it still shows CET when running date :
Code: Select all
[root@nagiosxi ~]# /usr/local/nagiosxi/scripts/change_timezone.sh --zone Europe/Paris
Reloading httpd:
Stopping postgresql service: [ OK ]
Starting postgresql service: [ OK ]
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
All timezone configurations updated to "Europe/Paris"
[root@nagiosxi ~]# date
Mon Jan 9 09:56:04 CET 2017
[root@nagiosxi ~]#
Re: bug on duration
The ./etc/localtime file probably did not get changed then. Try these instructions in the link below and that should get the time setup on the server so all of the timezones are the same.
https://assets.nagios.com/downloads/nag ... m_Time.pdf
https://assets.nagios.com/downloads/nag ... m_Time.pdf
Be sure to check out our Knowledgebase for helpful articles and solutions!