Page 1 of 2

ncpa wizard does not work, (bad token)

Posted: Wed May 15, 2019 9:56 am
by rnjie
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.But in the NCPA Wizard first page I get a pink rectangle that says "Bad token for connection. i am running the latest version of ncpa and latest version of nagios xi, what seems to be the issue with the web wizard

Re: ncpa wizard does not work, (bad token)

Posted: Wed May 15, 2019 10:39 am
by benjaminsmith
Hello @rnjie,

Are you using any special characters/string in the token that could be causing some issues? Can you test this with a simplified token string to rule this out.

Also, are you able to run check_ncpa from the command line on the Nagios XI server and communicate with NCPA on the remote hsot.

Example command:

Code: Select all

./check_ncpa.py -H <ip-address> -t 'token' -M cpu/percent

Re: ncpa wizard does not work, (bad token)

Posted: Wed May 15, 2019 11:15 am
by rnjie
my token doesnt have any special characters, please see below output of cpu from command line


libexec]# ./check_ncpa.py -H lxaoswe4 -t plut0 -M cpu/percent
OK: Percent was 2.00 %, 3.90 % | 'percent_0'=2.00%;;; 'percent_1'=3.90%;;;

Re: ncpa wizard does not work, (bad token)

Posted: Wed May 15, 2019 1:21 pm
by benjaminsmith
Hi @rnjie,

Interesting, it should work. To date, I'm not aware of any similar issues with the NCPA wizard., What version are you using? Go to Admin > System Extensions > Manage Config Wizards and scroll down to the NCPA wizard.

Also, please tail the apache log file while you are connecting to NCPA in step one, and post the error output for us to review.

Code: Select all

tail -f /var/log/httpd/*error_log
Thanks.

Re: ncpa wizard does not work, (bad token)

Posted: Wed May 15, 2019 2:20 pm
by rnjie
see output for above command


[Wed May 15 14:17:12.539593 2019] [:error] [pid 13467] [client 10.3.99.152:63651] PHP Warning: array_key_exists() expects parameter 2 to be array, null given in /usr/local/nagiosxi/html/includes/configwizards/ncpa/ncpa.inc.php on line 164, referer: http://10.2.102.83/nagiosxi/config/monitoringwizard.php

Re: ncpa wizard does not work, (bad token)

Posted: Wed May 15, 2019 3:09 pm
by benjaminsmith
Hi @rnjie,

Please make a backup of your system, then delete the old NCPA wizard and install the latest version ( see attachment) and try again.

References:
Backing Up And Restoring Your Nagios XI System
Installing Configuration Wizards

Re: ncpa wizard does not work, (bad token)

Posted: Wed May 15, 2019 3:27 pm
by rnjie
is this the only solution? what is going to happen to the existing hosts? also it works when i re-add existing hosts but just not on new ones, i need to know the risks for uninstalling and installing again, i have two different severs running a nagios xi and they both have this issue,too much of a coincidence.

Re: ncpa wizard does not work, (bad token)

Posted: Wed May 15, 2019 3:32 pm
by benjaminsmith
Hi @rnjie,

Ok, I will talk to development on your issue, so please wait before making any changes to your system.

Re: ncpa wizard does not work, (bad token)

Posted: Wed May 15, 2019 4:09 pm
by benjaminsmith
Hello @rnjie,

I just checked and there was a bug a couple versions back, so I would update to the latest version 2.0.6. You can go to Admin > Manage Config Wizards and select the Check for Updates button to be able to download the latest version from the XI interface.

There was a change to the services and processes endpoints in 12/2017 that could affect previous configurations (they would need to be updated from the Core Configuration Manager).

See: NCPA - Service And Process Changes To API Endpoint

If you have a test system, we always recommend updating and the test server before making changes to the production server.

Let me know if you have any questions.

Re: ncpa wizard does not work, (bad token)

Posted: Wed May 15, 2019 4:42 pm
by rnjie
i checked and it says ncpa is up to date but its running 2.0.4, if i update my nagios xi will it update the ncpa wizard to 2.0.6 as well? cuz am currently running nagios xi 5.6.0