';
diff --git a/pandora_console/godmode/agentes/fields_manager.php b/pandora_console/godmode/agentes/fields_manager.php
index 25b06e2f5a..53b4995d20 100644
--- a/pandora_console/godmode/agentes/fields_manager.php
+++ b/pandora_console/godmode/agentes/fields_manager.php
@@ -217,6 +217,7 @@ foreach ($fields as $field) {
array_push($table->data, $data);
}
+$tablePagination = '';
if ($fields) {
html_print_table($table);
$tablePagination = ui_pagination($count_fields, false, $offset, 0, true, 'offset', false);
@@ -231,6 +232,9 @@ html_print_action_buttons(
[ 'icon' => 'next' ],
true
),
- ['type' => 'form_action']
+ [
+ 'type' => 'form_action',
+ 'right_content' => $tablePagination,
+ ],
);
echo '';
diff --git a/pandora_console/godmode/agentes/module_manager_editor_common.php b/pandora_console/godmode/agentes/module_manager_editor_common.php
index de08a299de..9c318b4e9f 100644
--- a/pandora_console/godmode/agentes/module_manager_editor_common.php
+++ b/pandora_console/godmode/agentes/module_manager_editor_common.php
@@ -2000,7 +2000,11 @@ ui_require_jquery_file('json');
$('#' + thisLabel).prop('checked', true);
$('#' + thisLabel).siblings().prop('checked', false);
- if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true) {
+ var type_selected = $("#id_module_type").val();
+ var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
+ var type_name_selected = type_names[type_selected];
+
+ if ($('#radius-percentage_warning').prop('checked') === true || $('#radius-percentage_critical').prop('checked') === true || type_name_selected == 'generic_data_string') {
$("#svg_dinamic").hide();
} else {
paint_graph_values();
diff --git a/pandora_console/godmode/alerts/alert_templates.php b/pandora_console/godmode/alerts/alert_templates.php
index 003ec45d03..8236d1e69c 100644
--- a/pandora_console/godmode/alerts/alert_templates.php
+++ b/pandora_console/godmode/alerts/alert_templates.php
@@ -31,13 +31,14 @@ if (is_ajax()) {
return;
}
- echo '
';
+ echo html_print_image('images/info.svg', true, ['class' => 'invert_filter']);
+ echo ui_print_alert_template_example($template['id'], true, true, false);
+ echo '
';
echo alerts_get_alert_templates_type_name($template['type']);
- echo '
';
- echo ui_print_alert_template_example($template['id'], true);
-
echo '
';
if ($template['description'] != '') {
diff --git a/pandora_console/godmode/alerts/configure_alert_action.php b/pandora_console/godmode/alerts/configure_alert_action.php
index 4718689da5..6d33077bf8 100644
--- a/pandora_console/godmode/alerts/configure_alert_action.php
+++ b/pandora_console/godmode/alerts/configure_alert_action.php
@@ -520,7 +520,7 @@ $(document).ready (function () {
name: "id_action",
value: ""
});
-
+
jQuery.post (,
values,
function (data, status) {
@@ -552,6 +552,9 @@ $(document).ready (function () {
// If the row is empty, hide it
if (field_row == '') {
+ // Clear hidden fields.
+ $("[name=field" + i + "_value]").val('');
+ $("[name=field" + i + "_recovery_value]").val('')
$table_macros_field.hide();
continue;
}
diff --git a/pandora_console/godmode/alerts/configure_alert_template.php b/pandora_console/godmode/alerts/configure_alert_template.php
index bbd758d9a9..7365339191 100644
--- a/pandora_console/godmode/alerts/configure_alert_template.php
+++ b/pandora_console/godmode/alerts/configure_alert_template.php
@@ -1240,7 +1240,7 @@ if ($step == 2) {
'priority',
$priority,
'',
- 0,
+ '',
0,
true,
false,
diff --git a/pandora_console/godmode/db/db_main.php b/pandora_console/godmode/db/db_main.php
index 9979b2c224..3bd4052ba2 100644
--- a/pandora_console/godmode/db/db_main.php
+++ b/pandora_console/godmode/db/db_main.php
@@ -27,7 +27,6 @@ if (! check_acl($config['id_user'], 0, 'DM')) {
// Get some general DB stats (not very heavy)
// NOTE: this is not realtime monitoring stats, are more focused on DB sanity
-$stat_access = db_get_sql('SELECT COUNT(*) FROM tagent_access WHERE id_agent != 0');
$stat_data = db_get_sql('SELECT COUNT(*) FROM tagente_datos WHERE id_agente_modulo != 0');
$stat_data_log4x = db_get_sql('SELECT COUNT(*) FROM tagente_datos_log4x WHERE id_agente_modulo != 0');
$stat_data_string = db_get_sql('SELECT COUNT(*) FROM tagente_datos_string WHERE id_agente_modulo != 0');
@@ -149,18 +148,6 @@ echo $stat_modules;
echo '';
-
-echo '
${value}`);
@@ -6725,10 +6777,10 @@ function chooseType() {
$("#row_period_range").hide();
$("#row_agent").hide();
$("#row_module").hide();
- $("#row_period").hide();
$("#row_search").hide();
$("#row_log_number").hide();
$("#row_period1").hide();
+ $("#row_period2").hide();
$("#row_estimate").hide();
$("#row_interval").hide();
$("#row_custom_graph").hide();
@@ -6844,6 +6896,7 @@ function chooseType() {
$("#row_group_by").hide();
$("#row_type_show").hide();
$("#row_use_prefix_notation").hide();
+ $("#row_unknowns_graph").hide();
$("#row_os_selector").hide();
$("#row_os_version_regexp").hide();
$("#row_os_end_of_life").hide();
@@ -6895,7 +6948,7 @@ function chooseType() {
case 'event_report_log':
$("#log_help_tip").css("visibility", "visible");
$("#row_description").show();
- $("#row_period").show();
+ $("#row_period2").show();
$("#row_search").show();
$("#row_log_number").show();
$("#agents_row").show();
@@ -6909,7 +6962,7 @@ function chooseType() {
case 'event_report_log_table':
$("#log_help_tip").css("visibility", "visible");
$("#row_description").show();
- $("#row_period").show();
+ $("#row_period2").show();
$("#row_period_range").show();
$("#row_search").show();
$("#row_log_number").show();
@@ -6936,6 +6989,7 @@ function chooseType() {
$("#row_image_threshold").show();
$("#row_graph_render").show();
$("#row_percentil").show();
+ $("#row_unknowns_graph").show();
// Force type.
if('' === 'new'){
@@ -7904,8 +7958,10 @@ function source_change_agents() {
$("#id_agents3 option").attr("style","display:none");
var params = {};
- params["get_agent_source"] = 1;
+ params["get_agents_by_source"] = 1;
params["page"] = "enterprise/include/ajax/log_viewer.ajax";
+ params["date"] = '';
+ params["sources"] = JSON.stringify(source);
jQuery.ajax({
data: params,
@@ -7914,19 +7970,8 @@ function source_change_agents() {
url: "ajax.php",
async: true,
success: function(data) {
- let source_array = [];
- $.each(data['source'],function(key,value) {
- if (value === source) {
- const split = key.split('-');
- source_array.push(split[1]);
- }
- });
-
- $.each(data['agent'],function(key,value) {
- const result = source_array.includes(key);
- if (result === true) {
- $(`#id_agents3 option[value*='${key}']`).attr("style","display:");
- }
+ $.each(data,function(key,value) {
+ $(`#id_agents3 option[value*='${value}']`).attr("style","display:");
});
$("#spinner_hack").hide();
@@ -7955,7 +8000,7 @@ function dialog_message(message_id) {
}
function control_period_range() {
let value_period_range = $('#row_period_range #hidden-period_range').val();
- let current_value = $('#row_period #hidden-period').val();
+ let current_value = $('#row_period2 #hidden-period').val();
let min_range = (current_value/12);
if(min_range > value_period_range) {
$('#row_period_range div:nth-child(2) select option').removeAttr("selected");
@@ -8003,10 +8048,10 @@ function control_period_range() {
$(document).ready(function () {
$('[id^=period], #combo_graph_options, #combo_sla_sort_options').next().css('z-index', 0);
- $('#row_period input').change(function(e){
+ $('#row_period2 input').change(function(e){
control_period_range();
});
- $('#row_period select').change(function(e){
+ $('#row_period2 select').change(function(e){
control_period_range();
});
$('#row_period_range input').change(function(e){
diff --git a/pandora_console/godmode/reporting/reporting_builder.list_items.php b/pandora_console/godmode/reporting/reporting_builder.list_items.php
index d3fd439181..e92e038dfe 100755
--- a/pandora_console/godmode/reporting/reporting_builder.list_items.php
+++ b/pandora_console/godmode/reporting/reporting_builder.list_items.php
@@ -777,7 +777,7 @@ $table->data[0][0] = html_print_label_input_block(
)
);
$table->data[0][1] = html_print_label_input_block(
- __('Poisition'),
+ __('Position'),
html_print_input_text_extended(
'position_to_delete',
1,
diff --git a/pandora_console/godmode/reporting/reporting_builder.php b/pandora_console/godmode/reporting/reporting_builder.php
index 095f79b14a..e0e06f0f42 100755
--- a/pandora_console/godmode/reporting/reporting_builder.php
+++ b/pandora_console/godmode/reporting/reporting_builder.php
@@ -1928,6 +1928,7 @@ switch ($action) {
$values['graph_render'] = (int) get_parameter(
'graph_render'
);
+ $values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0);
case 'simple_baseline_graph':
// HACK it is saved in show_graph field.
$values['show_graph'] = (int) get_parameter(
@@ -2867,6 +2868,7 @@ switch ($action) {
$values['graph_render'] = (int) get_parameter(
'graph_render'
);
+ $values['check_unknowns_graph'] = get_parameter_switch('unknowns_graph', 0);
case 'simple_baseline_graph':
// HACK it is saved in show_graph field.
$values['show_graph'] = (int) get_parameter(
diff --git a/pandora_console/godmode/reporting/visual_console_builder.data.php b/pandora_console/godmode/reporting/visual_console_builder.data.php
index 5ce3c3f679..f5cc8d059c 100644
--- a/pandora_console/godmode/reporting/visual_console_builder.data.php
+++ b/pandora_console/godmode/reporting/visual_console_builder.data.php
@@ -151,7 +151,7 @@ $table->data[0][] = html_print_label_input_block(
__('Name'),
html_print_input_text(
'name',
- $visualConsoleName,
+ io_safe_output($visualConsoleName),
'',
80,
100,
diff --git a/pandora_console/godmode/reporting/visual_console_builder.php b/pandora_console/godmode/reporting/visual_console_builder.php
index 986dcb423b..694a2a6ea3 100755
--- a/pandora_console/godmode/reporting/visual_console_builder.php
+++ b/pandora_console/godmode/reporting/visual_console_builder.php
@@ -163,7 +163,7 @@ switch ($activeTab) {
$background_color = (string) get_parameter('background_color');
$width = (int) get_parameter('width');
$height = (int) get_parameter('height');
- $visualConsoleName = (string) get_parameter('name');
+ $visualConsoleName = (string) io_safe_input(get_parameter('name'));
$is_favourite = (int) get_parameter('is_favourite_sent');
$auto_adjust = (int) get_parameter('auto_adjust_sent');
@@ -239,7 +239,7 @@ switch ($activeTab) {
if ($uploadOK == 1) {
if (move_uploaded_file($_FILES['background_image']['tmp_name'], $target_file)) {
$background = $nameImage;
- $values['background'] = $background;
+ $values['background'] = io_safe_input($background);
$error2 = chmod($target_file, 0644);
$uploadOK = $error2;
} else {
@@ -872,7 +872,7 @@ $buttons[$activeTab]['active'] = true;
$tab_builder = ($activeTab === 'editor') ? 'visual_console_editor_editor_tab' : '';
ui_print_standard_header(
- ($visualConsoleName ?? ''),
+ (io_safe_output($visualConsoleName) ?? ''),
'images/visual_console.png',
false,
$tab_builder,
diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php
index a2cde656c2..76964a7afa 100644
--- a/pandora_console/godmode/servers/servers.build_table.php
+++ b/pandora_console/godmode/servers/servers.build_table.php
@@ -64,32 +64,33 @@ $table->style = [];
// $table->style[0] = 'font-weight: bold';
$table->align = [];
$table->align[1] = 'center';
-$table->align[3] = 'center';
-$table->align[8] = 'right';
+$table->align[4] = 'center';
+$table->align[9] = 'right';
$table->headstyle[1] = 'text-align:center';
-$table->headstyle[3] = 'text-align:center';
-$table->headstyle[8] = 'text-align:right;width: 120px;';
+$table->headstyle[4] = 'text-align:center';
+$table->headstyle[9] = 'text-align:right;width: 120px;';
$table->titleclass = 'tabletitle';
$table->titlestyle = 'text-transform:uppercase;';
-$table->style[6] = 'display: flex;align-items: center;';
+$table->style[7] = 'display: flex;align-items: center;';
$table->head = [];
$table->head[0] = __('Name');
$table->head[1] = __('Status');
$table->head[2] = __('Type');
-$table->head[3] = __('Version');
-$table->head[4] = __('Modules');
-$table->head[5] = __('Lag').ui_print_help_tip(__('Avg. Delay(sec)/Modules delayed'), true);
-$table->head[6] = __('T/Q').ui_print_help_tip(__('Threads / Queued modules currently'), true);
+$table->head[3] = __('Master');
+$table->head[4] = __('Version');
+$table->head[5] = __('Modules');
+$table->head[6] = __('Lag').ui_print_help_tip(__('Avg. Delay(sec)/Modules delayed'), true);
+$table->head[7] = __('T/Q').ui_print_help_tip(__('Threads / Queued modules currently'), true);
// This will have a column of data such as "6 hours".
-$table->head[7] = __('Updated');
+$table->head[8] = __('Updated');
// Only Pandora Administrator can delete servers.
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
- $table->head[8] = ''.__('Op.').'';
+ $table->head[9] = ''.__('Op.').'';
}
$table->data = [];
@@ -143,9 +144,11 @@ foreach ($servers as $server) {
}
// Type.
- $data[2] = ''.$server['img'];
+ $data[2] = ''.$server['img'].' '.$server['name'];
if ($server['master'] == $master) {
- $data[2] .= ui_print_help_tip(__('This is a master server'), true);
+ $data[3] .= __('Yes', true);
+ } else {
+ $data[3] .= __('-');
}
if ((int) $server['exec_proxy'] === 1) {
@@ -157,27 +160,27 @@ foreach ($servers as $server) {
case 'event':
case 'autoprovision':
case 'migration':
- $data[3] = $server['version'];
- $data[4] = __('N/A');
+ $data[4] = $server['version'];
$data[5] = __('N/A');
+ $data[6] = __('N/A');
break;
case 'export':
- $data[3] = $server['version'];
- $data[4] = $server['modules'].' '.__('of').' '.$server['modules_total'];
- $data[5] = __('N/A');
+ $data[4] = $server['version'];
+ $data[5] = $server['modules'].' '.__('of').' '.$server['modules_total'];
+ $data[6] = __('N/A');
break;
default:
- $data[3] = $server['version'];
- $data[4] = $server['modules'].' '.__('of').' '.$server['modules_total'];
- $data[5] = ''.$server['lag_txt'].'';
+ $data[4] = $server['version'];
+ $data[5] = $server['modules'].' '.__('of').' '.$server['modules_total'];
+ $data[6] = ''.$server['lag_txt'].'';
break;
}
- $data[6] = '';
+ $data[7] = '';
if ($server['queued_modules'] > 500) {
- $data[6] .= ''.html_print_image(
+ $data[7] .= ' ';
}
- $data[6] .= $server['threads'].' : '.$server['queued_modules'];
+ $data[7] .= $server['threads'].' : '.$server['queued_modules'];
- $data[7] = ui_print_timestamp($server['keepalive'], true);
+ $data[8] = ui_print_timestamp($server['keepalive'], true);
if ($server['type'] === 'data') {
$ext = '_server';
@@ -208,11 +211,11 @@ foreach ($servers as $server) {
// Only Pandora Administrator can delete servers.
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
- $data[8] = '';
+ $data[9] = '';
if ($server['type'] === 'recon') {
- $data[8] .= '';
- $data[8] .= html_print_image(
+ $data[9] .= '';
+ $data[9] .= html_print_image(
'images/snmp-trap@svg.svg',
true,
[
@@ -221,12 +224,12 @@ foreach ($servers as $server) {
]
);
- $data[8] .= '';
+ $data[9] .= '';
}
if ($server['type'] === 'data') {
- $data[8] .= ' ';
- $data[8] .= html_print_image(
+ $data[9] .= '';
+ $data[9] .= html_print_image(
'images/force@svg.svg',
true,
[
@@ -234,10 +237,10 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
- $data[8] .= '';
+ $data[9] .= '';
} else if ($server['type'] === 'enterprise snmp') {
- $data[8] .= ' ';
- $data[8] .= html_print_image(
+ $data[9] .= '';
+ $data[9] .= html_print_image(
'images/force@svg.svg',
true,
[
@@ -245,12 +248,12 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
- $data[8] .= '';
+ $data[9] .= '';
}
if ($server['type'] === 'event' && (bool) check_acl($config['id_user'], 0, 'LM') === true) {
- $data[8] .= ' ';
- $data[8] .= html_print_image(
+ $data[9] .= '';
+ $data[9] .= html_print_image(
'images/alert@svg.svg',
true,
[
@@ -258,11 +261,11 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
- $data[8] .= '';
+ $data[9] .= '';
}
- $data[8] .= ' ';
- $data[8] .= html_print_image(
+ $data[9] .= '';
+ $data[9] .= html_print_image(
'images/edit.svg',
true,
[
@@ -270,11 +273,11 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
- $data[8] .= '';
+ $data[9] .= '';
if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) {
- $data[8] .= ' ';
- $data[8] .= html_print_image(
+ $data[9] .= '';
+ $data[9] .= html_print_image(
'images/agents@svg.svg',
true,
[
@@ -282,10 +285,10 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
- $data[8] .= '';
+ $data[9] .= '';
- $data[8] .= ' ';
- $data[8] .= html_print_image(
+ $data[9] .= '';
+ $data[9] .= html_print_image(
'images/remote-configuration@svg.svg',
true,
[
@@ -293,12 +296,12 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
- $data[8] .= '';
+ $data[9] .= '';
$names_servers[$safe_server_name] = false;
}
- $data[8] .= ' ';
- $data[8] .= html_print_image(
+ $data[9] .= '';
+ $data[9] .= html_print_image(
'images/delete.svg',
true,
[
@@ -307,14 +310,14 @@ foreach ($servers as $server) {
'class' => 'main_menu_icon invert_filter',
]
);
- $data[8] .= '';
+ $data[9] .= '';
}
if ($tiny) {
- unset($data[4]);
- unset($data[6]);
+ unset($data[5]);
unset($data[7]);
unset($data[8]);
+ unset($data[9]);
}
$ext = '';
@@ -323,10 +326,10 @@ foreach ($servers as $server) {
}
if ($tiny) {
- unset($table->head[4]);
- unset($table->head[6]);
+ unset($table->head[5]);
unset($table->head[7]);
unset($table->head[8]);
+ unset($table->head[9]);
}
if ($tiny) {
diff --git a/pandora_console/godmode/setup/file_manager.php b/pandora_console/godmode/setup/file_manager.php
index cfcf3c0827..211af66cb7 100644
--- a/pandora_console/godmode/setup/file_manager.php
+++ b/pandora_console/godmode/setup/file_manager.php
@@ -71,6 +71,8 @@ if (isset($config['filemanager']['message']) === true) {
$fallback_directory = 'images';
// Get directory.
$directory = (string) get_parameter('directory');
+$directory = str_replace('<', '', $text);
+$directory = str_replace('>', '', $text);
if (empty($directory) === true) {
$directory = $fallback_directory;
} else {
diff --git a/pandora_console/godmode/setup/os.builder.php b/pandora_console/godmode/setup/os.builder.php
index 2d0e54a681..6313aa3edd 100644
--- a/pandora_console/godmode/setup/os.builder.php
+++ b/pandora_console/godmode/setup/os.builder.php
@@ -46,7 +46,7 @@ if ($idOS > 0) {
$description = $os['description'];
$icon = $os['icon_name'];
} else {
- $name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
+ $name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$icon = get_parameter('icon', 0);
}
@@ -87,9 +87,16 @@ if ($is_management_allowed === true) {
if (in_array($file_ext, $allowed_extensions) === false) {
$message = 9;
+ } else if (exif_imagetype($file_tmp) === false && $file_ext !== 'svg') {
+ $message = 10;
} else {
$message = 8;
- move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
+
+ $file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
+
+ if ($file_uploaded !== true) {
+ $message = 10;
+ }
}
}
} else {
@@ -108,7 +115,7 @@ if ($is_management_allowed === true) {
if ($resultOrId === false) {
$message = 2;
- $tab = 'builder';
+ $tab = 'manage_os';
$actionHidden = 'save';
$textButton = __('Create');
$classButton = ['icon' => 'wand'];
@@ -144,13 +151,19 @@ if ($is_management_allowed === true) {
if (in_array($file_ext, $allowed_extensions) === false) {
$message = 9;
+ } else if (exif_imagetype($file_tmp) === false) {
+ $message = 10;
} else {
$message = 8;
- move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
+ $file_uploaded = move_uploaded_file($file_tmp, $config['homedir'].'/images/os_icons/'.$file_name);
+
+ if ($file_uploaded !== true) {
+ $message = 10;
+ }
}
}
} else {
- $name = io_safe_input(strip_tags(io_safe_output((string) get_parameter('name'))));
+ $name = io_safe_input(strip_tags(trim(io_safe_output((string) get_parameter('name')))));
$description = io_safe_input(strip_tags(io_safe_output((string) get_parameter('description'))));
$icon = get_parameter('icon', 0);
@@ -254,7 +267,7 @@ $table->class = 'databox filter-table-adv';
$table->data[0][] = html_print_label_input_block(
__('Name'),
- html_print_input_text('name', $name, __('Name'), 20, 30, true, false, false, '', 'w250px')
+ html_print_input_text('name', $name, __('Name'), 20, 30, true, false, true, '', 'w250px')
);
$table->data[0][] = html_print_label_input_block(
@@ -290,6 +303,28 @@ html_print_action_buttons(
echo '';
+$id_message = get_parameter('id_message', 0);
+
+if ($id_message !== 0) {
+ switch ($id_message) {
+ case 8:
+ echo ui_print_success_message(__('Icon successfuly uploaded'), '', true);
+ break;
+
+ case 9:
+ echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true);
+ break;
+
+ case 10:
+ echo ui_print_error_message(__('An error ocurrered to upload icon'), '', true);
+ break;
+
+ default:
+ // Nothing to do.
+ break;
+ }
+}
+
function get_list_os_icons_dir()
{
diff --git a/pandora_console/godmode/setup/os.php b/pandora_console/godmode/setup/os.php
index 99402ff30a..dcfe95ecdb 100644
--- a/pandora_console/godmode/setup/os.php
+++ b/pandora_console/godmode/setup/os.php
@@ -162,11 +162,15 @@ if (empty($id_message) === false) {
break;
case 8:
- echo ui_print_success_message(__('Icon successfuly uploaded'), '', true);
+ header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=8');
break;
case 9:
- echo ui_print_error_message(__('File must be of type JPG, JPEG, PNG or SVG'), '', true);
+ header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=9');
+ break;
+
+ case 10:
+ header('Location: index.php?sec=gagente&sec2=godmode/setup/os&tab=manage_os&action=edit&id_message=10');
break;
default:
diff --git a/pandora_console/godmode/setup/performance.php b/pandora_console/godmode/setup/performance.php
index 51cd554a66..870c4c283a 100644
--- a/pandora_console/godmode/setup/performance.php
+++ b/pandora_console/godmode/setup/performance.php
@@ -154,8 +154,7 @@ if ($update_config == 1 && $config['history_db_enabled'] == 1) {
$performance_variables_control = (array) json_decode(io_safe_output($config['performance_variables_control']));
$total_agents = db_get_value('count(*)', 'tagente');
-$disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false;
-
+// $disable_agentaccess = ($total_agents >= 200 && $config['agentaccess'] == 0) ? true : false;
$table_status = new StdClass();
$table_status->width = '100%';
$table_status->class = 'databox filters';
@@ -666,8 +665,8 @@ $table_other->data[2][1] = html_print_label_input_block(
true
)
);
-
-$table_other->data[3][0] = html_print_label_input_block(
+/*
+ $table_other->data[3][0] = html_print_label_input_block(
__('Use agent access graph'),
html_print_checkbox_switch(
'agentaccess',
@@ -676,9 +675,9 @@ $table_other->data[3][0] = html_print_label_input_block(
true,
$disable_agentaccess
)
-);
-
-$table_other->data[3][1] = html_print_label_input_block(
+ );
+*/
+$table_other->data[3][0] = html_print_label_input_block(
__('Max. recommended number of files in attachment directory'),
html_print_input_text(
'num_files_attachment',
diff --git a/pandora_console/godmode/setup/setup.php b/pandora_console/godmode/setup/setup.php
index 0fd6bebff8..6732612c9d 100644
--- a/pandora_console/godmode/setup/setup.php
+++ b/pandora_console/godmode/setup/setup.php
@@ -370,7 +370,7 @@ switch ($section) {
break;
default:
- $subpage = 'seccion: '.$section;
+ $subpage = 'seccion: ';
// Default.
break;
}
diff --git a/pandora_console/godmode/setup/setup_auth.php b/pandora_console/godmode/setup/setup_auth.php
index 40a816a6fa..f9f2afcd14 100644
--- a/pandora_console/godmode/setup/setup_auth.php
+++ b/pandora_console/godmode/setup/setup_auth.php
@@ -535,16 +535,47 @@ html_print_action_buttons(
__('Update'),
'update_button',
false,
- [ 'icon' => 'update' ],
+ [
+ 'icon' => 'update',
+ 'onclick' => 'onFormSubmit()',
+ ],
true
)
);
echo '';
+echo ui_print_warning_message(
+ [
+ 'message' => __('Session timeout must be a number'),
+ 'force_class' => 'invisible js_warning_msg',
+ ],
+ '',
+ true
+);
?>
diff --git a/pandora_console/operation/messages/message_edit.php b/pandora_console/operation/messages/message_edit.php
index d2d3520b2b..cc197960ed 100644
--- a/pandora_console/operation/messages/message_edit.php
+++ b/pandora_console/operation/messages/message_edit.php
@@ -38,7 +38,7 @@ $send_mes = (bool) get_parameter('send_mes', false);
$new_msg = (string) get_parameter('new_msg');
$dst_user = get_parameter('dst_user');
$dst_group = get_parameter('dst_group');
-$subject = io_safe_html_tags(get_parameter('subject'));
+$subject = io_safe_input(get_parameter('subject'));
$message = (string) get_parameter('message');
$read_message = (bool) get_parameter('read_message', false);
$reply = (bool) get_parameter('reply', false);
@@ -132,7 +132,7 @@ if ($read_message) {
echo ' Conversation with '.$user_name.'';
}
- echo ' Subject: '.$message['subject'].'';
+ echo ' Subject: '.io_safe_output($message['subject']).'';
$conversation = messages_get_conversation($message);
diff --git a/pandora_console/operation/messages/message_list.php b/pandora_console/operation/messages/message_list.php
index d7dc2881da..26ffbc5bfe 100644
--- a/pandora_console/operation/messages/message_list.php
+++ b/pandora_console/operation/messages/message_list.php
@@ -259,7 +259,7 @@ if (empty($messages) === true) {
$pathSubject = 'index.php?sec=message_list&sec2=operation/messages/message_edit&read_message=1&id_message='.$message_id;
}
- $contentSubject = (empty($message['subject']) === true) ? __('No Subject') : $message['subject'];
+ $contentSubject = (empty($message['subject']) === true) ? __('No Subject') : io_safe_output($message['subject']);
if ((int) $message['read'] !== 1) {
$contentSubject = ' '.$contentSubject.'';
diff --git a/pandora_console/operation/search_agents.getdata.php b/pandora_console/operation/search_agents.getdata.php
index bdeea391a1..d8182385b2 100644
--- a/pandora_console/operation/search_agents.getdata.php
+++ b/pandora_console/operation/search_agents.getdata.php
@@ -72,6 +72,7 @@ if ($searchAgents) {
$has_secondary = enterprise_hook('agents_is_using_secondary_groups');
$stringSearchSQL = str_replace('&', '&', $stringSearchSQL);
+ $stringSearchSQL = str_replace('\', '\\', $stringSearchSQL);
$sql = "SELECT DISTINCT taddress_agent.id_agent FROM taddress
INNER JOIN taddress_agent ON
taddress.id_a = taddress_agent.id_a
diff --git a/pandora_console/pandora_console.redhat.spec b/pandora_console/pandora_console.redhat.spec
index 9cc8b153c7..ff98edb48f 100644
--- a/pandora_console/pandora_console.redhat.spec
+++ b/pandora_console/pandora_console.redhat.spec
@@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.774
-%define release 231114
+%define release 231127
# User and Group under which Apache is running
%define httpd_name httpd
diff --git a/pandora_console/pandora_console.rhel7.spec b/pandora_console/pandora_console.rhel7.spec
index 40bf38bebc..9f828af5fe 100644
--- a/pandora_console/pandora_console.rhel7.spec
+++ b/pandora_console/pandora_console.rhel7.spec
@@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.774
-%define release 231114
+%define release 231127
# User and Group under which Apache is running
%define httpd_name httpd
diff --git a/pandora_console/pandora_console.spec b/pandora_console/pandora_console.spec
index 85cd826051..eb68cdae6a 100644
--- a/pandora_console/pandora_console.spec
+++ b/pandora_console/pandora_console.spec
@@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.774
-%define release 231114
+%define release 231127
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2
diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql
index dfd2fe0a52..4c527345c0 100644
--- a/pandora_console/pandoradb.sql
+++ b/pandora_console/pandoradb.sql
@@ -293,12 +293,12 @@ CREATE TABLE IF NOT EXISTS `tagente_modulo` (
-- -----------------------------------------------------
-- Table `tagent_access`
-- -----------------------------------------------------
-CREATE TABLE IF NOT EXISTS `tagent_access` (
- `id_agent` INT UNSIGNED NOT NULL DEFAULT 0,
- `utimestamp` BIGINT NOT NULL DEFAULT 0,
- KEY `agent_index` (`id_agent`),
- KEY `idx_utimestamp` USING BTREE (`utimestamp`)
-) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
+-- CREATE TABLE IF NOT EXISTS `tagent_access` (
+-- `id_agent` INT UNSIGNED NOT NULL DEFAULT 0,
+-- `utimestamp` BIGINT NOT NULL DEFAULT 0,
+-- KEY `agent_index` (`id_agent`),
+-- KEY `idx_utimestamp` USING BTREE (`utimestamp`)
+-- ) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
-- -----------------------------------------------------
-- Table `talert_snmp`
@@ -1646,6 +1646,7 @@ CREATE TABLE IF NOT EXISTS `treport_content` (
`cat_security_hardening` INT NOT NULL DEFAULT 0,
`ignore_skipped` INT NOT NULL DEFAULT 0,
`status_of_check` TINYTEXT,
+ `check_unknowns_graph` tinyint DEFAULT '0',
PRIMARY KEY(`id_rc`),
FOREIGN KEY (`id_report`) REFERENCES treport(`id_report`)
ON UPDATE CASCADE ON DELETE CASCADE
diff --git a/pandora_console/pandoradb_data.sql b/pandora_console/pandoradb_data.sql
index 9ce5355361..bfb1d0ee96 100644
--- a/pandora_console/pandoradb_data.sql
+++ b/pandora_console/pandoradb_data.sql
@@ -2648,6 +2648,82 @@ INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'zoom_en_graficas.png','images/tips/');
+INSERT INTO `twidget` (`id`,`class_name`,`unique_name`,`description`,`options`,`page`) VALUES
+ (1,'AgentHive','AgentHive','Agents hive','','AgentHive.php'),
+ (2,'AvgSumMaxMinModule','AvgSumMaxMinModule','Avg|Sum|Max|Min Module Data','','AvgSumMaxMinModule.php'),
+ (3,'BasicChart','BasicChart','Basic chart','','BasicChart.php'),
+ (4,'BlockHistogram','BlockHistogram','Block histogram','','BlockHistogram.php'),
+ (5,'ColorModuleTabs','ColorModuleTabs','Color tabs modules','','ColorModuleTabs.php'),
+ (6,'DataMatrix','DataMatrix','Data Matrix','','DataMatrix.php'),
+ (7,'EventCardboard','EventCardboard','Event cardboard','','EventCardboard.php'),
+ (8,'GroupedMeterGraphs','GroupedMeterGraphs','Grouped meter graphs','','GroupedMeterGraphs.php'),
+ (9,'ModulesByStatus','ModulesByStatus','Modules by status','','ModulesByStatus.php'),
+ (10,'AgentModuleWidget','agent_module','Agent/Module View','','agent_module.php'),
+ (11,'AlertsFiredWidget','alerts_fired','Triggered alerts report','','alerts_fired.php'),
+ (12,'ClockWidget','clock','Clock','','clock.php'),
+ (13,'CustomGraphWidget','custom_graph','Defined custom graph','','custom_graph.php'),
+ (14,'EventsListWidget','events_list','List of latest events','','events_list.php'),
+ (15,'WelcomeWidget','example','Welcome message to Pandora FMS','','example.php'),
+ (16,'GraphModuleHistogramWidget','graph_module_histogram','Module histogram','','graph_module_histogram.php'),
+ (17,'GroupsStatusWidget','groups_status','General group status','','groups_status.php'),
+ (18,'GroupsStatusMapWidget','groups_status_map','Group status map','','groups_status_map.php'),
+ (19,'HeatmapWidget','heatmap','Heatmap','','heatmap.php'),
+ (20,'InventoryWidget','inventory','Inventory','','inventory.php'),
+ (21,'MapsMadeByUser','maps_made_by_user','Visual Console','','maps_made_by_user.php'),
+ (22,'MapsStatusWidget','maps_status','General visual maps report','','maps_status.php'),
+ (23,'ModuleIconWidget','module_icon','Icon and module value','','module_icon.php'),
+ (24,'ModuleStatusWidget','module_status','Module status','','module_status.php'),
+ (25,'ModuleTableValueWidget','module_table_value','Module in a table','','module_table_value.php'),
+ (26,'ModuleValueWidget','module_value','Module value','','module_value.php'),
+ (27,'MonitorHealthWidget','monitor_health','Global health info','','monitor_health.php'),
+ (28,'Netflow','netflow','Netflow','','netflow.php'),
+ (29,'NetworkMapWidget','network_map','Network map','','network_map.php'),
+ (30,'OsQuickReportWidget','os_quick_report','OS quick report','','os_quick_report.php'),
+ (31,'PostWidget','post','Panel with a message','','post.php'),
+ (32,'ReportsWidget','reports','Custom report','','reports.php'),
+ (33,'ServiceMapWidget','service_map','Service map','','service_map.php'),
+ (34,'ServiceViewWidget','service_view','Services view','','service_view.php'),
+ (35,'SingleGraphWidget','single_graph','Agent module graph','','single_graph.php'),
+ (36,'SLAPercentWidget','sla_percent','SLA percentage','','sla_percent.php'),
+ (37,'SystemGroupStatusWidget','system_group_status','Groups status','','system_group_status.php'),
+ (38,'TacticalWidget','tactical','Tactical view','','tactical.php'),
+ (39,'TopNWidget','top_n','Top N of agent modules','','top_n.php'),
+ (40,'TopNEventByGroupWidget','top_n_events_by_group','Top N events by agent','','top_n_events_by_group.php'),
+ (41,'TopNEventByModuleWidget','top_n_events_by_module','Top N events by module','','top_n_events_by_module.php'),
+ (42,'TreeViewWidget','tree_view','Tree view','','tree_view.php'),
+ (43,'UrlWidget','url','URL content','','url.php'),
+ (44,'WuxWidget','wux_transaction','Agent WUX transaction','','wux_transaction.php'),
+ (45,'WuxStatsWidget','wux_transaction_stats','WUX transaction stats','','wux_transaction_stats.php'),
+ (46,'SecurityHardening','security_hardening','Security Hardening','','security_hardening.php');
+
+INSERT INTO `tmap` (`id`,`id_group`,`id_user`,`type`,`subtype`,`name`,`description`,`height`,`width`,`center_x`,`center_y`,`background`,`background_options`,`source_period`,`source`,`source_data`,`generation_method`,`generated`,`filter`,`id_group_map`,`refresh_time`) VALUES (1,'0','admin',0,0,'Sample dynamic map','This is a sample dynamic map.',900,900,0,0,'',0,60,0,'0',6,0,'{\"dont_show_subgroups\":0,\"node_radius\":40,\"x_offs\":\"0\",\"y_offs\":\"0\",\"z_dash\":\"1\",\"node_sep\":\"0.25\",\"rank_sep\":\"0.5\",\"mindist\":\"1\",\"kval\":\"0.3\"}',0,300);
+INSERT INTO `treport` (`id_report`,`id_user`,`name`,`description`,`private`,`id_group`,`custom_logo`,`header`,`first_page`,`footer`,`custom_font`,`id_template`,`id_group_edit`,`metaconsole`,`non_interactive`,`hidden`,`orientation`,`cover_page_render`,`index_render`) VALUES (1,'admin','Sample report #1','This is a sample report, just to show you some general report items.',0,0,NULL,NULL,'<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"><img src="http://localhost/pandora_console//images/pandora_report_logo.png" alt="" width="800" /></p>
<p style="text-align: center;"> </p>
<p style="text-align: center;"><span style="font-size: xx-large;">(_REPORT_NAME_)</span></p>
<p style="text-align: center;"><span style="font-size: large;">(_DATETIME_)</span></p>',NULL,'Lato-Regular.ttf',0,0,0,0,0,'vertical',1,1);
+INSERT INTO `treport_content` (`id_rc`,`id_report`,`id_gs`,`id_agent_module`,`type`,`period`,`period_range`,`order`,`name`,`description`,`id_agent`,`text`,`external_source`,`treport_custom_sql_id`,`header_definition`,`column_separator`,`line_separator`,`time_from`,`time_to`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`,`sunday`,`only_display_wrong`,`top_n`,`top_n_value`,`exception_condition`,`exception_condition_value`,`show_resume`,`order_uptodown`,`show_graph`,`group_by_agent`,`style`,`id_group`,`id_module_group`,`server_name`,`historical_db`,`lapse_calc`,`lapse`,`visual_format`,`hide_no_data`,`recursion`,`show_extended_events`,`total_time`,`time_failed`,`time_in_ok_status`,`time_in_warning_status`,`time_in_unknown_status`,`time_of_not_initialized_module`,`time_of_downtime`,`total_checks`,`checks_failed`,`checks_in_ok_status`,`checks_in_warning_status`,`unknown_checks`,`agent_max_value`,`agent_min_value`,`current_month`,`failover_mode`,`failover_type`,`uncompressed_module`,`summary`,`landscape`,`pagebreak`,`compare_work_time`,`graph_render`,`ipam_network_filter`,`ipam_alive_ips`,`ipam_ip_not_assigned_to_agent`,`macros_definition`,`render_definition`,`use_prefix_notation`,`cat_security_hardening`,`ignore_skipped`,`status_of_check`) VALUES
+ (1,1,0,0,'agents_inventory',300,0,1,'General agent inventory','',0,'<p>This type of report implies loading a lot of data. Therefore it is recommended for scheduled reports, not real-time view.</p>','{\"agent_server_filter\":\"\",\"agents_inventory_display_options\":[\"alias\",\"comentarios\",\"id_grupo\",\"direccion\",\"id_os\",\"estado\"],\"agent_custom_field_filter\":\"\",\"agent_os_filter\":[\"0\"],\"agent_custom_fields\":[\"3\",\"2\",\"1\"],\"agent_status_filter\":[\"-1\"],\"agent_version_filter\":\"\",\"agent_module_search_filter\":\"\",\"agent_group_filter\":\"0\",\"agent_remote_conf\":\"\"}',0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,0,10,0,10,0,0,0,0,'{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":"1","dyn_height":"250"}',0,0,'',0,0,300,0,0,NULL,NULL,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,NULL,NULL,1,0,0,NULL),
+ (2,1,0,0,'top_n',28800,0,2,'Top CPU per agent','',0,'<p>This type of report implies loading a lot of data. Therefore it is recommended for scheduled reports, not real-time view.</p>',NULL,0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,3,10,0,10,0,1,1,0,'{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":"1","dyn_height":"250","text_agent":"Lio=","text_agent_module":"Y3B1Lio="}',0,0,'',0,0,300,0,0,NULL,NULL,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,NULL,NULL,1,0,0,NULL),
+ (3,1,0,0,'event_report_group',21600,0,3,'General event report','This is a sample of not normal events for any agent available in the last 6 hours',0,'<p>This type of report implies loading a lot of data. Therefore it is recommended for scheduled reports, not real-time view.</p>',NULL,0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,0,10,0,10,0,0,0,0,'{"show_in_same_row":0,"hide_notinit_agents":0,"priority_mode":"1","dyn_height":"250","server_multiple":"\"\"","show_summary_group":0,"filter_event_severity":"[\"20\"]","filter_event_type":"[\"all\"]","filter_event_status":"[\"-1\"]","event_graph_by_agent":"1","event_graph_by_user_validator":"1","event_graph_by_criticity":"1","event_graph_validated_vs_unvalidated":0,"event_filter_search":"","event_filter_exclude":"","custom_data_events":"1","label":""}',0,0,'',0,0,300,0,0,NULL,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,NULL,NULL,1,0,0,NULL);
+INSERT INTO `tdashboard` (`id`,`name`,`id_user`,`id_group`,`active`,`cells`,`cells_slideshow`) VALUES
+ (1,'Sample Dashboard #1','',0,0,0,0),
+ (2,'Sample Dashboard #2','',0,0,0,0);
+INSERT INTO `twidget_dashboard` (`id`,`position`,`options`,`order`,`id_dashboard`,`id_widget`,`prop_width`,`prop_height`) VALUES
+ (1,'{\"x\":\"0\",\"y\":\"0\",\"width\":\"4\",\"height\":\"4\"}','{\"title\":\"Agents hive\",\"background\":\"#ffffff\",\"groups\":[\"12,8,4,9,2,10,13,11\"]}',0,1,1,0.32,0.32),
+ (2,'{\"x\":\"4\",\"y\":\"0\",\"width\":\"3\",\"height\":\"4\"}','{\"title\":\"Clock\",\"background\":\"#ffffff\",\"clockType\":\"analogic\"}',1,1,12,0.32,0.32),
+ (3,'{\"x\":\"7\",\"y\":\"0\",\"width\":\"5\",\"height\":\"2\"}','{\"title\":\"Event cardboard\",\"background\":\"#ffffff\",\"eventType\":\"0\",\"maxHours\":\"8\",\"eventStatus\":\"-1\",\"groupId\":[\"0\"],\"severity\":\"4,1,0,5,2,3\",\"nodes\":0}',2,1,7,0.32,0.32),
+ (4,'{\"x\":\"7\",\"y\":\"2\",\"width\":\"5\",\"height\":\"2\"}','{\"title\":\"Heatmap\",\"background\":\"#ffffff\",\"search\":\"\",\"type\":\"3\",\"groups\":[\"0\"]}',3,1,19,0.32,0.32),
+ (5,'{\"x\":\"0\",\"y\":\"4\",\"width\":\"4\",\"height\":\"6\"}','{\"title\":\"Groups status\",\"background\":\"#ffffff\",\"groupId\":[\"0\"],\"status\":[\"4,1,0,2\"],\"groupRecursion\":false}',4,1,37,0.32,0.32),
+ (6,'{\"x\":\"4\",\"y\":\"4\",\"width\":\"3\",\"height\":\"6\"}','{\"title\":\"Unknown Group overview\",\"background\":\"#ffffff\",\"groupId\":\"10\",\"groupRecursion\":0}',5,1,17,0.32,0.32),
+ (7,'{\"x\":\"7\",\"y\":\"4\",\"width\":\"5\",\"height\":\"6\"}','{\"title\":\"CPU Status\",\"background\":\"#ffffff\",\"search\":\"cpu\",\"status\":\"1,0,2\",\"limit\":\"5\",\"nodes\":\"\",\"disabled_modules\":1}',6,1,9,0.32,0.32),
+ (8,'{\"x\":\"0\",\"y\":\"0\",\"width\":\"6\",\"height\":\"13\"}','{\"title\":\"Last event view\",\"background\":\"#ffffff\",\"eventType\":\"0\",\"maxHours\":\"24\",\"limit\":40,\"eventStatus\":\"-1\",\"severity\":\"-1\",\"groupId\":[\"0\"],\"tagsId\":[\"\"],\"groupRecursion\":0,\"customFilter\":\"-1\",\"columns_events_widget\":[\"mini_severity,evento,estado,agent_name,timestamp\",\"\"]}',0,2,14,0.32,0.32),
+ (9,'{\"x\":\"6\",\"y\":\"0\",\"width\":\"4\",\"height\":\"4\"}','{\"title\":\"Tactical view\",\"background\":\"#ffffff\",\"statusMonitor\":1,\"serverPerformance\":1,\"summary\":1,\"groupId\":[\"0\"]}',1,2,38,0.32,0.32),
+ (10,'{\"x\":\"6\",\"y\":\"4\",\"width\":\"3\",\"height\":\"4\"}','{\"title\":\"Top N events per agent\",\"background\":\"#ffffff\",\"amountShow\":\"10\",\"maxHours\":\"8\",\"groupId\":[\"0\"],\"legendPosition\":\"bottom\",\"show_total_data\":0}',3,2,40,0.32,0.32),
+ (11,'{\"x\":\"10\",\"y\":\"0\",\"width\":\"2\",\"height\":\"4\"}','{\"title\":\"Dynamic map\",\"background\":\"#ffffff\",\"networkmapId\":\"1\",\"xOffset\":\"0\",\"yOffset\":\"0\",\"zoomLevel\":0.6}',2,2,29,0.32,0.32),
+ (12,'{\"x\":\"9\",\"y\":\"4\",\"width\":\"3\",\"height\":\"4\"}','{\"title\":\"Fired alerts\",\"background\":\"#ffffff\",\"groupId\":\"0\",\"group_recursion\":\"\"}',4,2,11,0.32,0.32),
+ (13,'{\"x\":\"0\",\"y\":\"13\",\"width\":\"6\",\"height\":\"3\"}','{\"title\":\"Infrastructure treeview\",\"background\":\"#ffffff\",\"typeTree\":\"group\",\"groupId\":\"0\",\"openAllGroups\":1,\"agentStatus\":\"-1\",\"filterAgent\":\"\",\"moduleStatus\":\"6\",\"filterModule\":\"\"}',7,2,42,0.32,0.32),
+ (14,'{\"x\":\"6\",\"y\":\"8\",\"width\":\"6\",\"height\":\"4\"}','{\"title\":\"Top N events per module\",\"background\":\"#ffffff\",\"amountShow\":\"10\",\"maxHours\":\"8\",\"groupId\":[\"0\"],\"legendPosition\":\"bottom\"}',5,2,41,0.32,0.32),
+ (15,'{\"x\":\"6\",\"y\":\"12\",\"width\":\"6\",\"height\":\"4\"}',NULL,6,2,30,0.32,0.32),
+ (16,'{\"x\":\"0\",\"y\":\"16\",\"width\":\"4\",\"height\":\"4\"}','{\"title\":\"\",\"background\":\"#ffffff\",\"agentId\":0}',8,2,15,0.32,0.32),
+ (17,'{\"x\":\"4\",\"y\":\"16\",\"width\":\"8\",\"height\":\"4\"}','{\"title\":\"Top10 CPU Modules per agent\",\"background\":\"#ffffff\",\"agent\":\".*\",\"module\":\"CPU\",\"period\":\"86400\",\"quantity\":\"10\",\"order\":\"1\",\"display\":\"0\",\"type_graph\":\"bar_vertical\",\"legend\":\"agent\"}',9,2,39,0.32,0.32);
+
-- Insert new VMware APP
SET @short_name = 'pandorafms.vmware';
SET @name = 'VMware';
diff --git a/pandora_console/update_manager_client/lib/UpdateManager/Client.php b/pandora_console/update_manager_client/lib/UpdateManager/Client.php
index 42d9e6367a..c75c84fefb 100644
--- a/pandora_console/update_manager_client/lib/UpdateManager/Client.php
+++ b/pandora_console/update_manager_client/lib/UpdateManager/Client.php
@@ -763,6 +763,126 @@ class Client
}
+ /**
+ * Executes a curl request.
+ *
+ * @param string $url Url to be called.
+ * @param array $request Options.
+ * @param string $destiny Path.
+ *
+ * @return mixed Response given by curl.
+ */
+ private function curlSaveToDisk(string $url, array $request, string $destiny)
+ {
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_setopt($ch, CURLOPT_POST, true);
+ curl_setopt(
+ $ch,
+ CURLOPT_POSTFIELDS,
+ $request
+ );
+
+ // Abre el archivo en modo escritura para guardar la respuesta.
+ $archivo = fopen($destiny, 'w');
+
+ // Configura cURL para guardar la respuesta directamente en el archivo.
+ curl_setopt($ch, CURLOPT_FILE, $archivo);
+
+ if ($this->insecure === true) {
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+ }
+
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
+ curl_setopt($ch, CURLOPT_TCP_KEEPALIVE, true);
+
+ if (is_array($this->proxy) === true) {
+ curl_setopt($ch, CURLOPT_PROXY, $this->proxy['host']);
+ if (isset($this->proxy['port']) === true) {
+ curl_setopt($ch, CURLOPT_PROXYPORT, $this->proxy['port']);
+ }
+
+ if (isset($this->proxy['user']) === true) {
+ curl_setopt(
+ $ch,
+ CURLOPT_PROXYUSERPWD,
+ $this->proxy['user'].':'.$this->proxy['password']
+ );
+ }
+ }
+
+ // Track progress.
+ if ((empty($request) === true
+ || $request['action'] === 'get_package'
+ || $request['action'] === 'get_server_package')
+ ) {
+ curl_setopt(
+ $ch,
+ CURLOPT_NOPROGRESS,
+ false
+ );
+ }
+
+ $target = '';
+ if ($request['action'] === 'get_server_package') {
+ $target = __('server update %s', $request['version']);
+ } else if ($request['action'] === 'get_package') {
+ $target = __('console update %s', $request['version']);
+ }
+
+ // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.Found
+ // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed
+ // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
+ curl_setopt(
+ $ch,
+ CURLOPT_PROGRESSFUNCTION,
+ function (
+ $ch,
+ $total_bytes,
+ $current_bytes,
+ $total_sent_bytes,
+ $current_sent_bytes
+ ) use ($target) {
+ if ($total_bytes > 0) {
+ $this->notify(
+ (100 * $current_bytes / $total_bytes),
+ __(
+ 'Downloading %s %.2f/ %.2f MB.',
+ $target,
+ ($current_bytes / (1024 * 1024)),
+ ($total_bytes / (1024 * 1024))
+ ),
+ true
+ );
+ } else {
+ $this->notify(
+ 0,
+ __(
+ 'Downloading %.2f MB',
+ ($current_bytes / (1024 * 1024))
+ ),
+ true
+ );
+ }
+ }
+ );
+
+ // Call.
+ curl_exec($ch);
+
+ $erro_no = curl_errno($ch);
+ if ($erro_no > 0) {
+ $this->lastError = $erro_no.':'.curl_error($ch);
+ return null;
+ }
+
+ fclose($archivo);
+ curl_close($ch);
+ return true;
+ }
+
+
/**
* Make a request to Update manager.
*
@@ -810,14 +930,26 @@ class Client
}
}
- // Initialize.
- $response = $this->curl(
- $this->url,
- array_merge(
- ['action' => $request['action']],
- $request['arguments']
- )
- );
+ if ($request['action'] === 'get_server_package') {
+ // Initialize.
+ $response = $this->curlSaveToDisk(
+ $this->url,
+ array_merge(
+ ['action' => $request['action']],
+ $request['arguments']
+ ),
+ ($request['destiny'] ?? '')
+ );
+ } else {
+ // Initialize.
+ $response = $this->curl(
+ $this->url,
+ array_merge(
+ ['action' => $request['action']],
+ $request['arguments']
+ )
+ );
+ }
if ($literal === true) {
return $response;
@@ -1393,10 +1525,6 @@ class Client
) {
unlink($file);
$processed[$file] = 'removed';
- } else if (is_dir($file) === true) {
- $processed[$file] = 'skipped, is a directory';
- } else {
- $processed[$file] = 'skipped. Unreachable.';
}
}
@@ -1836,6 +1964,9 @@ class Client
return false;
}
+ $this->notify(100, 'Updated files', true, ['reload' => true]);
+ sleep(2);
+
if ($this->globalTask === null && $this->offline === false) {
$this->percentage = 90;
$this->currentTask = __('Retrieving server update');
@@ -1985,6 +2116,10 @@ class Client
} while ($rc !== null);
}
+ if ($this->lock() !== true) {
+ return null;
+ }
+
$last_error = $this->lastError;
$this->updateServerPackage(null, $this->currentPackage);
@@ -1995,6 +2130,7 @@ class Client
$this->percentage = 100;
$this->notify(100, 'Updated to '.$this->getVersion().'.');
+ $this->unlock();
return $this->currentPackage;
}
@@ -2133,30 +2269,21 @@ class Client
}
if ($package === null) {
- // Retrieve package from UMS.
- $this->notify(0, 'Downloading server update '.$version);
- $file = $this->post(
- [
- 'action' => 'get_server_package',
- 'arguments' => ['version' => $version],
- ],
- 1
- );
-
- if (empty($file) === true) {
- // No content.
- return false;
- }
-
$file_name = 'pandorafms_server-'.$version.'.tar.gz';
$official_name = 'pandorafms_server_enterprise-7.0NG.%s_x86_64.tar.gz';
$filename_repo = sprintf($official_name, $version);
$official_path = $file_path.$filename_repo;
- if (file_put_contents($official_path, $file) === false) {
- $this->lastError = 'Failed to store server update package.';
- return false;
- }
+ // Retrieve package from UMS.
+ $this->notify(0, 'Downloading server update '.$version);
+ $this->post(
+ [
+ 'action' => 'get_server_package',
+ 'arguments' => ['version' => $version],
+ 'destiny' => $official_path,
+ ],
+ 1
+ );
$signature = $this->post(
[
diff --git a/pandora_console/update_manager_client/resources/javascript/umc.js b/pandora_console/update_manager_client/resources/javascript/umc.js
index ec87cf2c63..8cc3a2a971 100644
--- a/pandora_console/update_manager_client/resources/javascript/umc.js
+++ b/pandora_console/update_manager_client/resources/javascript/umc.js
@@ -328,11 +328,11 @@ function updateProgress(url, auth) {
}
if (general_label.innerText == "100.00 %") {
- cleanExit();
+ window.onbeforeunload = undefined;
if (_auxIntervalReference != null) {
window.clearInterval(_auxIntervalReference);
}
- return;
+ window.location.reload();
}
ajax({
@@ -375,6 +375,19 @@ function updateProgress(url, auth) {
general_action.innerText = d.result.processing;
task_action.innerText = d.result.message;
+
+ // Reload to update console.
+ if (
+ d.result.extra != undefined &&
+ d.result.extra.reload != undefined &&
+ d.result.extra.reload === true
+ ) {
+ window.onbeforeunload = undefined;
+ if (_auxIntervalReference != null) {
+ window.clearInterval(_auxIntervalReference);
+ }
+ window.location.reload();
+ }
},
error: function(d) {
dprog.innerHTML = umErrorMsg(d.error);
diff --git a/pandora_console/update_manager_client/views/online.php b/pandora_console/update_manager_client/views/online.php
index 0adbb9decf..ad071bb8c4 100644
--- a/pandora_console/update_manager_client/views/online.php
+++ b/pandora_console/update_manager_client/views/online.php
@@ -27,7 +27,9 @@
* GNU General Public License for more details.
* ============================================================================
*/
+
global $config;
+
?>
@@ -57,16 +59,25 @@ global $config;
$settings = update_manager_get_config_values();
$umc = new \UpdateManager\Client($settings);
$updates = $umc->listUpdates();
+ if ($updates === null) {
+ $updates = [];
+ }
+
$text_for_next_version = '';
$text_for_last_version = '';
$back_up_url = 'index.php?sec=gextensions&sec2=enterprise/godmode/manage_backups';
- if ($updates[0]['lts'] === true) {
+ if (isset($updates[0]['lts']) === true
+ && $updates[0]['lts'] === true
+ ) {
$text_for_next_version = __('Attention. You are about to install an LTS version. LTS versions are the most stable and are released twice a year. Before installing this LTS version, please make sure you have an up-to-date backup.');
} else {
$text_for_next_version = __('Attention. You are about to install an RRR version. This version may contain new features and changes, so its installation is not recommended if you are looking for maximum system stability. LTS versions are the most stable and are released twice a year. Before installing this RRR version, please make sure you have an up-to-date backup.');
}
- if ($updates[array_key_last($updates)]['lts'] === true) {
+ if (isset($updates[array_key_last($updates)]) === true
+ && isset($updates[array_key_last($updates)]['lts']) === true
+ && $updates[array_key_last($updates)]['lts'] === true
+ ) {
$text_for_last_version = __('Attention. You are about to install an LTS version. LTS versions are the most stable and are released twice a year. Before installing this LTS version, please make sure you have an up-to-date backup.');
} else {
$text_for_last_version = __('Attention. You are about to install an RRR version. This version may contain new features and changes, so its installation is not recommended if you are looking for maximum system stability. LTS versions are the most stable and are released twice a year. Before installing this RRR version, please make sure you have an up-to-date backup.');
@@ -160,14 +171,19 @@ global $config;
}
},
error: function(e, r) {
- if (typeof r != "undefined" ) {
- result.innerHTML = umErrorMsg(
- '' + nextUpdateVersion+' '+r
- );
+ if(e != '504') {
+ if (typeof r != "undefined" ) {
+ result.innerHTML = umErrorMsg(
+ '' + nextUpdateVersion+' '+r
+ );
+ } else {
+ result.innerHTML = umErrorMsg(
+ '' + nextUpdateVersion+' RC'+e
+ );
+ }
} else {
- result.innerHTML = umErrorMsg(
- '' + nextUpdateVersion+' RC'+e
- );
+ cleanExit();
+ window.location.reload();
}
},
});
@@ -202,12 +218,17 @@ global $config;
}
},
error: function(e, r) {
- if (typeof r != "undefined" ) {
- result.innerHTML = umErrorMsg(r);
+ if(e != '504') {
+ if (typeof r != "undefined" ) {
+ result.innerHTML = umErrorMsg(r);
+ } else {
+ result.innerHTML = umErrorMsg(
+ ' RC'+e
+ );
+ }
} else {
- result.innerHTML = umErrorMsg(
- ' RC'+e
- );
+ cleanExit();
+ window.location.reload();
}
},
});
diff --git a/pandora_console/views/dashboard/list.php b/pandora_console/views/dashboard/list.php
index 2645724a6e..aae6778f6d 100644
--- a/pandora_console/views/dashboard/list.php
+++ b/pandora_console/views/dashboard/list.php
@@ -75,144 +75,69 @@ if (empty($dashboards) === true) {
]
);
} else {
- $table = new stdClass();
- $table->width = '100%';
- $table->class = 'info_table';
- $table->headstyle['name'] = 'text-align: left;';
- $table->headstyle['cells'] = 'text-align: center;';
- $table->headstyle['groups'] = 'text-align: center;';
- $table->headstyle['favorite'] = 'text-align: center;';
- $table->headstyle['full_screen'] = 'text-align: center;';
-
- $table->style = [];
- $table->style['name'] = 'text-align: left;';
- $table->style['cells'] = 'text-align: center;';
- $table->style['groups'] = 'text-align: center;';
- $table->style['favorite'] = 'text-align: center;';
- $table->style['full_screen'] = 'text-align: center;';
-
- $table->size = [];
- $table->size['name'] = '40%';
- $table->size['full_screen'] = '30px';
-
- $table->head = [];
- $table->head['name'] = __('Name');
- $table->head['cells'] = __('Cells');
- $table->head['groups'] = __('Group');
- $table->head['favorite'] = __('Favorite');
- $table->head['full_screen'] = __('Full screen');
+ $id_table = 'dashboards_list';
+ $columns = [
+ 'name',
+ 'cells',
+ 'groups',
+ 'favorite',
+ 'full_screen',
+ ];
+ $column_names = [
+ __('Name'),
+ __('Cells'),
+ __('Group'),
+ __('Favorite'),
+ __('Full screen'),
+ ];
if ($manageDashboards === 1) {
- $table->head['copy'] = __('Copy');
- $table->head['delete'] = __('Delete');
- $table->headstyle['copy'] = 'text-align: center;';
- $table->headstyle['delete'] = 'text-align: center;';
- $table->style['copy'] = 'text-align: center;';
- $table->style['delete'] = 'text-align: center;';
- $table->size['cells'] = '30px';
- $table->size['groups'] = '30px';
- $table->size['favorite'] = '30px';
- $table->size['copy'] = '30px';
- $table->size['delete'] = '30px';
- } else {
- $table->size['cells'] = '60px';
- $table->size['groups'] = '60px';
- $table->size['favorite'] = '60px';
+ $columns[] = 'copy';
+ $columns[] = 'delete';
+ $column_names[] = __('Copy');
+ $column_names[] = __('Delete');
}
- $table->data = [];
-
- foreach ($dashboards as $dashboard) {
- $data = [];
-
- $dataQuery = ['dashboardId' => $dashboard['id']];
-
- $url = $urlDashboard.'&'.http_build_query($dataQuery);
- $data['name'] = ' ';
- $data['name'] .= $dashboard['name'];
- $data['name'] .= '';
-
- $data['cells'] = $dashboard['cells'];
-
- if (empty($dashboard['id_user']) === false) {
- $data['groups'] = __(
- 'Private for (%s)',
- $dashboard['id_user']
- );
- } else {
- $data['groups'] = ui_print_group_icon(
- $dashboard['id_group'],
- true
- );
- }
-
- $data['favorite'] = $dashboard['active'];
-
- $dataQueryFull = [
- 'dashboardId' => $dashboard['id'],
- 'pure' => 1,
- ];
-
- $urlFull = $urlDashboard;
- $urlFull .= '&'.\http_build_query($dataQueryFull);
- $data['full_screen'] = ' ';
- $data['full_screen'] .= \html_print_image(
- 'images/fullscreen@svg.svg',
- true,
- ['class' => 'main_menu_icon invert_filter']
- );
- $data['full_screen'] .= '';
-
- if ($manageDashboards === 1) {
- $data['copy'] = '';
- $data['delete'] = '';
- }
-
- if (check_acl_restricted_all($config['id_user'], $dashboard['id_group'], 'RM')) {
- $dataQueryCopy = [
- 'dashboardId' => $dashboard['id'],
- 'copyDashboard' => 1,
- ];
- $urlCopy = $urlDashboard.'&'.\http_build_query($dataQueryCopy);
- $data['copy'] = ' ';
- $data['copy'] .= html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']);
- $data['copy'] .= '';
-
- $dataQueryDelete = [
- 'dashboardId' => $dashboard['id'],
- 'deleteDashboard' => 1,
- ];
- $urlDelete = $urlDashboard;
- $urlDelete .= '&'.\http_build_query($dataQueryDelete);
- $data['delete'] = ' ';
- $data['delete'] .= \html_print_image(
- 'images/delete.svg',
- true,
- ['class' => 'main_menu_icon invert_filter']
- );
- $data['delete'] .= '';
- }
-
- $table->cellclass[] = [
- 'full_screen' => 'table_action_buttons',
- 'copy' => 'table_action_buttons',
- 'delete' => 'table_action_buttons',
- ];
-
- $table->data[] = $data;
- }
-
- \html_print_table($table);
- $tablePagination = \ui_pagination(
- $count,
- false,
- $offset,
- 0,
- true,
- 'offset',
- false,
- ''
+ ui_print_datatable(
+ [
+ 'id' => $id_table,
+ 'class' => 'info_table',
+ 'style' => 'width: 100%',
+ 'columns' => $columns,
+ 'column_names' => $column_names,
+ 'ajax_url' => 'include/ajax/dashboard.ajax',
+ 'ajax_data' => [
+ 'method' => 'draw',
+ 'urlDashboard' => $urlDashboard,
+ 'manageDashboards' => $manageDashboards,
+ ],
+ 'default_pagination' => $config['block_size'],
+ 'no_sortable_columns' => [],
+ 'order' => [
+ 'field' => 'name',
+ 'direction' => 'desc',
+ ],
+ 'search_button_class' => 'sub filter float-right',
+ 'form' => [
+ 'inputs' => [
+ [
+ 'label' => __('Name'),
+ 'type' => 'text',
+ 'class' => 'w80p',
+ 'id' => 'free_search',
+ 'name' => 'free_search',
+ ],
+ [
+ 'label' => __('Group'),
+ 'type' => 'select_groups',
+ 'id' => 'group',
+ 'name' => 'group',
+ ],
+ ],
+ ],
+ 'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar',
+ 'csv' => false,
+ ]
);
}
diff --git a/pandora_console/views/dashboard/tipsWindow.php b/pandora_console/views/dashboard/tipsWindow.php
index b9ff3f2420..573a11abcc 100644
--- a/pandora_console/views/dashboard/tipsWindow.php
+++ b/pandora_console/views/dashboard/tipsWindow.php
@@ -72,37 +72,36 @@ $output .= ' '.$title.'';
$output .= ' ';
$output .= $text;
$output .= ' ';
-
-$link_class = 'invisible';
+$disabled_class = 'disabled_button';
+$disabled = true;
if (empty($url) === false && $url !== '') {
- $link_class = '';
+ $disabled_class = '';
+ $disabled = false;
}
-$output .= ' '.__('See more info').'';
-
$output .= ' ';
$output .= ' |