Nagios time zone

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
brom
Posts: 5
Joined: Wed May 22, 2013 6:24 am

Nagios time zone

Post by brom »

Hi,

I need to use custom time zone inside nagios. I have configured "use_timezone" to use right value but notifications are still with system wide time zone. It seems that macros like $LONGDATETIME$ ignore "use_timezone".
Whether there some solution?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios time zone

Post by abrist »

Is changing it system wide not possible in your environment?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
brom
Posts: 5
Joined: Wed May 22, 2013 6:24 am

Re: Nagios time zone

Post by brom »

This will be a last measure. It will be better to solve this by nagios engine, if this possible of course.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios time zone

Post by abrist »

I presume you have restarted nagios since the use_timezone directive change?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
brom
Posts: 5
Joined: Wed May 22, 2013 6:24 am

Re: Nagios time zone

Post by brom »

Sure.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nagios time zone

Post by sreinhardt »

Have you also altered the apache configs to reflect the same timezone?

Code: Select all

<Directory>
...
SetEnv TZ "[Timezone]"
...
</Directory>
An apache restart will also be needed for this to take effect.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
brom
Posts: 5
Joined: Wed May 22, 2013 6:24 am

Re: Nagios time zone

Post by brom »

Both things webserver + "use_timezone" were configured from the outset.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Nagios time zone

Post by sreinhardt »

OK so we have both the nagios and apache timezones specifically set to the timezone that you would like, however the system time zone is not the same as either. Because of this you are finding that $LONGDATETIME$ doesn't correctly display the time, as it is referencing the local system time? Just to 100% verify, when you are getting the bad time, it is based of system not some arbitrary other time zone?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
brom
Posts: 5
Joined: Wed May 22, 2013 6:24 am

Re: Nagios time zone

Post by brom »

Hello,
right, $LONGDATETIME$ based on system time zone, in the same time I see correct time zone inside nagios admin area. I mean time zone based on nagios and apache timezones.
I have changed system time zone now, but will be perfect if some solution in the nagios engine is present.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Nagios time zone

Post by abrist »

You may want to open a feature request/ bug report on http://tracker.nagios.org
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked