date.timezone problems, but not in /etc/php.ini

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

date.timezone problems, but not in /etc/php.ini

Post by eloyd »

A customer of ours is in in the process of moving from an old Nagios 2014 server to a new Nagios 5.4 server. Rather than upgrade the old one 29 times, we decided to install a new one and migrate data and scripts. From a Nagios functionality perspective, everything is fine.

However, we're seeing something in the Apache error_log that looks like this (redacted):

Code: Select all

[Thu Jul 13 10:47:35 2017] [error] [client 167.13.14.7] PHP Warning:  strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /usr/local/nagiosxi/html/includes/utilsl.inc.php on line 581, referer: http://al-nyny-nagios1.nybcs.bcs.pvt/nagiosxi/includes/components/xicore/status.php?show=hostdetail&host=Ugw-8908+-+GFX
So I thought "okay, /etc/php.ini must need to be updated for the common date.timezone issue." Except, /etc/php.ini already has date.timezone = America/New_York set, so that's not the problem. And since the PHP obfuscation code is in place in the file listed in the error, I can't get a better look at what's going on.

I'm hoping someone here can tell me what's going on, instead.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: date.timezone problems, but not in /etc/php.ini

Post by lmiltchev »

What is the output of the following two commands?

Code: Select all

date
strings /etc/localtime
This may sound lame, but... have you tried restarting apache or/and the server to see if this is going to fix the issue?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: date.timezone problems, but not in /etc/php.ini

Post by eloyd »

Don't have access to the machine directly, so I'll have to ask the customer to relay the output of those commands.

Yes, Apache was restarted because it was dumping so much to /var/log/httpd/error_log that disk space was filling up. We sent ErrorLog to /dev/null.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: date.timezone problems, but not in /etc/php.ini

Post by lmiltchev »

Sounds good, eloyd! Post the output of those commands whenever you have it, and ask the customer to restart the server (if possible) to see if this is going to fix the issue.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: date.timezone problems, but not in /etc/php.ini

Post by eloyd »

Server was restarted a couple times for other reasons; no effect.

Code: Select all

# date
Fri Jul 14 13:36:37 EDT 2017

Code: Select all

 
strings /etc/localtime
TZif2
6`/~Kp0
`1gg
`3GI
`5'+
pCda`D/vpEDC`E
@`M|kpN
"`O\MpP
`Q</pRu
k`b-
pcgM`d
xpeG/`e
Zpg'
<`|~gp}
`~^Ip
TZif2
/~Kp
Cda`
D/vp
EDC`
M|kp
O\Mp
Q</p
cgM`
eG/`
|~gp
~^Ip
EST5EDT,M3.2.0,M11.1.0
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: date.timezone problems, but not in /etc/php.ini

Post by lmiltchev »

This is very strange issue indeed... Let's run a few more commands, and see the output. I will try to recreate the issue in-house.

Code: Select all

uname -a
cat /etc/*release
grep full /usr/local/nagiosxi/var/xiversion
grep "date.timezone =" /etc/php.ini
cat /etc/sysconfig/clock
ls -l /etc/localtime
rpm -qa | grep tzdata
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: date.timezone problems, but not in /etc/php.ini

Post by eloyd »

Yes. So strange that I have to ask for forum help. :-)

Code: Select all

 
[root@AL-NYNY-NAGIOS1 ~]# uname -a
Linux AL-NYNY-NAGIOS1.nybcs.bcs.pvt 2.6.32-431.23.3.el6.x86_64 #1 SMP Wed Jul 16 06:12:23 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
 
 
[root@AL-NYNY-NAGIOS1 ~]# cat /etc/*release
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Red Hat Enterprise Linux Server release 6.5 (Santiago)
Red Hat Enterprise Linux Server release 6.5 (Santiago)
 
 
[root@AL-NYNY-NAGIOS1 ~]# grep full /usr/local/nagiosxi/var/xiversion
full=5.4.5
 
 
[root@AL-NYNY-NAGIOS1 ~]# grep "date.timezone =" /etc/php.ini
date.timezone = America/New York
 
 
[root@AL-NYNY-NAGIOS1 ~]# cat /etc/sysconfig/clock
# The time zone of the system is defined by the contents of /etc/localtime.
# This file is only for evaluation by system-config-date, do not rely on its
# contents elsewhere.
ZONE="America/New York"
 
 
[root@AL-NYNY-NAGIOS1 ~]# ls -l /etc/localtime
-rw-r--r--. 1 root root 3519 May  4  2010 /etc/localtime
 
 
[root@AL-NYNY-NAGIOS1 ~]# rpm -qa | grep tzdata
tzdata-java-2014e-1.el6.noarch
tzdata-2017b-1.el6.noarch
 
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: date.timezone problems, but not in /etc/php.ini

Post by lmiltchev »

Is this a typo?

Code: Select all

date.timezone = America/New York
It should be:

Code: Select all

date.timezone = America/New_York
Same in /etc/sysconfig/clock...
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: date.timezone problems, but not in /etc/php.ini

Post by eloyd »

And this is why we need more eyes.

Customer made the change, but I won't know until Monday if it fixed it.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: date.timezone problems, but not in /etc/php.ini

Post by lmiltchev »

"More eyes" is always better. :) Let us know if the issue has been resolved.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked