Page 1 of 1

NCPA.py wizard and check errors

Posted: Fri Oct 24, 2014 12:32 pm
by krobertson71
I know in 1.7 the api calls changed a bit. When I try to use these new calls in Nagios Xi for a service check I get the following error:

Code: Select all

[nagios@nagiast01 libexec]$ ./check_ncpa.py -H emovasd01 -P 5693 -t mytoken -M services?service=employeemove&status=running&check=true
[1] 32420
[2] 32421
[nagios@nagiast01 libexec]$ UNKNOWN: Error occurred while running the plugin.

[1]-  Exit 3                  ./check_ncpa.py -H emovasd01 -P 5693 -t mytoken -M services?service=employeemove
[2]+  Done                    status=running
I run the command, it shows the [1] and [2] and then throws the error then just sits there. when I hit enter you see the Exit 3 and Done status, which is weird.
Here is how I am trying to set up the check in Nagios XI: Arg 1:

Code: Select all

-t 'mytoken' -P 5693 -M 'services?service=employeemove&status=running&check=true'
When I go to configure the check is Core Configuration manager in the Nagios XI gui and run "test check" against a host this is returned

Code: Select all

COMMAND: /usr/local/nagios/libexec/check_ncpa.py -H emovasd01 -t 'mytoken' -P 5693 -M \'services\?service=employeemove
OUTPUT: UNKNOWN: Error occurred while running the plugin.
As you can see it dosen't even take the full command ARG1.

This host is running the NCPA1.7.2 agent.. Server is NagiosXIR1.5.

I am thinking maybe I need to update the ncpa.py check with a newer version?

On the host itself, when I check the agent api directly this works great.

Code: Select all

https://emovasd01:5693/api/services?service=employeemove&status=running&check=true

{
  "value": {
    "returncode": 2, 
    "stdout": "CRITICAL: Service employeemove is stopped"
  }
}


Any help here will go a long way towards my production implementation.

Re: NCPA.py wizard and check errors

Posted: Fri Oct 24, 2014 1:23 pm
by lmiltchev
I believe this is a bug. I posted the issue on the github here:

https://github.com/NagiosEnterprises/ncpa/issues/87

Re: NCPA.py wizard and check errors

Posted: Fri Oct 24, 2014 2:19 pm
by krobertson71
Thanks.. I never even thought to try the old way.

That will work for now, but would be could to have the continuity between the API and and ncpa.py check command.

Also, you did a much better, and more concise, job of describing my issue on Git. Thanks for that!

Kris

Re: NCPA.py wizard and check errors

Posted: Mon Oct 27, 2014 12:04 pm
by lmiltchev
Thanks, krobertson71!
I will be locking this post now. If you have a different, unrelated issue, please, start a new thread. You can PM me if you want me to unlock the topic, in case you want to reopen it.