check_winfile filter option

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
ebutte
Posts: 4
Joined: Fri Mar 03, 2017 11:28 am

check_winfile filter option

Post by ebutte »

Hello. I've spent so much time on this and am hoping someone else can spot my problem.

About my setup:
Nagios is installed on a Linux server which I can only access via the NagiosQL admin module.

I've downloaded the check_winfile https://www.itefix.net/check_winfile for NRPE plugin. The perl file and .exe are in "C:\Program Files\NSClient++\scripts" on my local machine from which I am running NagiosQL and that I have NSClient++ installed on.

My COMMAND definition in NagiosQL is as follows: $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_winfile -a $ARG1$ $ARG2$ $ARG3$

My SERVICE definition in NagiosQl uses the following: $ARG1$ --target c:/temp $ARG2$ --filter size gt 1

[/settings/external scripts/scripts] : check_winfile=scripts\\check_winfile.exe //T:30 //NoLogo $ARG1$ $ARG2$ $ARG3$

I've downloaded Strawberry Perl ver. 5.24.1 and added Time::ParseDate Module

Output in Nagios is as follows:

Current Status: OK (for 0d 0h 15m 6s)
Status Information: FILE OK - 51 files to consider
Performance Data: 'selected files'=51 'all files'=51 'deleted files'=0

My issue is that anything that I add as ARG2 doesn't produce the desired effect. I tried ...
--filter size gt 10KB => UNKNOWN (No output returned from plugin)
-filter size gt 10KB => UNKNOWN (Incorrect command line argument supplied)
"filter=size gt 10KB" => UNKNOWN (Incorrect command line argument supplied)
I tried variations like name match /file.txt AND age gt 24hours
I've tried using --critical and --warning values in ARG2 and 3 and gotten the UNKNOWN status as well

It seems to be a format issue with the way the args are put into nagiosQL, but the --target options works and the others don't

Any insight would be greatly appreciate.
Thanks
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_winfile filter option

Post by mcapra »

No one on the Nagios team has contributed to the source for check_winfile, so the advice we can offer is a bit limited.

These look a bit more like NSClient++ command arguments:

Code: Select all

--filter size gt 10KB => UNKNOWN (No output returned from plugin)
-filter size gt 10KB => UNKNOWN (Incorrect command line argument supplied)
"filter=size gt 10KB" => UNKNOWN (Incorrect command line argument supplied)
Here's the usage from the check_winfile page:

Code: Select all

--filter filterspec[,filterspec]...]] [[--filter ...] ... ]

...

 SIZE            eq, ne, gt, lt, ge, le    file size in bytes=
It looks as if you will need to be providing the size in bytes rather than kilobytes. Like so:

Code: Select all

check_winfile --target "c:\logfiles" --filter "size gt 10485760" --warning 10 --critical 50
Former Nagios employee
https://www.mcapra.com/
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_winfile filter option

Post by rkennedy »

If you decide to skip the plugin and use NSClient++ see this page for reference - http://sites.box293.com/nagios/guides/c ... es-folders
Former Nagios Employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_winfile filter option

Post by tmcdonald »

Thanks for the assist, @rkennedy!
Former Nagios employee
ebutte
Posts: 4
Joined: Fri Mar 03, 2017 11:28 am

Re: check_winfile filter option

Post by ebutte »

Thanks for the assistance. I ended up ditching the check_winfile plugin and going with @rkennedy 's suggestion of using the NSClient++.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: check_winfile filter option

Post by cdienger »

Glad to help. Were there any questions/issues related to this or can this thread be locked?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked