Page 1 of 1

check_nrpe check_files count < 10 not working

Posted: Fri Sep 06, 2019 3:25 am
by bucher_nagios
Dear Community,

we are trying to implement a new check_nrpe in our Nagios XI environment to check if a folder has less than 10 files inside.
This is important to know if a system is correctly running after a planned reboot with cleanup of that specific folder.

To do this we use the Check command "check_nrpe" like this

Command View:

$USER1$/check_nrpe -H $HOSTADDRESS$ -t 30 -c $ARG1$ $ARG2$

$ARG1$ = check_files
$ARG2$ = ./check_nrpe -a path='D:\\JDEdwardsPPack\\E920\\log' 'warn= count < 20' 'crit= count < 10' top-syntax='${status}: ${count} files found ${problem_list}' 'empty-state=critical' show-all


The problem we have is that if I set the threshold like above it always says status critical also if there are 50 files inside which in my opinion is not correct?!

Thanks for your help and kind regards,
Christian

Re: check_nrpe check_files count < 10 not working

Posted: Fri Sep 06, 2019 10:35 am
by mbellerue
I was able to take your example command and it would report OK, WARNING, and CRITICAL based on the number of files and threshold set. Are you getting the full list of files returned by the command when it runs?

Were there more than 20 files in the directory when you created the check? If so, did the check report OK at that point?