Page 1 of 1

NCPA Plugin using check_log3.exe logfile path with space

Posted: Thu Oct 10, 2019 7:11 am
by JosephH
I am using NCPA agent 2.1.8 for windows. I have check_log3.exe plugin with version 3.14. It is working great with logfile path without space in it. However, it will give me "Cannot read '\"C:\\Monitoring\\avoid spaces\\test.txt\"'" error.
the syntax I used:
check_log3.exe?args=-l "C:\Monitoring\avoid spaces\test.txt" -p "outerror"

I tried few ways to escape space, use double or single quotes, got the same result.

Any help is greatly appreciated.

Thanks
Joseph

Re: NCPA Plugin using check_log3.exe logfile path with space

Posted: Thu Oct 10, 2019 1:56 pm
by JosephH
Update:
looks like the -l logfile option is not accepting either single or double quotes. And space is the delimiter for the logfile.
However, if we ran from DOS command prompt, see below. it is working.

plugins\check_log3.exe -l "C:\Monitoring\avoid spaces\test.txt" -p "error"
WARNING: Found 2 lines (limit=1/0): 3rd error|lines=2

Not working from NCPA API or Nagios XI command.

Re: NCPA Plugin using check_log3.exe logfile path with space

Posted: Fri Oct 11, 2019 11:46 am
by mbellerue
You mention using check_log3.exe. Is that this plugin with the Perl script converted to an exe?
https://exchange.nagios.org/directory/P ... pl/details

I'm trying to throw this issue into a lab environment and see if I can get it going.

Re: NCPA Plugin using check_log3.exe logfile path with space

Posted: Fri Oct 11, 2019 12:14 pm
by JosephH
I believe I got it from here:
https://github.com/pmcaulay/nagios-plugins

Thank you for helping.

Joseph

Re: NCPA Plugin using check_log3.exe logfile path with space

Posted: Fri Oct 11, 2019 3:44 pm
by mbellerue
It looks like we do have an open bug for this.
https://github.com/NagiosEnterprises/ncpa/issues/481

If you need to work around this, you could make a symlink to the directory where your log file is stored.

For example, you have
C:\Monitoring\avoid spaces\

Code: Select all

mklink /D C:\Monitoring\nospaces "C:\Monitoring\avoid spaces\"
Very important note. If in the future you want to get rid of the symlink, you rmdir the symlink, do not del the symlink. It will delete all of the files in the target directory.

Re: NCPA Plugin using check_log3.exe logfile path with space

Posted: Tue Oct 15, 2019 9:54 am
by JosephH
Hi mbellerue,

Thanks for the info and this work around solved my issue.

Thank you,
Joseph