NAGIOSQL LOGIN FAILED! RETURNCODE=2

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagio60
Posts: 9
Joined: Tue Feb 28, 2017 7:35 pm

NAGIOSQL LOGIN FAILED! RETURNCODE=2

Post by nagio60 »

On CCM, attempting to apply the configuration, but got the following error,

Backend login to the Core Config Manager failed.
An error occurred while attempting to apply your configuration to Nagios Core. Monitoring engine configuration files have been rolled back to their last known good checkpoint.

In the log, seeing the following error

OUTPUT=/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=xxxxxxxxxx' -O nagiosql.loginNAGIOSQL LOGIN FAILED!
RETURNCODE=2

Any hints ?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: NAGIOSQL LOGIN FAILED! RETURNCODE=2

Post by dwhitfield »

Are you using a proxy? If so, please run through https://support.nagios.com/kb/article.php?id=147

Are you using an offline db? Any other customizations, like changing the db password? If you changed the db password or name, you'll need to also change that in your /usr/local/nagiosxi/html/includes/components/ccm/config.inc.php. You'll also need to change it in /usr/local/nagiosxi/html/config.inc.php, but the more immediate issue is with the CCM.

Also, what version of XI is this? On what OS/version are you running XI?
nagio60
Posts: 9
Joined: Tue Feb 28, 2017 7:35 pm

Re: NAGIOSQL LOGIN FAILED! RETURNCODE=2

Post by nagio60 »

>Are you using a proxy? If so, please run through https://support.nagios.com/kb/article.php?id=147
>
Yes. The instructions were followed. The accesses to the local http are fine.

Here's a logout while the CCM conf being applied.

PROCESSED 0 COMMANDS
RE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2017-03-03 10:35:59-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:80... connected.
HTTP request sent, awaiting response...
200 OK
Length: unspecified [text/html]
Saving to: `nagiosql.login'

0K .......... ......... 164M=0s

2017-03-03 10:36:37 (164 MB/s) - `nagiosql.login' saved [19813]

/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=xxxxxxxx' -O nagiosql.loginNAGIOSQL LOGIN FAILED!
OUTPUT=/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies http://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=xxxxxxxxx' -O nagiosql.loginNAGIOSQL LOGIN FAILED!
RETURNCODE=2

PROCESSED 1 COMMANDS

>Are you using an offline db? Any other customizations, like changing the db password? If you changed the db password or name, you'll need >to also change that in your /usr/local/nagiosxi/html/includes/components/ccm/config.inc.php. You'll also need to change it in >/usr/local/nagiosxi/html/config.inc.php, but the more immediate issue is with the CCM.
>
No customization. No DB account nor config were changed. The only thing that was changed was the login password for nagisadmin account.

>Also, what version of XI is this? On what OS/version are you running XI?

Running XI 5.4.2 on Redhat 5.11
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NAGIOSQL LOGIN FAILED! RETURNCODE=2

Post by ssax »

Please follow this KB article:

Code: Select all

https://support.nagios.com/kb/article.php?id=532
If that doesn't resolve it, go to Admin > System Config > Reset Security Credentials
- Don't change anything, just click the Update Credentials button.

Now test it again.

If you are still having issues, please go to Configure > Core Config Manager > Config Manager Admin > Manage Config Access
- Edit the nagiosxi user, type in the password that the previous error showed (taken from the URL listed in the tail output you posted) and click the Save button


Try the upgrade again, if you are still having issues, please run this command and sent the full output:
- Make sure to change PASSWORD in the command below

Code: Select all

curl 'http://localhost/nagiosxi/includes/components/ccm/?submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=PASSWORD' -k -v
Thank you
nagio60
Posts: 9
Joined: Tue Feb 28, 2017 7:35 pm

Re: NAGIOSQL LOGIN FAILED! RETURNCODE=2

Post by nagio60 »

Awesome. Update Credentials and the issue is resolved. Thank you.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: NAGIOSQL LOGIN FAILED! RETURNCODE=2

Post by dwhitfield »

As your issue is resolved, I am going to go ahead and lock this thread.
Locked