Hello,
I also had an issue with "Apply configuration".
Simple installation, only localhost and default services (and trying to add new service).
Using GUI - CCM - Nagios 5.3.2 -> Waiting for configuration verification................. (never ends)
Using ./reconfigure_nagios.sh in shell -> No problems, script execute until the end without error.
Using GUI - CCM - Nagios 5.3.2 and monitoring file cmdsubsys.log at the same time (see Attachment) -> everything goes well until the end ...
why it doesn't stop or exit the waiting method .
While running the command using the button (cmd line + reconfigure_nagios.sh script) an insert is done in database
nagiosxi table
xi_commands and while the script run, the line is updated. At the end of the script, the line is like this :
mysql> select * from xi_commands where command_id = 67;
+------------+----------+--------------+----------------+---------+---------------------+---------------------+----------------+-----------------+--------------------+---------------------+-------------+-------------+--------------+------------------------+
| command_id | group_id | submitter_id | beneficiary_id | command | submission_time | event_time | frequency_type | frequency_units | frequency_interval | processing_time | status_code | result_code | command_data | result |
+------------+----------+--------------+----------------+---------+---------------------+---------------------+----------------+-----------------+--------------------+---------------------+-------------+-------------+--------------+------------------------+
| 67 | 0 | 1 | 0 | 17 | 2016-01-16 14:11:21 | 2016-01-16 14:11:10 | 0 | 0 | 0 | 2016-01-16 14:11:21 | 2 | 0 | | Starting nagios: done. |
+------------+----------+--------------+----------------+---------+---------------------+---------------------+----------------+-----------------+--------------------+---------------------+-------------+-------------+--------------+------------------------+
1 row in set (0.00 sec)
Let's check which function is attached to the button -> check the file /html/includes/components/nagioscorecfg/applyconfig.php :
function applyconfig_get_apply_config_result(command_id) {
$('#commandwaiting').html('<?php echo _("Waiting for configuration verification..."); ?>');
var intvid = setInterval(function () {
$(".commandresultwaiting").append(".");
var csdata = get_ajax_data("getcommandstatus", command_id);
eval('var csobj=' + csdata);
if (csobj.status_code > 1) {
if (csobj.result_code == 0) {
$('.commandresultwaiting').each(function () {
$(this).removeClass("commandresultwaiting");
$(this).addClass("commandresultok");
});
$('#commandsuccesscontent').each(function () {
$(this).show();
});
$('#commandwaiting').html("<?php echo _("Configuration applied successfully"); ?>.");
So, to exit the waiting loop,
csobj.status_code should be equal 2 (2 means everything went well). Suspicion : are
csobj / csdata updated ? NO !! Why ? Following the lead
get_ajax_data to
ajax_helper.php - function route_request, and then to the function ah_get_command_status. It appears that
get_backend_xml_data does not return ANY data !!
function ah_get_command_status()
{ ...
// get command status from backend
$args = array(
"cmd" => "getcommands",
"command_id" => $opts );
$xml = get_backend_xml_data($args);
if ($xml) {
$result["command_id"] = intval($opts);
if ($xml->command[0]) {
... ... ...
}
}
$output = json_encode($result);
echo $output;
}
My problem is that
get_backend_xml_data does not return ANY data and it is generalized to each use of this function. I trace several use of this function back to the command (GUI function, buttons,...) none of them works. I can't find the function definition anywhere or any information of any kind which could help me. Meanwhile,
ndo2db is running with
ndomod without error. I have no track or something to follow any more ...
I'm really stuck. Please help ...
(Suspicion : get_backend_xml_data is define in the protected part of Nagiosxi - Sourceguardian ?! anyway, I'm stuck)
profile.txt
cmdsubsys.log