NCPA Plugin using check_log3.exe logfile path with space

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
JosephH
Posts: 34
Joined: Fri Oct 12, 2018 10:04 am

NCPA Plugin using check_log3.exe logfile path with space

Post 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
JosephH
Posts: 34
Joined: Fri Oct 12, 2018 10:04 am

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

Post 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.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

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

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
JosephH
Posts: 34
Joined: Fri Oct 12, 2018 10:04 am

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

Post by JosephH »

I believe I got it from here:
https://github.com/pmcaulay/nagios-plugins

Thank you for helping.

Joseph
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

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

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
JosephH
Posts: 34
Joined: Fri Oct 12, 2018 10:04 am

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

Post by JosephH »

Hi mbellerue,

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

Thank you,
Joseph
Locked