Check_nrpe and checkfile

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
emi65
Posts: 119
Joined: Fri Aug 17, 2012 3:41 am

Check_nrpe and checkfile

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_nrpe and checkfile

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
emi65
Posts: 119
Joined: Fri Aug 17, 2012 3:41 am

Re: Check_nrpe and checkfile

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check_nrpe and checkfile

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
emi65
Posts: 119
Joined: Fri Aug 17, 2012 3:41 am

Re: Check_nrpe and checkfile

Post 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 !!!
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check_nrpe and checkfile

Post 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/
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked