Apply Configuration will not complete: NAGIOSQL LOGIN FAILED

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
daniel.ledford
Posts: 19
Joined: Wed Jan 20, 2016 9:03 am

Apply Configuration will not complete: NAGIOSQL LOGIN FAILED

Post by daniel.ledford »

Whenever I run the apply config command through XI it will just sit there and spin and say that its waiting, when in reality it has errored out with a NAGIOSQL LOGIN FAILED error.

$ tail -F /usr/local/nagiosxi/var/cmdsubsys.log
..................................PROCESSING COMMAND ID 7196...
PROCESS COMMAND: CMD=17, DATA=
APPLYING NAGIOSCORE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2017-09-26 15:01:36-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://<hostname>/nagiosxi/includes/components/ccm/ [following]
--2017-09-26 15:01:36-- https://<hostname>/nagiosxi/includes/components/ccm/
Resolving <proxy info>
Connecting to <proxy info>... connected.
WARNING: cannot verify <hostname>’s certificate, issued by “<removed>”:
Self-signed certificate encountered.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

0K .......... . 6.31M=0.002s

2017-09-26 15:01:36 (6.31 MB/s) - “nagiosql.login” saved [11455]

/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&username=nagiosxi&password=n@gweb' -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&username=nagiosxi&password=n@gweb' -O nagiosql.loginNAGIOSQL LOGIN FAILED!
RETURNCODE=2
........................
PROCESSED 1 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
............................................................

Any help to getting this resolved would be greatly appreciated!
User avatar
tacolover101
Posts: 432
Joined: Mon Apr 10, 2017 11:55 am

Re: Apply Configuration will not complete: NAGIOSQL LOGIN FA

Post by tacolover101 »

run tail -f /usr/local/nagiosxi/var/cmdsubsys.log

then attempt to apply again, what is outputted?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Apply Configuration will not complete: NAGIOSQL LOGIN FA

Post by scottwilkerson »

Actually what you need is to add the no_proxy line described here to the /etc/wgetrc to stop the backend from attempting to go through a proxy
https://support.nagios.com/kb/article.php?id=147

Code: Select all

no_proxy=localhost,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 # Hosts to exclude from proxying
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
daniel.ledford
Posts: 19
Joined: Wed Jan 20, 2016 9:03 am

Re: Apply Configuration will not complete: NAGIOSQL LOGIN FA

Post by daniel.ledford »

Here is the output of /usr/local/nagiosxi/var/cmdsubsys.log

$ tail -f /usr/local/nagiosxi/var/cmdsubsys.log
...................................
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
.
PROCESSED 0 COMMANDS
tail: /usr/local/nagiosxi/var/cmdsubsys.log: file truncated
daniel.ledford
Posts: 19
Joined: Wed Jan 20, 2016 9:03 am

Re: Apply Configuration will not complete: NAGIOSQL LOGIN FA

Post by daniel.ledford »

I also added the hostname to the no_proxy and it did eliminate the proxy step but it is still failing.
Below is the output:

$ ./reconfigure_nagios.sh
URL: http://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/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&username=nagiosxi&password=n@gweb' -O nagiosql.login--2017-09-28 12:43:41-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://<hostname>/nagiosxi/includes/components/ccm/ [following]
--2017-09-28 12:43:41-- https://<hostname>/nagiosxi/includes/components/ccm/
Resolving <hostname>...
Connecting to <hostname>:443... connected.
WARNING: cannot verify <hostname> certificate, issued by <removed>:
Self-signed certificate encountered.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”

[ <=> ] 11,455 --.-K/s in 0.009s

2017-09-28 12:43:42 (1.25 MB/s) - “nagiosql.login” saved [11455]

NAGIOSQL LOGIN FAILED!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Apply Configuration will not complete: NAGIOSQL LOGIN FA

Post by scottwilkerson »

This looks like you have a redirect in your httpd configuration files or something, all of these calls should be happening through localhost.

Can you zip up the files in /etc/httpd/conf.d and PM them to us to take a look at? Or you can send them in an email ticket to [email protected] and reference this thread.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Apply Configuration will not complete: NAGIOSQL LOGIN FA

Post by scottwilkerson »

Just wanted to update this thread, the problem was an incorrect redirect in the httpd.conf and is now resolved.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked