Nagios's time stamp are incorrect, e.g. the comments section, the log file's time stamp. But the server's date, time & time zone are correct.
Nagios configuration needs to specify the time zone offset, as well as the Apache's CGI module. These both settings make sure that nagios's time is in sync with the server's time.
- Make sure the FreeBSD time zone is correct. Refer to the post "FreeBSD - How to change time zone"
- Change the configuration for Nagios on time zone :
- Find the section "# TIMEZONE OFFSET"
- Insert the below line :
use_timezone=Asia/Kuala_Lumpur*** timezone value can be obtain from /usr/share/zoneinfo, e.g.
- Insert time zone values & parameter into Apache's virtual host for CGI module, at the nagios section :
SetEnv TZ "Australia/Brisbane"
Options ExecCGI AllowOverride None Order allow,deny Allow from all Order deny,allow Deny from all Allow from all SetEnv TZ "Asia/Kuala_Lumpur"
- Finally, restart Nagios & Apache for the above changes to take effect :
/usr/local/etc/rc.d/nagios restart;/usr/local/etc/rc.d/apache22 reload