Tested the 'utils-api.inc.php' patch and did some tests. It effectively starts the 'Apply Configuration', but I do get a warning:
From the CLI of the Reactor server:
Code: Select all
curl -k -XPOST --data "apikey=apikeyblabla&pretty=1" "https://nagiosxiprodserver.domain/nagiosxi/api/v1/system/applyconfig"
{"success":"Apply config command has been sent to the backend."}
Code: Select all
curl -k -POST --data "apikey=apikeyblabla&pretty=1" "https://nagiosxiprodserver.domain/nagiosxi/api/v1/system/applyconfig"
{"success":"Apply config command has been sent to the backend."}
Code: Select all
tail -f /usr/local/nagiosxi/var/cmdsubsys.log
.......
PROCESSED 0 COMMANDS
NAGIOSCORE CONFIG...
CMDLINE=cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2015-12-10 13:14:13-- https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:443... connected.
WARNING: certificate common name “nagiosxiprodserver.domain” doesn't match requested host name “localhost”.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”
0K .......... .......... .......... ...... 562K=0.07s
2015-12-10 13:14:13 (562 KB/s) - “nagiosql.login” saved [37646]
/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&username=nagiosxi&password=password' -O nagiosql.loginLOGIN SUCCESSFUL!
IMPORTING CONFIG FILES...URL: https://localhost/nagiosxi/includes/components/ccm/
Array
(
)
RESETTING PERMS
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE
--2015-12-10 13:14:14-- https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:443... connected.
WARNING: certificate common name “nagiosxiprodserver.domain” doesn't match requested host name “localhost”.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.login”
0K .......... .......... .......... ...... 559K=0.07s
2015-12-10 13:14:15 (559 KB/s) - “nagiosql.login” saved [37646]
/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&username=nagiosxi&password=password' -O nagiosql.loginLOGIN SUCCESSFUL!
URL: https://localhost/nagiosxi/includes/components/ccm/
CMDLINE:
/usr/bin/wget --load-cookies=nagiosql.cookies https://localhost/nagiosxi/includes/components/ccm/ --no-check-certificate --post-data 'cmd=apply&type=writeConfig' -O nagiosql.export.monitoring
--2015-12-10 13:14:15-- https://localhost/nagiosxi/includes/components/ccm/
Resolving localhost... ::1, 127.0.0.1
Connecting to localhost|::1|:443... connected.
WARNING: certificate common name “nagiosxiprodserver.domain” doesn't match requested host name “localhost”.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: “nagiosql.export.monitoring”
0K .......... ..... 973 =17s
2015-12-10 13:14:32 (973 B/s) - “nagiosql.export.monitoring” saved [16344]
WRITE CONFIGS SUCCESSFUL!
OUTPUT:
Nagios Core 4.1.1
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-19-2015
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 14982 services.
Checked 803 hosts.
Checked 168 host groups.
Checked 86 service groups.
Checked 73 contacts.
Checked 21 contact groups.
Checked 307 commands.
Checked 86 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 803 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 86 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
RET: 0
Running configuration check...
Stopping nagios:. done.
Starting nagios: done.
OUTPUT=Starting nagios: done.
RETURNCODE=0
.....................^C
What would be the officer problem with this warning?
I still don't get it working with the 'Submit an HTTP request' action from Nagios Reactor.
Code: Select all
INFO - 2015-12-10 13:25:40: STEP 1 : ****** BEGIN RUN 34063 ******
INFO - 2015-12-10 13:25:41: STEP 1 : Running block in basic mode.
INFO - 2015-12-10 13:25:41: STEP 1 : Running success actions.
INFO - 2015-12-10 13:25:41: STEP 1 : action (Submit an HTTP request) : (context) : Running action: Submit an HTTP POST request to 'https://%nagiosxiserver%/nagiosxi/api/v1/system/applyconfig'
INFO - 2015-12-10 13:25:41: STEP 1 : action (Submit an HTTP request) : (context) : Translated context variable: https://%nagiosxiserver%/nagiosxi/api/v1/system/applyconfig = https://nagiosxiprodserver.domain/nagiosxi/api/v1/system/applyconfig
INFO - 2015-12-10 13:25:41: STEP 1 : action (Submit an HTTP request) : (context) : Translated context variable: --data "apikey=%nagiosxiapikey%&pretty=1" -k = --data "apikey=apikeyblabla&pretty=1" -k
INFO - 2015-12-10 13:25:41: STEP 1 : action (Submit an HTTP request) : (context) : Performing POST request to https://nagiosxiprodserver.domain/nagiosxi/api/v1/system/applyconfig
INFO - 2015-12-10 13:25:42: STEP 1 : action (Submit an HTTP request) : (context) : HTTP status was 200
INFO - 2015-12-10 13:25:42: STEP 1 : action (Submit an HTTP request) : (context) : (Submit an HTTP POST request to 'https://%nagiosxiserver%/nagiosxi/api/v1/system/applyconfig') finished with result (0)
INFO - 2015-12-10 13:25:42: STEP 1 : Run complete (success)Grtz
Willem