Page 1 of 1

Apply Configuration never complete

Posted: Wed Mar 22, 2017 4:55 am
by strmon
Hi,


Recently we moved from http to https but due to this, "apply configuration" is failing and never completes. Logs below:-
77...
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-03-22 15:24:00-- 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... 302 Found
Location: https://localhost/nagiosxi/includes/components/ccm/ [following]
--2017-03-22 15:24:00-- https://localhost/nagiosxi/includes/components/ccm/
Connecting to localhost|127.0.0.1|:443... connected.
WARNING: cannot verify localhost’s certificate, issued by “/C=US/O=Symantec Corporation/OU=Symantec Trust Network/CN=Symantec Class 3 Secure Server CA - G4”:
Unable to locally verify the issuer’s authority.
WARNING: no certificate subject alternative name matches
requested host name “localhost”.
HTTP request sent, awaiting response... 302 Found
Location: https://localhost/nagiosxi/login.php?re ... f&noauth=1 [following]
Location: https://localhost/nagiosxi/login.php?re ... f&noauth=1 [following]
--2017-03-22 15:24:00-- https://localhost/nagiosxi/login.php?re ... f&noauth=1
Connecting to localhost|127.0.0.1|:443... connected.
WARNING: cannot verify localhost’s certificate, issued by “/C=US/O=Symantec Corporation/OU=Symantec Trust Network/CN=Symantec Class 3 Secure Server CA - G4”:
Unable to locally verify the issuer’s authority.
WARNING: no certificate subject alternative name matches
requested host name “localhost”.
HTTP request sent, awaiting response... 200 OK
Length: unspecifiedLength: unspecified [text/html]
Saving to: “nagiosql.login”

0K .......... .......... ..... 946K=0.03s

2017-03-22 15:24:01 (946 KB/s) - “nagiosql.login” saved [25876]

/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=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&backend=1&username=nagiosxi&password=n@gweb' -O nagiosql.loginNAGIOSQL LOGIN FAILED!
RETURNCODE=2
..
PROCESSED 1 COMMANDS
....................

Re: Apply Configuration never complete

Posted: Wed Mar 22, 2017 4:58 am
by strmon
If apache redirection is stopped i.e if i comment below line in httpd.conf, this are working fine:-

#RewriteEngine On
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

I've followed nagiosxi steps on exchange to enable SSL. Please advice how to fix it.

Re: Apply Configuration never complete

Posted: Wed Mar 22, 2017 5:02 am
by strmon
As a temporary fix, i've instructed apache to ignore "localhost" by adding "RewriteCond %{HTTP_HOST} !=localhost" to below code in httpd.conf and its working fine now.
RewriteEngine On
RewriteCond %{HTTP_HOST} !=localhost
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

But i would like to know if their is any other fix to this issue.

Re: Apply Configuration never complete

Posted: Wed Mar 22, 2017 10:21 am
by avandemore
Can you attach or PM me the file /usr/local/nagiosxi/html/config.inc.php and also send a screenshot of:
XI > Admin > System Config > System Settings

Re: Apply Configuration never complete

Posted: Fri Mar 24, 2017 5:10 am
by strmon
PFA: XI system Settings
System-settings.PNG
:Config.inc.php
config.txt

Re: Apply Configuration never complete

Posted: Fri Mar 24, 2017 9:00 am
by avandemore
If you follow this document it should work:

https://assets.nagios.com/downloads/nag ... s%20XI.pdf

For one, you need to have this set in /usr/local/nagiosxi/html/config.inc.php:

Code: Select all

$cfg['use_https'] = true;

Re: Apply Configuration never complete

Posted: Tue Mar 28, 2017 12:40 am
by strmon
Thank you..! I followed the same doc, not sure how missed the php configuration. Anyway, how to doc is perfectly working.

Thank you, its OK to mark this thread solved.