When you have a problem of different times, for example you see a few hours earlier or later in Pandora FMS, it is usually a problem of configuration of the timezone system, but we have synthesized a battery of tests that allows to find out where in the whole Pandora FMS system there may be a time difference.
By running it and displaying the results you can see how to fix it:
- For the system (on the terminal):
date +"%z" date
- For database ( MySQL):
select now(); mysql> SELECT @@global.time_zone, @@session.time_zone;
- For Perl:
perl -e 'my $t = localtime(); print "$t";'
- For PHP:
Write a file called test_timezone.php
at www
for Apache web server ( usually /var/www
) with this:
<?php echo date("Y/m/d H:i:s O e"); ?>
Once the battery of tests has been run and the problem area has been identified, it can be solved:
- For system:
- Debian:
dpkg-reconfigure tzdata
.
- Debian:
- For database (MySQL): In file
/etc/mysql/my.cnf
edit:
[mysqld_safe] timezone =
- For PHP:
- For all system, in file
/etc/php5/apache2/php.ini
change this line:date.timezone =
. - Only for
pandora_console
, in file/include/config.php
add this lineputenv("TZ=");
.
- For all system, in file