Check_file_age returns wrong date

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
BrunoLosse1
Posts: 40
Joined: Tue Oct 23, 2018 1:22 pm

Check_file_age returns wrong date

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_file_age returns wrong date

Post 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
BrunoLosse1
Posts: 40
Joined: Tue Oct 23, 2018 1:22 pm

Re: Check_file_age returns wrong date

Post 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?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Check_file_age returns wrong date

Post 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
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked