FreeBSD
Server :
Nagios
Problem :
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.
Cause :
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.
Solution :
- 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 :
vi /usr/local/etc/nagios/nagios.cfg
- 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.
cd /usr/share/zoneinfo;ls
- Insert time zone values & parameter into Apache's virtual host for CGI module, at the nagios section :
SetEnv TZ "Australia/Brisbane"
E.g.
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
No comments:
Post a Comment