Page 1 of 1

Check_file_age returns wrong date

Posted: Wed Oct 31, 2018 7:42 am
by BrunoLosse1
When using the check_file_age command, it returns the file's wrong time, causing the parameter to not work correctly.
The server timings are all correct, so I think Nagios itself uses a Timezone.

I've tried setting the # TIMEZONE OFFSET section at the nagios.cfg but it doesn't seem to take effect.
I'm at Brazil btw UTC -3.

Re: Check_file_age returns wrong date

Posted: Wed Oct 31, 2018 4:18 pm
by ssax
What version of nsclient++ are you running? You can find the version listed next to it in control panel > programs and features.

I found this:

https://forums.nsclient.org/t/timezone- ... kfile/2194

Re: Check_file_age returns wrong date

Posted: Thu Nov 08, 2018 7:40 am
by BrunoLosse1
ssax wrote:What version of nsclient++ are you running? You can find the version listed next to it in control panel > programs and features.

I found this:

https://forums.nsclient.org/t/timezone- ... kfile/2194
I have the latest version: 0.5.2035

The post you sent is very old, did they not fix it yet?

Re: Check_file_age returns wrong date

Posted: Thu Nov 08, 2018 4:46 pm
by npolovenko
@BrunoLosse1, Looks like they added the support for file dates in local time in 2015:
2015-04-08 Michael Medin
check_files: #139 Added support for showing file dates in local time (not just UTC)
Here are some filter options you can use:
filter
creation_l When file was created (local time)
creation_u When file was created (UTC)
access_l Last access time (local time)
access_u Last access time (UTC)
https://docs.nsclient.org/reference/win ... heck_files