Page 1 of 1

File Age Checks with NSClient++

Posted: Tue May 08, 2018 10:15 am
by bchabotdg
I'm not sure if this is the best place, but I figure I'd ask.

Using Nagios XI to monitor a directory on a Windows Server. It should be critical for 0 files are younger than 24 hours.

nsclient.ini has this entry:
alias_file_age = check_files path=c:\path\to\folder\ pattern=* filter=age<86400

This returns a nice, text answer. When there are files present, Nagios is OK. BUT... with 0 files, it does not go to Critical. It goes to Unknown.

I've tried adding filter=crit_count<1 and crit=0 to no avail.

Also, Nagios shows no performance data to graph. This is vital. We need to know at least up/down state and preferably the number of files.

Any ideas?

Thanks in advance.

Re: File Age Checks with NSClient++

Posted: Tue May 08, 2018 11:46 am
by lmiltchev
You could try using this plugin: https://www.itefix.net/check_winfile. I used it successfully in the past with NSClient++ and NCPA. It returns perfdata too.

Let us know if you get stuck on something or if you need help with setting up your command.

Thank you!