Page 1 of 1

Check_nrpe and checkfile

Posted: Fri Jul 07, 2017 9:10 am
by emi65
I'using nagios 4.2.1
check_nrpe 3.2.0
nscp NSCP-0.5.0.62-x64

I do this check
/usr/lib/nagios/plugins/check_nrpe -H 10.209.32.47 -c CheckFiles -a path='D:\AIAC1\LOG\AiaceARGO_1.log' "filter=written lt -5m" syntax="%filename% was modifed %write%" MaxCrit=1
AiaceARGO_1.log was modifed 2017-07-07 13:13:02|'count'=1;0;1

... and works

/usr/lib/nagios/plugins/check_nrpe -H 10.209.32.47 -c CheckFiles -a path='D:\AIAC1\LOG\AiaceARGO.log' "filter=written lt -5m" syntax="%filename% was modifed %write%" MaxCrit=1
No files found|'count'=0;0;1
... BUT THE FILE EXIST

Both files are on the share because
D:\AIACE1 is a windows sym link to a share

The difference between AiaceARGO_1.log AiaceARGO.log is
AiaceARGO_1.log is close and NOT in USE

AiaceARGO.log is open from the application

Is there a way to solve this problem ?

thanks

Re: Check_nrpe and checkfile

Posted: Fri Jul 07, 2017 12:19 pm
by scottwilkerson
You have

Code: Select all

"filter=written lt -5m"
Does the command work if that filter is relaxed? Not sure how often the application updates the written flag

Re: Check_nrpe and checkfile

Posted: Mon Jul 10, 2017 4:31 am
by emi65
Doesn't meen "relaxed"

If I did the command without filter option I got

/usr/lib/nagios/plugins/check_nrpe -H 10.209.32.47 -c CheckFiles -a path='D:\AIAC1\LOG\AiaceARGO.log'
AiaceARGO.log

Re: Check_nrpe and checkfile

Posted: Mon Jul 10, 2017 10:13 am
by scottwilkerson
scottwilkerson wrote:You have

Code: Select all

"filter=written lt -5m"
Does the command work if that filter is relaxed? Not sure how often the application updates the written flag
I meant changed to a longer timeframe, like days

Code: Select all

"filter=written lt -365d"
Which would mean it was written to in the last 365 days

Re: Check_nrpe and checkfile

Posted: Tue Jul 11, 2017 2:15 am
by emi65
nothings is change in command result

/usr/lib/nagios/plugins/check_nrpe -H 10.209.32.47 -c CheckFiles -a path='D:\AIAC1\LOG\AiaceARGO.log' "filter=written lt -365d"
No files found

If I use nsclient 0.3.9 the comman work well !!!

Re: Check_nrpe and checkfile

Posted: Tue Jul 11, 2017 12:59 pm
by tgriep
I would guess that the there is a bug in the newer version of the NSCLient++ and it cannot read the status if the file if it is open by another process.
I recommend trying the latest stable 4.x.x version of the NSClient++ and see if that works for you.
Or, you can post a bug report at NSClient's web site and see if the nex release will get it fixed.
http://nsclient.org/support/