Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
* Refs #3807 : Fix save option use_check_result_path in page main.cfg…
Browse files Browse the repository at this point in the history
… configuration

* Refs #3807 : Add help for use_check_result_path in page main.cfg configuration
  • Loading branch information
leoncx committed Oct 5, 2015
1 parent 76b0bf6 commit aa0750f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions www/include/configuration/configNagios/DB-Func.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function insertNagios($ret = array(), $brokerTab = array())
"`debug_level_opt`, `debug_verbosity` , `max_debug_file_size` , `daemon_dumps_core`, " .
"`enable_environment_macros` , `use_setpgid`, `use_regexp_matching` , `use_true_regexp_matching` , `admin_email` , `admin_pager` , `nagios_comment` , `nagios_activate`, " .
"`event_broker_options` , `enable_embedded_perl` , `use_embedded_perl_implicitly`, `translate_passive_host_checks`, " .
"`passive_host_checks_are_soft`, `check_for_orphaned_hosts`, `external_command_buffer_slots`, `cfg_file`, `log_pid`) ";
"`passive_host_checks_are_soft`, `check_for_orphaned_hosts`, `external_command_buffer_slots`, `cfg_file`, `log_pid`, `use_check_result_path`) ";
$rq .= "VALUES (";
$rq .= "NULL, ";
isset($ret["nagios_name"]) && $ret["nagios_name"] != NULL ? $rq .= "'".htmlentities($ret["nagios_name"], ENT_QUOTES, "UTF-8")."', " : $rq .= "NULL, ";
Expand Down Expand Up @@ -330,7 +330,8 @@ function insertNagios($ret = array(), $brokerTab = array())
isset($ret["check_for_orphaned_hosts"]["check_for_orphaned_hosts"]) && $ret["check_for_orphaned_hosts"]["check_for_orphaned_hosts"] != 2 ? $rq .= "'".$ret["check_for_orphaned_hosts"]["check_for_orphaned_hosts"]."', " : $rq .= "'2', ";
isset($ret["external_command_buffer_slots"]["external_command_buffer_slots"]) && $ret["external_command_buffer_slots"]["external_command_buffer_slots"] != 2 ? $rq .= "'".$ret["external_command_buffer_slots"]["external_command_buffer_slots"]."', " : $rq .= "'2', ";
isset($ret["cfg_file"]) && $ret["cfg_file"] != NULL ? $rq .= "'".htmlentities($ret["cfg_file"], ENT_QUOTES, "UTF-8")."', " : $rq .= "NULL, ";
isset($ret["log_pid"]["log_pid"]) && $ret["log_pid"]["log_pid"] ? $rq .= "'1', " : $rq .= "'0')";
isset($ret["log_pid"]["log_pid"]) && $ret["log_pid"]["log_pid"] ? $rq .= "'1', " : $rq .= "'0', ";
isset($ret['use_check_result_path']['use_check_result_path']) && $ret['use_check_result_path']['use_check_result_path'] ? $rq .= "'1')" : $rq .= "'0')";

$DBRESULT = $pearDB->query($rq);
$DBRESULT = $pearDB->query("SELECT MAX(nagios_id) FROM cfg_nagios");
Expand Down Expand Up @@ -504,6 +505,7 @@ function updateNagios($nagios_id = null) {

isset($ret["cfg_file"]) && $ret["cfg_file"] != NULL ? $rq .= "cfg_file = '".htmlentities($ret["cfg_file"], ENT_QUOTES, "UTF-8")."', " : $rq .= "cfg_file = NULL, ";
isset($ret["log_pid"]["log_pid"]) && $ret["log_pid"]["log_pid"] ? $rq .= "log_pid = '1', " : $rq .= "log_pid = '0', ";
isset($ret['use_check_result_path']['use_check_result_path']) && $ret['use_check_result_path']['use_check_result_path'] ? $rq .= "use_check_result_path = '1', " : $rq .= "use_check_result_path = '0', ";

$rq .= "nagios_activate = '".$ret["nagios_activate"]["nagios_activate"]."' ";
$rq .= "WHERE nagios_id = '".$nagios_id."'";
Expand Down
3 changes: 2 additions & 1 deletion www/include/configuration/configNagios/formNagios.php
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,8 @@
'debug_verbosity' => '0',
'max_debug_file_size' => '1000000000',
'daemon_dumps_core' => '0',
'cfg_file' => 'centengine.cfg'
'cfg_file' => 'centengine.cfg',
'use_check_result_path' => '0'
));

$form->setDefaults(array('action' => '1'));
Expand Down
1 change: 1 addition & 0 deletions www/include/configuration/configNagios/help.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
$help["Monitoring Engine_activate"] = dgettext("help", "Specify whether this configuration is currently active or not. This way you can test different configuration sets for one monitoring node.");
$help["Monitoring Engine_server_id"] = dgettext("help", "Choose the Monitoring Engine server instance this configuration is defined for.");
$help["log_pid"] = dgettext("help", "Enable the possibility to log pid information in engine log file (option only for Centreon Engine)");
$help["use_check_result_path"] = dgettext("help", "This option enable or disable compatibility mode to use check result path.");

/*
* unsupported in centreon
Expand Down

0 comments on commit aa0750f

Please sign in to comment.