Merge branch 'develop' into ent-12459-16599-vista-de-monitoring-vmware-view-no-muestra-informacion-del-datacenter-ni-el-data

This commit is contained in:
Daniel Cebrian 2023-11-22 12:55:24 +01:00
commit 3f593976cd
42 changed files with 760 additions and 253 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.774-231115 Version: 7.0NG.774-231122
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.774-231115" pandora_version="7.0NG.774-231122"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1039,7 +1039,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.774'; use constant AGENT_VERSION => '7.0NG.774';
use constant AGENT_BUILD => '231115'; use constant AGENT_BUILD => '231122';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.774 %define version 7.0NG.774
%define release 231115 %define release 231122
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin %define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux %define source_name pandorafms_agent_linux
%define version 7.0NG.774 %define version 7.0NG.774
%define release 231115 %define release 231122
%define debug_package %{nil} %define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version Summary: Pandora FMS Linux agent, binary version

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin %define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux %define source_name pandorafms_agent_linux
%define version 7.0NG.774 %define version 7.0NG.774
%define release 231115 %define release 231122
%define debug_package %{nil} %define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version Summary: Pandora FMS Linux agent, binary version

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin %define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux %define source_name pandorafms_agent_linux
%define version 7.0NG.774 %define version 7.0NG.774
%define release 231115 %define release 231122
Summary: Pandora FMS Linux agent, binary version Summary: Pandora FMS Linux agent, binary version
Name: %{name} Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_agent_linux %define name pandorafms_agent_linux
%define version 7.0NG.774 %define version 7.0NG.774
%define release 231115 %define release 231122
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.774" PI_VERSION="7.0NG.774"
PI_BUILD="231115" PI_BUILD="231122"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{231115} {231122}
ViewReadme ViewReadme
{Yes} {Yes}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.774 Build 231115") #define PANDORA_VERSION ("7.0NG.774 Build 231122")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Pandora FMS" VALUE "LegalCopyright", "Pandora FMS"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.774(Build 231115))" VALUE "ProductVersion", "(7.0NG.774(Build 231122))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.774-231115 Version: 7.0NG.774-231122
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.774-231115" pandora_version="7.0NG.774-231122"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -269,15 +269,14 @@ $size_pagination .= '</div>';
// Home screen. // Home screen.
$home_screen = '<div class="label_select"><p class="edit_user_labels">'.__('Home screen').ui_print_help_tip(__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 to show agent detail view'), true).'</p>'; $home_screen = '<div class="label_select"><p class="edit_user_labels">'.__('Home screen').ui_print_help_tip(__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 to show agent detail view'), true).'</p>';
$values = [ $values = [
'-1' => __('No change'), HOME_SCREEN_DEFAULT => __('Default'),
'Default' => __('Default'), HOME_SCREEN_VISUAL_CONSOLE => __('Visual console'),
'Visual console' => __('Visual console'), HOME_SCREEN_EVENT_LIST => __('Event list'),
'Event list' => __('Event list'), HOME_SCREEN_GROUP_VIEW => __('Group view'),
'Group view' => __('Group view'), HOME_SCREEN_TACTICAL_VIEW => __('Tactical view'),
'Tactical view' => __('Tactical view'), HOME_SCREEN_ALERT_DETAIL => __('Alert detail'),
'Alert detail' => __('Alert detail'), HOME_SCREEN_OTHER => __('Other'),
'Other' => __('Other'), HOME_SCREEN_DASHBOARD => __('Dashboard'),
'Dashboard' => __('Dashboard'),
]; ];
$home_screen .= html_print_select( $home_screen .= html_print_select(

View File

@ -80,12 +80,17 @@ $options_agents = [
]; ];
if (check_acl($config['id_user'], 0, 'UM')) { if (check_acl($config['id_user'], 0, 'UM')) {
$options_users['edit_users'] = __('Edit users in bulk'); $options_users = [
'edit_users' => __('Edit users in bulk'),
];
if (is_metaconsole() === false) { if (is_metaconsole() === false) {
$options_users = [ $options_profiles = [
'add_profiles' => __('Bulk profile add'), 'add_profiles' => __('Bulk profile add'),
'delete_profiles' => __('Bulk profile delete'), 'delete_profiles' => __('Bulk profile delete'),
]; ];
$options_users = array_merge(array_slice($options_users, 0, count($options_users)), $options_profiles, array_slice($options_users, count($options_users)));
} }
} else { } else {
$options_users = []; $options_users = [];

View File

@ -1589,7 +1589,7 @@ if (is_metaconsole() === true) {
<?php <?php
html_print_extended_select_for_time( html_print_extended_select_for_time(
'period', 'period',
$period, (string) $period,
'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')', 'check_period_warning(this, \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')',
'', '',
'0', '0',
@ -1697,6 +1697,39 @@ if (is_metaconsole() === true) {
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_period2" class="datos">
<td class="bolder">
<?php
echo __('Time lapse');
ui_print_help_tip(
__('This is the range, or period of time over which the report renders the information for this report type. For example, a week means data from a week ago from now. ')
);
?>
</td>
<td >
<?php
html_print_extended_select_for_time(
'period',
(string) $period,
'onselect=loadLogAgents();',
'',
'0',
10,
false,
false,
false,
'',
false,
false,
'',
false,
0,
null,
'check_period_warning_manual(\'period\', \''.__('Warning').'\', \''.__('Displaying items with extended historical data can have an impact on system performance. We do not recommend that you use intervals longer than 30 days, especially if you combine several of them in a report, dashboard or visual console.').'\')'
);
?>
</td>
</tr>
<tr id="row_estimate" class="datos"> <tr id="row_estimate" class="datos">
<td class="bolder"> <td class="bolder">
<?php <?php
@ -6685,7 +6718,7 @@ function loadLogAgents() {
params["get_agent_source"] = 1; params["get_agent_source"] = 1;
params["log_alert"] = 1; params["log_alert"] = 1;
params["page"] = "enterprise/include/ajax/log_viewer.ajax"; params["page"] = "enterprise/include/ajax/log_viewer.ajax";
params["date"] = $('#period_select').val();
jQuery.ajax({ jQuery.ajax({
data: params, data: params,
dataType: "json", dataType: "json",
@ -6693,9 +6726,9 @@ function loadLogAgents() {
url: "ajax.php", url: "ajax.php",
async: true, async: true,
success: function(data) { success: function(data) {
$('#id_agents3') $('#id_agents3').find('option').remove();
.find('option') $('#source option[value!=""]').remove();
.remove();
$.each(data['source'],function(key,value) { $.each(data['source'],function(key,value) {
if (value === source) { if (value === source) {
$('#source').append( `<option selected='selected' value='${key}'>${value}</option>`); $('#source').append( `<option selected='selected' value='${key}'>${value}</option>`);
@ -6725,10 +6758,10 @@ function chooseType() {
$("#row_period_range").hide(); $("#row_period_range").hide();
$("#row_agent").hide(); $("#row_agent").hide();
$("#row_module").hide(); $("#row_module").hide();
$("#row_period").hide();
$("#row_search").hide(); $("#row_search").hide();
$("#row_log_number").hide(); $("#row_log_number").hide();
$("#row_period1").hide(); $("#row_period1").hide();
$("#row_period2").hide();
$("#row_estimate").hide(); $("#row_estimate").hide();
$("#row_interval").hide(); $("#row_interval").hide();
$("#row_custom_graph").hide(); $("#row_custom_graph").hide();
@ -6895,7 +6928,7 @@ function chooseType() {
case 'event_report_log': case 'event_report_log':
$("#log_help_tip").css("visibility", "visible"); $("#log_help_tip").css("visibility", "visible");
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period2").show();
$("#row_search").show(); $("#row_search").show();
$("#row_log_number").show(); $("#row_log_number").show();
$("#agents_row").show(); $("#agents_row").show();
@ -6909,7 +6942,7 @@ function chooseType() {
case 'event_report_log_table': case 'event_report_log_table':
$("#log_help_tip").css("visibility", "visible"); $("#log_help_tip").css("visibility", "visible");
$("#row_description").show(); $("#row_description").show();
$("#row_period").show(); $("#row_period2").show();
$("#row_period_range").show(); $("#row_period_range").show();
$("#row_search").show(); $("#row_search").show();
$("#row_log_number").show(); $("#row_log_number").show();
@ -7904,8 +7937,10 @@ function source_change_agents() {
$("#id_agents3 option").attr("style","display:none"); $("#id_agents3 option").attr("style","display:none");
var params = {}; var params = {};
params["get_agent_source"] = 1; params["get_agents_by_source"] = 1;
params["page"] = "enterprise/include/ajax/log_viewer.ajax"; params["page"] = "enterprise/include/ajax/log_viewer.ajax";
params["date"] = '<?php echo SECONDS_1MONTH; ?>';
params["sources"] = JSON.stringify(source);
jQuery.ajax({ jQuery.ajax({
data: params, data: params,
@ -7914,19 +7949,8 @@ function source_change_agents() {
url: "ajax.php", url: "ajax.php",
async: true, async: true,
success: function(data) { success: function(data) {
let source_array = []; $.each(data,function(key,value) {
$.each(data['source'],function(key,value) { $(`#id_agents3 option[value*='${value}']`).attr("style","display:");
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:");
}
}); });
$("#spinner_hack").hide(); $("#spinner_hack").hide();
@ -7955,7 +7979,7 @@ function dialog_message(message_id) {
} }
function control_period_range() { function control_period_range() {
let value_period_range = $('#row_period_range #hidden-period_range').val(); 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); let min_range = (current_value/12);
if(min_range > value_period_range) { if(min_range > value_period_range) {
$('#row_period_range div:nth-child(2) select option').removeAttr("selected"); $('#row_period_range div:nth-child(2) select option').removeAttr("selected");
@ -8003,10 +8027,10 @@ function control_period_range() {
$(document).ready(function () { $(document).ready(function () {
$('[id^=period], #combo_graph_options, #combo_sla_sort_options').next().css('z-index', 0); $('[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(); control_period_range();
}); });
$('#row_period select').change(function(e){ $('#row_period2 select').change(function(e){
control_period_range(); control_period_range();
}); });
$('#row_period_range input').change(function(e){ $('#row_period_range input').change(function(e){

View File

@ -53,12 +53,30 @@ try {
echo 'current historyDB MR: '.Config::get('MR', 'unknown', true)."\n"; echo 'current historyDB MR: '.Config::get('MR', 'unknown', true)."\n";
} }
global $pandora_version;
if (isset($pandora_version) === true
&& empty($pandora_version) === false
) {
$version_array = explode('.', $pandora_version);
if (is_array($version_array) === true) {
$current_package = $version_array[2];
if (count($version_array) > 2) {
foreach ($version_array as $key => $value) {
if ($key > 2) {
$current_package .= '.'.$value;
}
}
}
}
}
$umc = new UpdateManager\Client( $umc = new UpdateManager\Client(
[ [
'homedir' => $config['homedir'], 'homedir' => $config['homedir'],
'dbconnection' => $config['dbconnection'], 'dbconnection' => $config['dbconnection'],
'historydb' => $historical_dbh, 'historydb' => $historical_dbh,
'MR' => (int) $current_mr, 'MR' => (int) $current_mr,
'current_package' => ($current_package ?? ''),
] ]
); );

View File

@ -0,0 +1,219 @@
<?php
/**
* Update manager client historical updates backend.
*
* @category Update Manager
* @package Pandora FMS
* @subpackage Community
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2023 Pandora FMS
* Please see https://pandorafms.com/community/ for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
$method = get_parameter('method', null);
$filter = get_parameter('filter', '');
$urlDashboard = get_parameter('urlDashboard', '');
$manageDashboards = get_parameter('manageDashboards', 1);
if ($method === 'draw') {
// Datatables offset, limit and order.
$filter = get_parameter('filter', []);
$start = get_parameter('start', 0);
$length = get_parameter('length', $config['block_size']);
$orderBy = get_datatable_order(true);
$sort_field = $orderBy['field'];
$order = $orderBy['direction'];
$pagination = '';
$pagination = sprintf(
' LIMIT %d OFFSET %d ',
$length,
$start,
);
try {
$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');
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';
}
$table->data = [];
if (strlen($filter['free_search']) > 0) {
$where = 'WHERE name LIKE "%'.$filter['free_search'].'%"';
} else {
$where = '';
}
$sql = 'SELECT * FROM tdashboard '.$where.' ORDER BY id '.$pagination;
$dashboards = db_get_all_rows_sql($sql);
$count = db_get_value_sql('SELECT COUNT(*) FROM tdashboard '.$where);
foreach ($dashboards as $dashboard) {
$data = [];
$dataQuery = ['dashboardId' => $dashboard['id']];
$url = $urlDashboard.'&'.http_build_query($dataQuery);
$data['name'] = '<a href="'.$url.'">';
$data['name'] .= $dashboard['name'];
$data['name'] .= '</a>';
$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'] = '<a href="'.$urlFull.'">';
$data['full_screen'] .= \html_print_image(
'images/fullscreen@svg.svg',
true,
['class' => 'main_menu_icon invert_filter']
);
$data['full_screen'] .= '</a>';
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'] = '<a href="'.$urlCopy.'">';
$data['copy'] .= html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']);
$data['copy'] .= '</a>';
$dataQueryDelete = [
'dashboardId' => $dashboard['id'],
'deleteDashboard' => 1,
];
$urlDelete = $urlDashboard;
$urlDelete .= '&'.\http_build_query($dataQueryDelete);
$data['delete'] = '<a href="'.$urlDelete;
$data['delete'] .= '" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\')) return false;">';
$data['delete'] .= \html_print_image(
'images/delete.svg',
true,
['class' => 'main_menu_icon invert_filter']
);
$data['delete'] .= '</a>';
}
$table->cellclass[] = [
'full_screen' => 'table_action_buttons',
'copy' => 'table_action_buttons',
'delete' => 'table_action_buttons',
];
$table->data[] = $data;
}
// Datatables format: RecordsTotal && recordsfiltered.
echo json_encode(
[
'data' => $table->data,
'recordsTotal' => $count,
'recordsFiltered' => $count,
]
);
// Capture output.
$response = ob_get_clean();
} catch (Exception $e) {
echo json_encode(['error' => $e->getMessage()]);
exit;
}
// If not valid, show error with issue.
json_decode($response);
if (json_last_error() == JSON_ERROR_NONE) {
// If valid dump.
echo $response;
} else {
echo json_encode(
['error' => $response]
);
}
exit;
}

View File

@ -20,7 +20,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC231115'; $build_version = 'PC231122';
$pandora_version = 'v7.0NG.774'; $pandora_version = 'v7.0NG.774';
// Do not overwrite default timezone set if defined. // Do not overwrite default timezone set if defined.

View File

@ -1461,7 +1461,8 @@ function defineTinyMCE(selector) {
{ text: "C#", value: "csharp" }, { text: "C#", value: "csharp" },
{ text: "C++", value: "cpp" } { text: "C++", value: "cpp" }
], ],
toolbar: defaultToolbar toolbar: defaultToolbar,
relative_urls: false
}); });
} }

View File

@ -731,7 +731,8 @@ class Manager implements PublicLogin
int $limit=-1, int $limit=-1,
bool $favourite=false, bool $favourite=false,
bool $slideshow=false, bool $slideshow=false,
string $id_user='' string $id_user='',
array $rowFilter=[]
):array { ):array {
global $config; global $config;
@ -749,6 +750,14 @@ class Manager implements PublicLogin
$sql_where .= 'AND td.cells_slideshow = 1'; $sql_where .= 'AND td.cells_slideshow = 1';
} }
if (empty((int) $rowFilter['id_group']) === false) {
$sql_where .= ' AND td.id_group = '.$rowFilter['id_group'];
}
if (empty($rowFilter['name_filter']) === false) {
$sql_where .= ' AND td.name like "%'.$rowFilter['name_filter'].'%"';
}
if (empty($id_user) === true) { if (empty($id_user) === true) {
$id_user = $config['id_user']; $id_user = $config['id_user'];
} }
@ -944,6 +953,13 @@ class Manager implements PublicLogin
private function showList() private function showList()
{ {
global $config; global $config;
$id_group_filter = \get_parameter_post('id_group', '');
$name_filter = \get_parameter_post('name', '');
$rowFilter = [
'id_group' => $id_group_filter,
'name_filter' => $name_filter,
];
$limit_sql = $config['block_size']; $limit_sql = $config['block_size'];
@ -957,7 +973,7 @@ class Manager implements PublicLogin
$resultCopy = $this->copy(); $resultCopy = $this->copy();
} }
$dashboards = $this->getDashboards($this->offset, $limit_sql); $dashboards = $this->getDashboards($this->offset, $limit_sql, false, false, '', $rowFilter);
$count = $this->getDashboardsCount(); $count = $this->getDashboardsCount();
View::render( View::render(

View File

@ -1057,6 +1057,7 @@ if ((bool) ($config['maintenance_mode'] ?? false) === true
if ((bool) ($config['maintenance_mode'] ?? false) === true if ((bool) ($config['maintenance_mode'] ?? false) === true
&& $page !== 'advanced/command_center' && $page !== 'advanced/command_center'
&& $page !== 'godmode/update_manager/update_manager'
&& is_user_admin($config['id_user']) === true && is_user_admin($config['id_user']) === true
) { ) {
// Prevent access to metaconsole if not merged. // Prevent access to metaconsole if not merged.

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'> <div style='padding-bottom: 50px'>
<?php <?php
$version = '7.0NG.774'; $version = '7.0NG.774';
$build = '231115'; $build = '231122';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -96,7 +96,7 @@ if (!empty($table->data)) {
// Create controlled toggle content. // Create controlled toggle content.
ui_toggle( ui_toggle(
$html_content, $html_content,
__('Log sources status'), __('Log sources status (last 24h)'),
'log_sources_status', 'log_sources_status',
!$log_sources_defined, !$log_sources_defined,
false, false,

View File

@ -6,7 +6,7 @@
%define debug_package %{nil} %define debug_package %{nil}
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.774 %define version 7.0NG.774
%define release 231115 %define release 231122
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -6,7 +6,7 @@
%define debug_package %{nil} %define debug_package %{nil}
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.774 %define version 7.0NG.774
%define release 231115 %define release 231122
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.774 %define version 7.0NG.774
%define release 231115 %define release 231122
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -2648,6 +2648,82 @@ INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`
SELECT @last_id := LAST_INSERT_ID(); 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 `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&#x20;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&#x20;dynamic&#x20;map','This&#x20;is&#x20;a&#x20;sample&#x20;dynamic&#x20;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&#x20;report&#x20;#1','This&#x20;is&#x20;a&#x20;sample&#x20;report,&#x20;just&#x20;to&#x20;show&#x20;you&#x20;some&#x20;general&#x20;report&#x20;items.',0,0,NULL,NULL,'&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;img&#x20;src=&quot;http://localhost/pandora_console//images/pandora_report_logo.png&quot;&#x20;alt=&quot;&quot;&#x20;width=&quot;800&quot;&#x20;/&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&amp;nbsp;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;xx-large;&quot;&gt;&#40;_REPORT_NAME_&#41;&lt;/span&gt;&lt;/p&gt;&#x0d;&#x0a;&lt;p&#x20;style=&quot;text-align:&#x20;center;&quot;&gt;&lt;span&#x20;style=&quot;font-size:&#x20;large;&quot;&gt;&#40;_DATETIME_&#41;&lt;/span&gt;&lt;/p&gt;',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&#x20;agent&#x20;inventory','',0,'&lt;p&gt;This&#x20;type&#x20;of&#x20;report&#x20;implies&#x20;loading&#x20;a&#x20;lot&#x20;of&#x20;data.&#x20;Therefore&#x20;it&#x20;is&#x20;recommended&#x20;for&#x20;scheduled&#x20;reports,&#x20;not&#x20;real-time&#x20;view.&lt;/p&gt;','{\"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,'{&quot;show_in_same_row&quot;:0,&quot;hide_notinit_agents&quot;:0,&quot;priority_mode&quot;:&quot;1&quot;,&quot;dyn_height&quot;:&quot;250&quot;}',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&#x20;CPU&#x20;per&#x20;agent','',0,'&lt;p&gt;This&#x20;type&#x20;of&#x20;report&#x20;implies&#x20;loading&#x20;a&#x20;lot&#x20;of&#x20;data.&#x20;Therefore&#x20;it&#x20;is&#x20;recommended&#x20;for&#x20;scheduled&#x20;reports,&#x20;not&#x20;real-time&#x20;view.&lt;/p&gt;',NULL,0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,3,10,0,10,0,1,1,0,'{&quot;show_in_same_row&quot;:0,&quot;hide_notinit_agents&quot;:0,&quot;priority_mode&quot;:&quot;1&quot;,&quot;dyn_height&quot;:&quot;250&quot;,&quot;text_agent&quot;:&quot;Lio=&quot;,&quot;text_agent_module&quot;:&quot;Y3B1Lio=&quot;}',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&#x20;event&#x20;report','This&#x20;is&#x20;a&#x20;sample&#x20;of&#x20;not&#x20;normal&#x20;events&#x20;for&#x20;any&#x20;agent&#x20;available&#x20;in&#x20;the&#x20;last&#x20;6&#x20;hours',0,'&lt;p&gt;This&#x20;type&#x20;of&#x20;report&#x20;implies&#x20;loading&#x20;a&#x20;lot&#x20;of&#x20;data.&#x20;Therefore&#x20;it&#x20;is&#x20;recommended&#x20;for&#x20;scheduled&#x20;reports,&#x20;not&#x20;real-time&#x20;view.&lt;/p&gt;',NULL,0,'','','','00:00:00','00:00:00',1,1,1,1,1,1,1,0,0,10,0,10,0,0,0,0,'{&quot;show_in_same_row&quot;:0,&quot;hide_notinit_agents&quot;:0,&quot;priority_mode&quot;:&quot;1&quot;,&quot;dyn_height&quot;:&quot;250&quot;,&quot;server_multiple&quot;:&quot;&#92;&quot;&#92;&quot;&quot;,&quot;show_summary_group&quot;:0,&quot;filter_event_severity&quot;:&quot;[&#92;&quot;20&#92;&quot;]&quot;,&quot;filter_event_type&quot;:&quot;[&#92;&quot;all&#92;&quot;]&quot;,&quot;filter_event_status&quot;:&quot;[&#92;&quot;-1&#92;&quot;]&quot;,&quot;event_graph_by_agent&quot;:&quot;1&quot;,&quot;event_graph_by_user_validator&quot;:&quot;1&quot;,&quot;event_graph_by_criticity&quot;:&quot;1&quot;,&quot;event_graph_validated_vs_unvalidated&quot;:0,&quot;event_filter_search&quot;:&quot;&quot;,&quot;event_filter_exclude&quot;:&quot;&quot;,&quot;custom_data_events&quot;:&quot;1&quot;,&quot;label&quot;:&quot;&quot;}',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&#x20;Dashboard&#x20;#1','',0,0,0,0),
(2,'Sample&#x20;Dashboard&#x20;#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&#x20;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&#x20;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&#x20;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&#x20;Group&#x20;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&#x20;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&#x20;event&#x20;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&#x20;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&#x20;N&#x20;events&#x20;per&#x20;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&#x20;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&#x20;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&#x20;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&#x20;N&#x20;events&#x20;per&#x20;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&#x20;CPU&#x20;Modules&#x20;per&#x20;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 -- Insert new VMware APP
SET @short_name = 'pandorafms.vmware'; SET @short_name = 'pandorafms.vmware';
SET @name = 'VMware'; SET @name = 'VMware';

View File

@ -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. * Make a request to Update manager.
* *
@ -810,14 +930,26 @@ class Client
} }
} }
// Initialize. if ($request['action'] === 'get_server_package') {
$response = $this->curl( // Initialize.
$this->url, $response = $this->curlSaveToDisk(
array_merge( $this->url,
['action' => $request['action']], array_merge(
$request['arguments'] ['action' => $request['action']],
) $request['arguments']
); ),
($request['destiny'] ?? '')
);
} else {
// Initialize.
$response = $this->curl(
$this->url,
array_merge(
['action' => $request['action']],
$request['arguments']
)
);
}
if ($literal === true) { if ($literal === true) {
return $response; return $response;
@ -1393,10 +1525,6 @@ class Client
) { ) {
unlink($file); unlink($file);
$processed[$file] = 'removed'; $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; return false;
} }
$this->notify(100, 'Updated files', true, ['reload' => true]);
sleep(2);
if ($this->globalTask === null && $this->offline === false) { if ($this->globalTask === null && $this->offline === false) {
$this->percentage = 90; $this->percentage = 90;
$this->currentTask = __('Retrieving server update'); $this->currentTask = __('Retrieving server update');
@ -1985,6 +2116,10 @@ class Client
} while ($rc !== null); } while ($rc !== null);
} }
if ($this->lock() !== true) {
return null;
}
$last_error = $this->lastError; $last_error = $this->lastError;
$this->updateServerPackage(null, $this->currentPackage); $this->updateServerPackage(null, $this->currentPackage);
@ -1995,6 +2130,7 @@ class Client
$this->percentage = 100; $this->percentage = 100;
$this->notify(100, 'Updated to '.$this->getVersion().'.'); $this->notify(100, 'Updated to '.$this->getVersion().'.');
$this->unlock();
return $this->currentPackage; return $this->currentPackage;
} }
@ -2133,30 +2269,21 @@ class Client
} }
if ($package === null) { 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'; $file_name = 'pandorafms_server-'.$version.'.tar.gz';
$official_name = 'pandorafms_server_enterprise-7.0NG.%s_x86_64.tar.gz'; $official_name = 'pandorafms_server_enterprise-7.0NG.%s_x86_64.tar.gz';
$filename_repo = sprintf($official_name, $version); $filename_repo = sprintf($official_name, $version);
$official_path = $file_path.$filename_repo; $official_path = $file_path.$filename_repo;
if (file_put_contents($official_path, $file) === false) { // Retrieve package from UMS.
$this->lastError = 'Failed to store server update package.'; $this->notify(0, 'Downloading server update '.$version);
return false; $this->post(
} [
'action' => 'get_server_package',
'arguments' => ['version' => $version],
'destiny' => $official_path,
],
1
);
$signature = $this->post( $signature = $this->post(
[ [

View File

@ -328,11 +328,11 @@ function updateProgress(url, auth) {
} }
if (general_label.innerText == "100.00 %") { if (general_label.innerText == "100.00 %") {
cleanExit(); window.onbeforeunload = undefined;
if (_auxIntervalReference != null) { if (_auxIntervalReference != null) {
window.clearInterval(_auxIntervalReference); window.clearInterval(_auxIntervalReference);
} }
return; window.location.reload();
} }
ajax({ ajax({
@ -375,6 +375,19 @@ function updateProgress(url, auth) {
general_action.innerText = d.result.processing; general_action.innerText = d.result.processing;
task_action.innerText = d.result.message; 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) { error: function(d) {
dprog.innerHTML = umErrorMsg(d.error); dprog.innerHTML = umErrorMsg(d.error);

View File

@ -27,7 +27,9 @@
* GNU General Public License for more details. * GNU General Public License for more details.
* ============================================================================ * ============================================================================
*/ */
global $config; global $config;
?> ?>
<head> <head>
<link rel="stylesheet" href="<?php $asset('resources/styles/um.css'); ?>?v=<?php echo $config['current_package']; ?>"> <link rel="stylesheet" href="<?php $asset('resources/styles/um.css'); ?>?v=<?php echo $config['current_package']; ?>">
@ -57,16 +59,25 @@ global $config;
$settings = update_manager_get_config_values(); $settings = update_manager_get_config_values();
$umc = new \UpdateManager\Client($settings); $umc = new \UpdateManager\Client($settings);
$updates = $umc->listUpdates(); $updates = $umc->listUpdates();
if ($updates === null) {
$updates = [];
}
$text_for_next_version = ''; $text_for_next_version = '';
$text_for_last_version = ''; $text_for_last_version = '';
$back_up_url = 'index.php?sec=gextensions&sec2=enterprise/godmode/manage_backups'; $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 <a href='.$back_up_url.'>up-to-date backup</a>.'); $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 <a href='.$back_up_url.'>up-to-date backup</a>.');
} else { } 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. <br/> Before installing this RRR version, please make sure you have an <a href='.$back_up_url.'>up-to-date backup</a>.'); $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. <br/> Before installing this RRR version, please make sure you have an <a href='.$back_up_url.'>up-to-date backup</a>.');
} }
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 <a href='.$back_up_url.'>up-to-date backup</a>.'); $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 <a href='.$back_up_url.'>up-to-date backup</a>.');
} else { } 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. <br/> Before installing this RRR version, please make sure you have an <a href='.$back_up_url.'>up-to-date backup</a>.'); $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. <br/> Before installing this RRR version, please make sure you have an <a href='.$back_up_url.'>up-to-date backup</a>.');
@ -160,14 +171,19 @@ global $config;
} }
}, },
error: function(e, r) { error: function(e, r) {
if (typeof r != "undefined" ) { if(e != '504') {
result.innerHTML = umErrorMsg( if (typeof r != "undefined" ) {
'<?php echo __('Failed to update to '); ?>' + nextUpdateVersion+' '+r result.innerHTML = umErrorMsg(
); '<?php echo __('Failed to update to '); ?>' + nextUpdateVersion+' '+r
);
} else {
result.innerHTML = umErrorMsg(
'<?php echo __('Failed to update to '); ?>' + nextUpdateVersion+' RC'+e
);
}
} else { } else {
result.innerHTML = umErrorMsg( cleanExit();
'<?php echo __('Failed to update to '); ?>' + nextUpdateVersion+' RC'+e window.location.reload();
);
} }
}, },
}); });
@ -202,12 +218,17 @@ global $config;
} }
}, },
error: function(e, r) { error: function(e, r) {
if (typeof r != "undefined" ) { if(e != '504') {
result.innerHTML = umErrorMsg(r); if (typeof r != "undefined" ) {
result.innerHTML = umErrorMsg(r);
} else {
result.innerHTML = umErrorMsg(
'<?php echo __('Failed to update:'); ?> RC'+e
);
}
} else { } else {
result.innerHTML = umErrorMsg( cleanExit();
'<?php echo __('Failed to update:'); ?> RC'+e window.location.reload();
);
} }
}, },
}); });

View File

@ -67,6 +67,74 @@ if (isset($resultCopy) === true) {
); );
} }
// Filter table.
$filter_id_group = \get_parameter_post('id_group', '');
$filter_name = \get_parameter_post('name', '');
$filterTable = new stdClass();
$filterTable->class = 'filter-table-adv w100p';
$filterTable->size[0] = '20%';
$filterTable->size[1] = '20%';
$filterTable->data = [];
$filterTable->data[0][0] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'AR',
true,
'id_group',
$filter_id_group,
'',
'',
'',
true,
false,
true,
'w100p',
false,
''
)
);
$filterTable->data[0][1] = html_print_label_input_block(
__('Name'),
html_print_input_text('name', $filter_name, '', 25, 80, true)
);
$form_html = '<form id="form_dashboard_search" method="post" action="'.$urlDashboard.'">';
$form_html .= html_print_table($filterTable, true);
$form_html .= html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Filter'),
'uptbutton',
false,
[
'icon' => 'search',
'mode' => 'mini',
],
true
),
],
true
);
$form_html .= '</form>';
ui_toggle(
$form_html,
'<span class="subsection_header_title">'.__('Filter').'</span>',
'dashboard_search',
false,
true,
false,
'',
'white-box-content',
'box-flat white_table_graph fixed_filter_bar'
);
if (empty($dashboards) === true) { if (empty($dashboards) === true) {
ui_print_info_message( ui_print_info_message(
[ [
@ -75,144 +143,63 @@ if (empty($dashboards) === true) {
] ]
); );
} else { } else {
$table = new stdClass(); $id_table = 'dashboards_list';
$table->width = '100%'; $columns = [
$table->class = 'info_table'; 'name',
$table->headstyle['name'] = 'text-align: left;'; 'cells',
$table->headstyle['cells'] = 'text-align: center;'; 'groups',
$table->headstyle['groups'] = 'text-align: center;'; 'favorite',
$table->headstyle['favorite'] = 'text-align: center;'; 'full_screen',
$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');
$column_names = [
__('Name'),
__('Cells'),
__('Group'),
__('Favorite'),
__('Full screen'),
];
if ($manageDashboards === 1) { if ($manageDashboards === 1) {
$table->head['copy'] = __('Copy'); $columns[] = 'copy';
$table->head['delete'] = __('Delete'); $columns[] = 'delete';
$table->headstyle['copy'] = 'text-align: center;'; $column_names[] = __('Copy');
$table->headstyle['delete'] = 'text-align: center;'; $column_names[] = __('Delete');
$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';
} }
$table->data = []; ui_print_datatable(
[
foreach ($dashboards as $dashboard) { 'id' => $id_table,
$data = []; 'class' => 'info_table',
'style' => 'width: 100%',
$dataQuery = ['dashboardId' => $dashboard['id']]; 'columns' => $columns,
'column_names' => $column_names,
$url = $urlDashboard.'&'.http_build_query($dataQuery); 'ajax_url' => 'include/ajax/dashboard.ajax',
$data['name'] = '<a href="'.$url.'">'; 'ajax_data' => [
$data['name'] .= $dashboard['name']; 'method' => 'draw',
$data['name'] .= '</a>'; 'urlDashboard' => $urlDashboard,
'manageDashboards' => $manageDashboards,
$data['cells'] = $dashboard['cells']; ],
'default_pagination' => $config['block_size'],
if (empty($dashboard['id_user']) === false) { 'no_sortable_columns' => [],
$data['groups'] = __( 'order' => [
'Private for (%s)', 'field' => 'name',
$dashboard['id_user'] 'direction' => 'desc',
); ],
} else { 'search_button_class' => 'sub filter float-right',
$data['groups'] = ui_print_group_icon( 'form' => [
$dashboard['id_group'], 'inputs' => [
true [
); 'label' => __('Free search'),
} 'type' => 'text',
'class' => 'w400px',
$data['favorite'] = $dashboard['active']; 'id' => 'free_search',
'name' => 'free_search',
$dataQueryFull = [ ],
'dashboardId' => $dashboard['id'], ],
'pure' => 1, ],
]; 'filter_main_class' => 'box-flat white_table_graph fixed_filter_bar ',
'csv' => false,
$urlFull = $urlDashboard; ]
$urlFull .= '&'.\http_build_query($dataQueryFull);
$data['full_screen'] = '<a href="'.$urlFull.'">';
$data['full_screen'] .= \html_print_image(
'images/fullscreen@svg.svg',
true,
['class' => 'main_menu_icon invert_filter']
);
$data['full_screen'] .= '</a>';
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'] = '<a href="'.$urlCopy.'">';
$data['copy'] .= html_print_image('images/copy.svg', true, ['class' => 'main_menu_icon invert_filter']);
$data['copy'] .= '</a>';
$dataQueryDelete = [
'dashboardId' => $dashboard['id'],
'deleteDashboard' => 1,
];
$urlDelete = $urlDashboard;
$urlDelete .= '&'.\http_build_query($dataQueryDelete);
$data['delete'] = '<a href="'.$urlDelete;
$data['delete'] .= '" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\')) return false;">';
$data['delete'] .= \html_print_image(
'images/delete.svg',
true,
['class' => 'main_menu_icon invert_filter']
);
$data['delete'] .= '</a>';
}
$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,
''
); );
} }

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.774-231115 Version: 7.0NG.774-231122
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.774-231115" pandora_version="7.0NG.774-231122"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

@ -46,7 +46,7 @@ our @EXPORT = qw(
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.774"; my $pandora_version = "7.0NG.774";
my $pandora_build = "231115"; my $pandora_build = "231122";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only # version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.774"; my $pandora_version = "7.0NG.774";
my $pandora_build = "231115"; my $pandora_build = "231122";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] ); our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -7,7 +7,7 @@
%define debug_package %{nil} %define debug_package %{nil}
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.774 %define version 7.0NG.774
%define release 231115 %define release 231122
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil} %global __os_install_post %{nil}
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.774 %define version 7.0NG.774
%define release 231115 %define release 231122
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.774" PI_VERSION="7.0NG.774"
PI_BUILD="231115" PI_BUILD="231122"
MODE=$1 MODE=$1
if [ $# -gt 1 ]; then if [ $# -gt 1 ]; then

View File

@ -38,7 +38,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.774 Build 231115"; my $version = "7.0NG.774 Build 231122";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.774 Build 231115"; my $version = "7.0NG.774 Build 231122";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);