I'm running a Nagios Core 3.5.0 on a 64 bit Ubuntu Server 12.0.4 LTS.
- I have an '@horly ntpdate <Portuguese-NTP-IP>' entry on my server's crontab
- I also have a 'use_timezone=Europe/Lisbon' on my nagios.cfg file.
Consequently:
- I always get good values for a shell command 'date'
- my nagios web interface always displays correct date/time.
Yet, when I use the Nagios' Macro $LONGDATETIME$ in my notification commands/scripts, I get a timestamp with local time minus one hour.
I've made a simple php script and placed it under /usr/local/nagios/share:
Code: Select all
<?php
if (date_default_timezone_get()) {
echo 'date_default_timezone_set: ' . date_default_timezone_get() . '<br />';
}
if (ini_get('date.timezone')) {
echo 'date.timezone: ' . ini_get('date.timezone');
}
echo date_default_timezone_get() . ' => ' . date('e') . ' => ' . date('T');
?>
If I was getting Paris Time, I would get a time-stamp with local time plus one hour and not minus one hour as I'm getting.date_default_timezone_set: Europe/Paris
Europe/Paris => Europe/Paris => CEST
Do you understand why this happens (I'm worried about the $LONGDATETIME$, not about the php timezone output)
Furthermore, I've run the command 'dpkg-reconfigure tzdata' and selected (the already predefined value Europe/Lisbon). In the end, it returned:
Could it be that my Nagios' $LONGDATETIME$ is being populated by this UTC hour?Current default time zone: 'Europe/Lisbon'
Local time is now: Thu Aug 14 12:34:32 WEST 2014.
Universal Time is now: Thu Aug 14 11:34:32 UTC 2014.