cascade protection services

This commit is contained in:
daniel 2018-06-27 15:03:46 +02:00
parent 84f1cf95eb
commit 85897315cd
5 changed files with 18 additions and 41 deletions

View File

@ -523,7 +523,11 @@ if($cps > 0){
$cps_array[$cps] = __('Enabled');
}
else{
$cps_array[0] = __('Enabled');
$cps_inc = 0;
if($id_agente){
$cps_inc = service_agents_cps($id_agente);
}
$cps_array[$cps_inc] = __('Enabled');
}
$table->data[6][0] = __('Cascade protection services');

View File

@ -290,7 +290,7 @@ if ($id_agent_module) {
else {
if (!isset ($moduletype)) {
$moduletype = (string) get_parameter ('moduletype');
// Clean up specific network modules fields
$name = '';
$description = '';
@ -316,7 +316,7 @@ else {
$tcp_send = '';
$tcp_rcv = '';
$tcp_port = '';
if ($moduletype == "wmiserver")
$snmp_community = '';
else

View File

@ -570,11 +570,15 @@ $table_advanced->data[7][0] .= ui_print_help_tip(__('The module still stores dat
$table_advanced->data[7][1] = html_print_checkbox('quiet_module', 1, $quiet_module, true, $disabledBecauseInPolicy);
$cps_array[-1] = __('Disabled');
if($cps > 0){
if($cps_module > 0){
$cps_array[$cps_module] = __('Enabled');
}
else{
$cps_array[0] = __('Enabled');
$cps_inc = 0;
if($id_agent_module){
$cps_inc = service_modules_cps($id_agent_module);
}
$cps_array[$cps_inc] = __('Enabled');
}
$table_advanced->data[7][2] = __('Cascade Protection Services');
$table_advanced->data[7][2] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);

View File

@ -82,9 +82,7 @@ if ($update_agents) {
$values['delete_conf'] = get_parameter('delete_conf');
if (get_parameter('quiet_select', -1) != -1)
$values['quiet'] = get_parameter('quiet_select');
if (get_parameter('cps_select', -2) != -2)
$values['cps'] = get_parameter('cps_select');
$fields = db_get_all_fields_in_table('tagent_custom_fields');
if ($fields === false) $fields = array();
@ -394,7 +392,6 @@ $update_gis_data = -1;
$cascade_protection = -1;
$cascade_protection_module = -1;
$quiet_select = -1;
$cps_select = -2;
$table = new StdClass();
$table->width = '100%';
@ -482,19 +479,6 @@ $table->data[6][1] = html_print_select(array(-1 => __('No change'),
1 => __('Yes'), 0 => __('No')),
"quiet_select", $quiet_select, "", '', 0, true);
$cps_array[-2] = __('No change');
$cps_array[-1] = __('Disabled');
if($cps > 0){
$cps_array[$cps_select] = __('Enabled');
}
else{
$cps_array[0] = __('Enabled');
}
$table->data[7][0] = __('Cascade Protection Service');
$table->data[7][0] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
$table->data[7][1] = html_print_select($cps_array, "cps_select", $cps_select, "", '', 0, true);
ui_toggle(html_print_table ($table, true), __('Advanced options'));
unset($table);

View File

@ -636,27 +636,16 @@ $table->data['edit11'][1] = html_print_select(array(-1 => __('No change'),
1 => __('Yes'), 0 => __('No')),
"quiet_select", -1, "", '', 0, true);
$cps_array[-2] = __('No change');
$cps_array[-1] = __('Disabled');
if($cps > 0){
$cps_array[$cps_select] = __('Enabled');
}
else{
$cps_array[0] = __('Enabled');
}
$table->data['edit11'][2] = __('Cascade Protection Service');
$table->data['edit11'][2] .= ui_print_help_tip(__('Disable the alerts and events of the elements that belong to this service'), true);
$table->data['edit11'][3] .= html_print_select($cps_array, "cps_select", -1, "", '', 0, true);
$table->data['edit16'][0] = __('Timeout');
$table->data['edit16'][1] .= html_print_input_text(
$table->data['edit11'][2] = __('Timeout');
$table->data['edit11'][3] = html_print_input_text(
'max_timeout', '', '', 5, 10, true) . ' ' .
ui_print_help_tip (
__('Seconds that agent will wait for the execution of the module.'), true);
$table->data['edit16'][1] .= __('Retries');
$table->data['edit16'][1] .= html_print_input_text ('max_retries', '', '', 5, 10, true) . ' ' .
$table->data['edit16'][0] = __('Retries');
$table->data['edit16'][1] = html_print_input_text ('max_retries', '', '', 5, 10, true) . ' ' .
ui_print_help_tip (
__('Number of retries that the module will attempt to run.'), true);
@ -1521,10 +1510,6 @@ function process_manage_edit ($module_name, $agents_select = null, $module_statu
$values['quiet'] = get_parameter('quiet_select');
}
if (get_parameter('cps_select', -2) != -2) {
$values['cps'] = get_parameter('cps_select');
}
$filter_modules = false;
if (!is_numeric($module_name) or ($module_name != 0))