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
check_winfile filter option
Re: check_winfile filter option
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:
Here's the usage from the check_winfile page:
It looks as if you will need to be providing the size in bytes rather than kilobytes. Like so:
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)
Code: Select all
--filter filterspec[,filterspec]...]] [[--filter ...] ... ]
...
SIZE eq, ne, gt, lt, ge, le file size in bytes=
Code: Select all
check_winfile --target "c:\logfiles" --filter "size gt 10485760" --warning 10 --critical 50
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: check_winfile filter option
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
Re: check_winfile filter option
Thanks for the assistance. I ended up ditching the check_winfile plugin and going with @rkennedy 's suggestion of using the NSClient++.
Re: check_winfile filter option
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.