Nagios Timezone

Robert Hajime Lanning lanning at lanning.cc
Sat Jan 6 02:10:49 CET 2007


<quote who="Israel Brewster">
> Yep, that's exactly what I did, which is where I got the idea to use
> America/Anchorage. Which, I might point out IS a valid TZ variable
> according to the page you linked, which you apparently didn't bother
> to read... Sorry, after a response like that, I couldn't resist. At
> any rate, setting the variable doesn't appear to have any effect. Is
> Nagios pulling from the BIOS clock rather than the system clock or
> something? I suppose I could set the BIOS clock to local time, and
> just tell the system clock that I am in the GMT time-zone, but that
> would be downright ugly. I would much prefer to find a nicer
> solution, if one is available. Even if I have to edit the source, I
> can do that, as long as I know where to look. Thanks.

Nagios uses the system time (ie. what time() returns).
That is what is used in the logging and status.  Actually it uses
time_t as returned from time() (see the nagios.log file.)
localtime() is used for plugins when passing the time based
variables.

The CGIs use localtime() to convert the status information from
time_t to localtime formats.  Make sure the CGIs are run with
the correct TZ value.  (ie. start apache after setting the TZ
variable.)  Make sure you export the variable.

-- 
And, did Galoka think the Ulus were too ugly to save?
                                         -Centauri


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list