Check_nrpe and checkfile

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Check_nrpe and checkfile

Postby emi65 » Fri Jul 07, 2017 9:10 am

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

Re: Check_nrpe and checkfile

Postby scottwilkerson » Fri Jul 07, 2017 12:19 pm

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
User avatar
scottwilkerson
CTO
 
Posts: 6999
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Check_nrpe and checkfile

Postby emi65 » Mon Jul 10, 2017 4:31 am

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

Re: Check_nrpe and checkfile

Postby scottwilkerson » Mon Jul 10, 2017 10:13 am

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
User avatar
scottwilkerson
CTO
 
Posts: 6999
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Check_nrpe and checkfile

Postby emi65 » Tue Jul 11, 2017 2:15 am

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

Re: Check_nrpe and checkfile

Postby tgriep » Tue Jul 11, 2017 12:59 pm

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


Return to Nagios Core

Who is online

Users browsing this forum: cerino and 33 guests