Page 1 of 1

NAGIOSQL LOGIN FAILED!

Posted: Thu Jul 06, 2017 12:51 pm
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

Re: NAGIOSQL LOGIN FAILED!

Posted: Thu Jul 06, 2017 4:13 pm
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

Re: NAGIOSQL LOGIN FAILED!

Posted: Fri Jul 07, 2017 10:28 am
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!

Re: NAGIOSQL LOGIN FAILED!

Posted: Fri Jul 07, 2017 11:16 am
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?

Re: NAGIOSQL LOGIN FAILED!

Posted: Mon Jul 10, 2017 8:29 am
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

Re: NAGIOSQL LOGIN FAILED!

Posted: Mon Jul 10, 2017 10:17 am
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;

Re: NAGIOSQL LOGIN FAILED!

Posted: Mon Jul 10, 2017 10:28 am
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!

Re: NAGIOSQL LOGIN FAILED!

Posted: Mon Jul 10, 2017 11:43 am
by scottwilkerson
Can you zip up the /etd/httpd/conf.d directory and attach as requested before?

Re: NAGIOSQL LOGIN FAILED!

Posted: Mon Jul 10, 2017 1:05 pm
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