NCPA.py wizard and check errors

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
krobertson71
Posts: 444
Joined: Tue Feb 11, 2014 10:16 pm

NCPA.py wizard and check errors

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA.py wizard and check errors

Post by lmiltchev »

I believe this is a bug. I posted the issue on the github here:

https://github.com/NagiosEnterprises/ncpa/issues/87
Be sure to check out our Knowledgebase for helpful articles and solutions!
krobertson71
Posts: 444
Joined: Tue Feb 11, 2014 10:16 pm

Re: NCPA.py wizard and check errors

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: NCPA.py wizard and check errors

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked