NAGIOSQL LOGIN FAILED!

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
BradZynda
Posts: 31
Joined: Thu Jul 06, 2017 12:43 pm

NAGIOSQL LOGIN FAILED!

Post by BradZynda »

$ ./reconfigure_nagios.sh
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies
https://localhost/nagiosxi/includes/components/ccm/
--no-check-certificate --post-data
'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=SCZkQaUkEctt'
-O nagiosql.login--2017-07-05 18:38:55--
https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:443... connected.
OpenSSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Unable to establish SSL connection.
NAGIOSQL LOGIN FAILED!


also see it with rpmupgrade

# ./rpmupgrade
Archive: sourceguardian/ixed4.lin.x86-64.zip
inflating: /usr/lib64/php/modules/ixed.5.4.lin
Sourceguardian extension found for PHP version 5.4
Sourceguardian extension already in php.ini
Redirecting to /bin/systemctl restart httpd.service
Checking required prereqs...
Please wait...

Copying over new XI directory...
Updating NagiosQL...
NAGIOSQL-POST
Patching NDOUtils...
NDOUtils already patched at level 103
Updating sequences...
Postgres Database not being used
Fixing config file permissions...
Fixing htpasswd permissions...
Checking group memberships...
Installing new XI templates...
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=fLKOQB' -O nagiosql.login--2017-07-06 17:39:40-- https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:443... connected.
OpenSSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Unable to establish SSL connection.
NAGIOSQL LOGIN FAILED!

also unable to update / apply configuration via GUI

Thanks,
Brad
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: NAGIOSQL LOGIN FAILED!

Post by tmcdonald »

Did you enable SSL? Run through this doc and make sure you followed each step, especially the Admin menu portion: https://assets.nagios.com/downloads/nag ... s%20XI.pdf
Former Nagios employee
BradZynda
Posts: 31
Joined: Thu Jul 06, 2017 12:43 pm

Re: NAGIOSQL LOGIN FAILED!

Post by BradZynda »

No problems with the cert or https

# cat /usr/local/nagiosxi/html/config.inc.php | grep "use_https"
$cfg['use_https'] = true; // determines whether cron jobs and other scripts will force the use of HTTPS instead of HTTP

set program url to https

set server protocol to HTTPS via drop down

# cat /usr/local/nagiosxi/html/includes/dashlets/custom-dashlet/custom-dashlet.inc.php | grep "https"
<input type="text" name="url" id="url" value="https://">


restarted httpd

also verified via gui security protocol set to TLSv1.2 via drop down box..

Maybe not fully TLSv1.2? we do not allow SSLvN only TLSv1.2.


still see:

Copying over new XI directory...
Updating NagiosQL...
NAGIOSQL-POST
Patching NDOUtils...
NDOUtils already patched at level 103
Updating sequences...
Postgres Database not being used
Fixing config file permissions...
Fixing htpasswd permissions...
Checking group memberships...
Installing new XI templates...
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
/usr/bin/wget --save-cookies nagiosql.cookies --keep-session-cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'submit=Login&hidelog=true&loginSubmitted=true&backend=1&username=nagiosxi&password=fLKOQB' -O nagiosql.login--2017-07-07 15:25:03-- https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:443... connected.
OpenSSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Unable to establish SSL connection.
NAGIOSQL LOGIN FAILED!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NAGIOSQL LOGIN FAILED!

Post by scottwilkerson »

Actually what you are getting looks like localhost is not part of the SSL configuration in httpd, I assume you can access the site with it's hostname in your browser?

Did you follow the virtual host creation just like in this doc, or follow something else?
https://assets.nagios.com/downloads/nag ... ith-Nagios XI.pdf

Can you zip up the /etd/httpd/conf.d directory and attach?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
BradZynda
Posts: 31
Joined: Thu Jul 06, 2017 12:43 pm

Re: NAGIOSQL LOGIN FAILED!

Post by BradZynda »

correct, localhost should NOT be accessible from http/https..

Yes we can get to the site by FQDN or IP without any issues.

Yes I followed the quide to the letter, minus we already had a cert. so no need to generate one.

Not sure why the connection to the DB is trying to go out, does it not live on localhost non-ssl?


Thanks,
Brad
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NAGIOSQL LOGIN FAILED!

Post by scottwilkerson »

BradZynda wrote:correct, localhost should NOT be accessible from http/https..

Yes we can get to the site by FQDN or IP without any issues.

Yes I followed the quide to the letter, minus we already had a cert. so no need to generate one.

Not sure why the connection to the DB is trying to go out, does it not live on localhost non-ssl?


Thanks,
Brad
The apply configuration process uses local host. If you have localhost specified to NOT use the SSL you would want to edit
/usr/local/nagiosxi/html/config.inc.php and change the following back

Code: Select all

$cfg['use_https']=true;
to

Code: Select all

$cfg['use_https']=false;
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
BradZynda
Posts: 31
Joined: Thu Jul 06, 2017 12:43 pm

Re: NAGIOSQL LOGIN FAILED!

Post by BradZynda »

edited back to false

restarted nagios and httpd

still can not apply config:
Apply Configuration

Waiting for configuration verification................................................................................................................................................................

just keeps going.

and still see via ./rpmupgrade:
Updating sequences...
Postgres Database not being used
Fixing config file permissions...
Fixing htpasswd permissions...
Checking group memberships...
Installing new XI templates...
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&backend=1&username=nagiosxi&password=fLKOQB' -O nagiosql.login--2017-07-10 15:25:21-- http://localhost/nagiosxi/includes/components/ccm/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://localhost/nagiosxi/includes/components/ccm/ [following]
--2017-07-10 15:25:21-- https://localhost/nagiosxi/includes/components/ccm/
Connecting to localhost (localhost)|127.0.0.1|:443... connected.
OpenSSL: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Unable to establish SSL connection.
NAGIOSQL LOGIN FAILED!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: NAGIOSQL LOGIN FAILED!

Post by scottwilkerson »

Can you zip up the /etd/httpd/conf.d directory and attach as requested before?
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: NAGIOSQL LOGIN FAILED!

Post by scottwilkerson »

Fixed via PM.

Problem was a <VirtualHost xxx.xxx.xxx.xxx:443> directive in the ssl.conf that specifid the IP of the server.

Changed to

Code: Select all

<VirtualHost _default_:443>
restarted httpd and all worked as expected
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked