nrpe checkfiles pattern wildcard issue

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
nagios-retail
Posts: 36
Joined: Mon Feb 09, 2015 3:32 am

nrpe checkfiles pattern wildcard issue

Post by nagios-retail »

Hello everyone,

I have a question regarding the NRPE Plugin for Nagios.
I'm trying to count the folders starting with a certain name.
Example:
C:\temp\ABCdef
C:\temp\ABDxyz
C:\temp\DEFxyz

and command
./check_nrpe -2 -H <ip> -c checkfiles -a path='C:\temp' 'pattern=AB*'
should return ABCdef, ABDxyz

It works find through the command line (ABCdef, ABDxyz are found)
However, if I configure it in Nagios, then nothing is found.

In nsclient.log I can see the following difference:
command line: Created command: pattern=AB* detail-syntax=${filename} top-syntax=${list} path=C:\temp
nagios ui: Created command: pattern=AB\* detail-syntax=${filename} top-syntax=${list} path=C:\\temp

If the wildcard is not the last character, then it works fine in both cases.
Example:
./check_nrpe -2 -H <ip> -c checkfiles -a path='C:\temp' 'pattern=*xyz'
returns ABDxyz, DEFxyz
nsclient.log:
command line: Created command: pattern=*xyz detail-syntax=${filename} top-syntax=${list} path=C:\temp
nagios ui: Created command: pattern=\*xyz detail-syntax=${filename} top-syntax=${list} path=C:\\temp

Looks as checkfiles behaves differently if the pattern has an escaped wildcard a the end.
Any ideas on how to solve this issue?
Locked