Page 1 of 1

NCPA Wizard "Bad token for connection"

Posted: Fri May 10, 2019 6:07 pm
by jonathanklay
I have NCPA installed and running on a system, and it works. I can access the web interface from another system using the community_string/token. I can do a wget from the NagiosXI server OS CLI with token=xxxxxxx and get data returned.
But in the NCPA Wizard first page I get a pink rectangle that says "Bad token for connection."
In var/log/ncpa_listener.log I see
"GET /testconnect?token=xxxxxxx HTTP/1.0" 308 527 0.002476
each time I try this. In a browser I can put https://FQDN:5693/testconnect/?token=xxxxxxx and I get
{
"value": "Success."
}
Any ideas?
Of course, if it really sends the ' HTTP/1.0' then it would get { "error": "Bad token." } ...

Re: NCPA Wizard "Bad token for connection"

Posted: Mon May 13, 2019 11:04 am
by cdienger
The first thing that comes to mind is a special character not getting handled properly but I haven't been able to reproduce so far. Are there any special characters in the token? Can you test with a simplified token if so? What version of NCPA is installed?

Re: NCPA Wizard "Bad token for connection"

Posted: Tue May 14, 2019 9:02 am
by progressive.nagiosXI
Hi ,

we are also getting same error through wizard.(linux NCPA wizard is buggy)

-Open through web interface and also from CURL in nagiosxi

[root@monitoring-nagiosxi ~]# curl https://13.71.*.*:5693/testconnect/?token=MyToken -k
{
"value": "Success."
}

[nagios@monitoring-nagiosxi ~]$ /usr/local/nagios/libexec/check_ncpa.py -H 13.71.*.* -t 'MyToken' -P 5693 -M 'disk/logical/|' -w 70 -c 90
OK: Used disk space was 4.70 % (Used: 45.54 GiB, Free: 923.57 GiB, Total: 969.12 GiB) | 'used'=45.54GiB;678;872; 'free'=923.57GiB;678;872; 'total'=969.12GiB;678;872;

Note: we are not using any special character in token

Re: NCPA Wizard "Bad token for connection"

Posted: Tue May 14, 2019 1:25 pm
by cdienger
What version of the agent is installed and what version of the wizard? The agent version can be found by running:

Code: Select all

 /usr/local/nagios/libexec/check_ncpa.py -H ncpa_ip -t 'mytoken' -P 5693 -M 'system/agent_version'
I've attached a slightly modified version of the wizard to output a couple more pieces of info to the screen when it can't connect. Install it under Admin > System Extensions > Manage Config Wizards, run the wizard, and PM me a screenshot of the wizard after it fails.

Re: NCPA Wizard "Bad token for connection"

Posted: Fri May 17, 2019 1:47 pm
by progressive.nagiosXI
Thanks,

we now updated ncpa wizard from 2.0.4 to 2.0.6 and then issue resolved.

Admin > System Extensions > Manage Config Wizards

we checked updates and update all wizard to latest versions

Re: NCPA Wizard "Bad token for connection"

Posted: Fri May 17, 2019 2:14 pm
by cdienger
Thanks for the update!

Re: NCPA Wizard "Bad token for connection"

Posted: Mon May 20, 2019 5:06 pm
by jonathanklay
Yes, it was something with prior versions - 2.0.4 was installed. Updated from 5.5.7 to 5.6.2, now NCPA wizard is 2.0.6 and runs correctly.

Re: NCPA Wizard "Bad token for connection"

Posted: Tue May 21, 2019 9:04 am
by cdienger
Thanks for the update. Glad to hear it is working now!