I am testing the new NCPA 2.0.2 agent and created a test plugin test.bat that echoes the supplied argument.
Under NCPA 1.8.1 the plugin returns {
"value": {
"returncode": 0,
"stdout": "hello"
}
}
Under NCPA 2.0.2 the plugin returns
{
"returncode": 0,
"stdout": "ECHO is off."
}
Please see the attached screen print.
NCPA 2.0.2 plugin returns incorrect stdout
NCPA 2.0.2 plugin returns incorrect stdout
You do not have the required permissions to view the files attached to this post.
Re: NCPA 2.0.2 plugin returns incorrect stdout
Arguments for scripts are being changed for 2.1.0 to work a little bit better. See this github issue (and feel free to chime in if you like):
https://github.com/NagiosEnterprises/ncpa/issues/316
I was able to replicate this behavior consistently on my Windows machine.
https://github.com/NagiosEnterprises/ncpa/issues/316
I was able to replicate this behavior consistently on my Windows machine.
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: NCPA 2.0.2 plugin returns incorrect stdout
It does not feel like these problems are related. I updated the plugin not to require an argument (so no slashes) and got the same result. Please see attached.
You do not have the required permissions to view the files attached to this post.
Re: NCPA 2.0.2 plugin returns incorrect stdout
What is the plugin's version that you are currently using? You can view it by running the following command from the command line:
I haven't been able to recreate the issue (I am running NCPA agent 2.0.3). Here's what I tried:
1st test (without passing arguments)
test.bat
In the GUI:
2nd test (with passing one argument)
test2.bat
In the GUI:
I have tried both, the "new" API endpoint (plugins), and the "old" (deprecated) API endpoint (agent/plugin). Both seemed to work just fine for me:
Examples:
Code: Select all
/usr/local/nagios/libexec/check_ncpa.py -V1st test (without passing arguments)
test.bat
Code: Select all
@echo off
echo hellotest2.bat
Code: Select all
@echo off
echo %1
Examples:
Code: Select all
https://192.168.x.x:5693/api/plugins/test.bat
https://192.168.x.x:5693/api/plugins/test2.bat
https://192.168.x.x:5693/api/agent/plugin/test.bat
https://192.168.x.x:5693/api/agent/plugin/test2.bat
You do not have the required permissions to view the files attached to this post.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NCPA 2.0.2 plugin returns incorrect stdout
I am not using the check_ncpa.py. Executing the test.bat plugin through the browser interface. I will load 2.0.3 and recheck.
Re: NCPA 2.0.2 plugin returns incorrect stdout
Could you run your https execution examples in the browser instead of a GUI and include the argument? I think you will be able to reproduce the problem using the deprecated API format.
I tested 2.0.3 and see that
1. Running the test.bat plugin without arguments works with an old API format (it did not in 2.0.2)
2. Running test.bat plugin with an argument works using the new API format.
3. Running test.bat with an argument using old API format does not work. I believe it is the same error as mentioned at the beginning of this incident--parsing of slashes.
NCPA has problem recognizing that /hello is an argument and tries to download it, then creates a 'hello' file. Please see the screen prints.
I tested 2.0.3 and see that
1. Running the test.bat plugin without arguments works with an old API format (it did not in 2.0.2)
2. Running test.bat plugin with an argument works using the new API format.
3. Running test.bat with an argument using old API format does not work. I believe it is the same error as mentioned at the beginning of this incident--parsing of slashes.
NCPA has problem recognizing that /hello is an argument and tries to download it, then creates a 'hello' file. Please see the screen prints.
You do not have the required permissions to view the files attached to this post.
Re: NCPA 2.0.2 plugin returns incorrect stdout
Actually, you are correct. The second time I tried this, I was able to recreate the issue. Having said that, "agent/plugin" will be removed soon in favor of "plugins", so that shouldn't be an issue. You are however welcome to file a bug report (if you wish) here:3. Running test.bat with an argument using old API format does not work.
https://github.com/NagiosEnterprises/ncpa/issues
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: NCPA 2.0.2 plugin returns incorrect stdout
Well, I wish there was an easier way to make a bug report out of this incident. I will make it an awareness item for myself and my group instead. Please close this incident. Thank you for your help.