Page 1 of 1

Folder Watch Wizard

Posted: Tue Jun 13, 2023 11:16 am
by vornado
Using the 'Folder Watch' wizard, I created a service to check the size of /home/nagios/procmail.log on our Nagios development server (localhost). After testing, I created the same service on our production server using the same command, but the one on production is giving me an error:

COMMAND

Code: Select all

check_file_size_age!-C 'ls -l /home/nagios/procmail.log' -F '/home/nagios/procmail.log' -T 'files'! -s 40960000,46080000
ERROR

You must specify files to check on with '-F'

Usage: /usr/local/nagios/libexec/folder_watch.pl [-v] [-t <timeout>] -D <directory> -F <files to check> -w <warn level(s)> -c <crit level(s)> [-a [<warn age>,<crit age>]] [-s [<warn size>,<crit size>]] [-S [<warn size>,<crit size>]] [-f] [-r] [-l] [-T files



The exact same command works fine on our development server. Both servers running CentOS Linux release 7.9.2009 (Core) and Nagios 5.10.0.

This command, which is similar to what Nagios is trying to run, works at the command line of both servers:

Code: Select all

/usr/local/nagios/libexec/folder_watch.pl -C 'ls -l /home/nagios/procmail.log' -F '/home/nagios/procmail.log' -s 40960000,46080000
and gives this result:

Code: Select all

OK - Largest size file is 1441910 bytes, 1 /home/nagios/procmail.log files found
Any assistance would truly be appreciated.

Steve

Re: Folder Watch Wizard

Posted: Thu Jun 15, 2023 7:59 am
by vornado
I solved the problem by comparing check_file_size_age command definitions and found that the one on the production server had been changed, perhaps by myself or someone else. I'll have to check if there are any other services using this command.
nagios-command.png
With all due respect, forum support hasn't been as good as it used to be. I hope it will improve.

This case can be closed.

Steve

Re: Folder Watch Wizard

Posted: Wed Sep 27, 2023 5:35 am
by scookpfs
I just did an upgrade from 5.10.0 to 5.11.2 and it broke our file age checks with the same error message. I compared the new command to one from a backup taken moments before the upgrade, and the new one is definately broken. Reverting the command fixed the issue.

### old ###
define command {
command_name check_file_size_age
command_line $USER1$/folder_watch.pl -D $ARG1$ -F $ARG2$ $ARG3$ $ARG4$ $ARG5$
}

### new ###
define command {
command_name check_file_size_age
command_line $USER1$/folder_watch.pl $ARG1$ $ARG2$ -f
}

This would suggest an issue with the commands.cfg file released in one of the recent patches.