Merge branch 'develop' into ent-10983-selector-de-rango-de-fechas-para-multiples-elementos-a-la-vez-en-dashboards

This commit is contained in:
Daniel Cebrian 2023-11-29 15:45:07 +01:00
commit c0218ad75c
89 changed files with 1918 additions and 517 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.774-231127 Version: 7.0NG.774-231129
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-231127" pandora_version="7.0NG.774-231129"
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 => '231127'; use constant AGENT_BUILD => '231129';
# 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 231127 %define release 231129
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 231127 %define release 231129
%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 231127 %define release 231129
%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 231127 %define release 231129
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 231127 %define release 231129
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="231127" PI_BUILD="231129"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{231127} {231129}
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 231127") #define PANDORA_VERSION ("7.0NG.774 Build 231129")
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 231127))" VALUE "ProductVersion", "(7.0NG.774(Build 231129))"
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-231127 Version: 7.0NG.774-231129
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-231127" pandora_version="7.0NG.774-231129"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -27,17 +27,18 @@
*/ */
global $config; global $config;
if (true) { if ((bool) $config['metaconsole']) {
include_once '../include/config.php';
include_once '../include/functions_agents.php';
include_once '../include/functions_reporting.php';
include_once '../include/functions_modules.php';
include_once '../include/functions_users.php';
include_once $config['homedir'].'/include/config.php'; include_once $config['homedir'].'/include/config.php';
include_once $config['homedir'].'/include/functions_agents.php'; include_once $config['homedir'].'/include/functions_agents.php';
include_once $config['homedir'].'/include/functions_reporting.php'; include_once $config['homedir'].'/include/functions_reporting.php';
include_once $config['homedir'].'/include/functions_modules.php'; include_once $config['homedir'].'/include/functions_modules.php';
include_once $config['homedir'].'/include/functions_users.php'; include_once $config['homedir'].'/include/functions_users.php';
} else {
include_once '../include/config.php';
include_once '../include/functions_agents.php';
include_once '../include/functions_reporting.php';
include_once '../include/functions_modules.php';
include_once '../include/functions_users.php';
} }
@ -106,7 +107,25 @@ if ($get_agents_module_csv === '1') {
foreach ($results as $result) { foreach ($results as $result) {
foreach ($result as $key => $value) { foreach ($result as $key => $value) {
$out_csv .= io_safe_output($value).$divider; if (preg_match('/Linux/i', $_SERVER['HTTP_USER_AGENT'])) {
$value = preg_replace(
'/\s+/',
' ',
io_safe_output($value)
);
} else {
$value = mb_convert_encoding(
preg_replace(
'/\s+/',
'',
io_safe_output($value)
),
'UTF-16LE',
'UTF-8'
);
}
$out_csv .= $value.$divider;
} }
$out_csv .= "\n"; $out_csv .= "\n";

View File

@ -99,7 +99,7 @@ function api_execute(
if (empty($token) === true) { if (empty($token) === true) {
$data['apipass'] = $apipass; $data['apipass'] = $apipass;
$data['user'] = $user; $data['user'] = $user;
$data['password'] = $password; $data['pass'] = $password;
} }
} }

View File

@ -90,7 +90,7 @@ function dbmgr_extension_main()
// Header. // Header.
ui_print_standard_header( ui_print_standard_header(
__('Database interface'), __('DB interface'),
'images/gm_db.png', 'images/gm_db.png',
false, false,
'', '',

View File

@ -1,10 +1,28 @@
START TRANSACTION; START TRANSACTION;
-- Telegram and vonage default alerts
UPDATE talert_actions
SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_'
WHERE id=9;
UPDATE talert_actions
SET field2='[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_'
WHERE id=11;
-- Delete table tagent_access -- Delete table tagent_access
DROP TABLE tagent_access; DROP TABLE tagent_access;
ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL; ALTER TABLE treport_content ADD check_unknowns_graph tinyint DEFAULT 0 NULL;
-- Update macros for plugin oracle
UPDATE `tdiscovery_apps` SET `version` = '1.1' WHERE `short_name` = 'pandorafms.oracle';
SET @id_app := (SELECT `id_app` FROM `tdiscovery_apps` WHERE `short_name` = 'pandorafms.oracle');
UPDATE `tdiscovery_apps_tasks_macros` SET `value` = 'agents_group_id=__taskGroupID__ interval=__taskInterval__ user=_dbuser_ password=_dbpass_ thick_mode=_thickMode_ client_path=_clientPath_ threads=_threads_ modules_prefix=_prefixModuleName_ execute_custom_queries=_executeCustomQueries_ analyze_connections=_checkConnections_ engine_uptime=_checkUptime_ query_stats=_queryStats_ cache_stats=_checkCache_ fragmentation_ratio=_checkFragmentation_ check_tablescpaces=_checkTablespaces_' WHERE `macro` = '_tempfileConf_' AND `id_task` IN (SELECT `id_rt` FROM `trecon_task` WHERE `id_app` = @id_app);
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `value`, `temp_conf`) SELECT id_rt, '_thickMode_', 'custom', 0, 0 FROM `trecon_task` WHERE `id_app` = @id_app;
INSERT IGNORE INTO `tdiscovery_apps_tasks_macros` (`id_task`, `macro`, `type`, `value`, `temp_conf`) SELECT id_rt, '_clientPath_', 'custom', '', 0 FROM `trecon_task` WHERE `id_app` = @id_app;
UPDATE `trecon_task` SET `setup_complete` = 1 WHERE `id_app` = @id_app;
ALTER TABLE `tdashboard` ALTER TABLE `tdashboard`
ADD COLUMN `date_range` TINYINT NOT NULL DEFAULT 0 AFTER `cells_slideshow`, ADD COLUMN `date_range` TINYINT NOT NULL DEFAULT 0 AFTER `cells_slideshow`,
ADD COLUMN `date_from` INT NOT NULL DEFAULT 0 AFTER `date_range`, ADD COLUMN `date_from` INT NOT NULL DEFAULT 0 AFTER `date_range`,

View File

@ -922,22 +922,25 @@ $tableAdvancedAgent->data['safe_operation'][] = html_print_label_input_block(
) )
); );
$tableAdvancedAgent->data['vul_scan_enabled'][] = html_print_label_input_block( if (enterprise_installed() === true) {
__('Vulnerability scanning'), $tableAdvancedAgent->data['vul_scan_enabled'][] = html_print_label_input_block(
html_print_select( __('Vulnerability scanning'),
[ html_print_select(
0 => __('Disabled'), [
1 => __('Enabled'), 0 => __('Disabled'),
2 => __('Use global settings'), 1 => __('Enabled'),
], 2 => __('Use global settings'),
'vul_scan_enabled', ],
$vul_scan_enabled, 'vul_scan_enabled',
'', $vul_scan_enabled,
'', '',
0, '',
true 0,
) true
); )
);
}
ui_toggle( ui_toggle(
html_print_table($tableAdvancedAgent, true), html_print_table($tableAdvancedAgent, true),

View File

@ -1391,7 +1391,6 @@ $table_advanced->data['made_enabled'][0] = html_print_checkbox_switch(
false, false,
'', '',
false, false,
false,
'wp100 static' 'wp100 static'
); );
@ -2004,23 +2003,14 @@ ui_require_jquery_file('json');
var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val())); var type_names = jQuery.parseJSON(Base64.decode($('#hidden-type_names').val()));
var type_name_selected = type_names[type_selected]; 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') { if (($('#radius-percentage_warning').prop('checked') === true && $('#radius-percentage_critical').prop('checked') === true) || type_name_selected == 'generic_data_string') {
paint_graph_values();
$("#svg_dinamic").hide(); $("#svg_dinamic").hide();
} else { } else {
paint_graph_values(); paint_graph_values();
$("#svg_dinamic").show(); $("#svg_dinamic").show();
} }
if ($('#radius-percentage_warning').prop('checked') === true) {
$('#radius-warning_inverse').hide();
$('#label-radius-warning_inverse').hide();
}
if ($('#radius-warning_inverse').prop('checked') === true) {
$('#radius-percentage_warning').hide();
$('#label-radius-percentage_warning').hide();
}
if ($('#radius-normal_warning').prop('checked') === true) { if ($('#radius-normal_warning').prop('checked') === true) {
$('#radius-warning_inverse').show(); $('#radius-warning_inverse').show();
$('#label-radius-warning_inverse').show(); $('#label-radius-warning_inverse').show();
@ -2028,17 +2018,6 @@ ui_require_jquery_file('json');
$('#label-radius-percentage_warning').show(); $('#label-radius-percentage_warning').show();
} }
if ($('#radius-percentage_critical').prop('checked') === true) {
$('#radius-critical_inverse').hide();
$('#label-radius-critical_inverse').hide();
}
if ($('#radius-critical_inverse').prop('checked') === true) {
$('#radius-percentage_critical').hide();
$('#label-radius-percentage_critical').hide();
}
if ($('#radius-normal_critical').prop('checked') === true) { if ($('#radius-normal_critical').prop('checked') === true) {
$('#radius-critical_inverse').show(); $('#radius-critical_inverse').show();
$('#label-radius-critical_inverse').show(); $('#label-radius-critical_inverse').show();
@ -2355,30 +2334,48 @@ ui_require_jquery_file('json');
var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>'; var message_error_percentage = '<?php echo __('Please introduce a positive percentage value'); ?>';
//if haven't error //if haven't error
if (max_w == 0 || max_w > min_w) { if (max_w == 0 || max_w > min_w || $('#radius-percentage_warning').is(':checked') === true) {
if (max_c == 0 || max_c > min_c) { if (max_c == 0 || max_c > min_c || $('#radius-percentage_critical').is(':checked') === true) {
paint_graph_status( error_c = 0;
min_w, max_w, min_c, max_c, inverse_w, error_w = 0;
inverse_c, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical
);
} else { } else {
error_c = 1; error_c = 1;
paint_graph_status( min_w = 0;
0, 0, 0, 0, 0, 0, error_w, error_c, max_w = 0;
legend_normal, legend_warning, legend_critical, min_c = 0;
message_error_warning, message_error_critical max_c = 0;
); inverse_w = 0;
inverse_c = 0;
} }
} else { } else {
if (max_c !== 0 && max_c < min_c && $('#radius-percentage_critical').is(':checked') === false) {
error_c = 2;
}
error_w = 1; error_w = 1;
paint_graph_status( min_w = 0;
0, 0, 0, 0, 0, 0, error_w, error_c, max_w = 0;
legend_normal, legend_warning, legend_critical, min_c = 0;
message_error_warning, message_error_critical max_c = 0;
); inverse_w = 0;
inverse_c = 0;
} }
if ($('#radius-percentage_warning').is(':checked') === true){
min_w = 0;
max_w = 0;
}
if ($('#radius-percentage_critical').is(':checked') === true){
min_c = 0;
max_c = 0;
}
paint_graph_status(
min_w, max_w, min_c, max_c, inverse_w,
inverse_c, error_w, error_c,
legend_normal, legend_warning, legend_critical,
message_error_warning, message_error_critical
);
} }
/* ]]> */ /* ]]> */

View File

@ -131,9 +131,10 @@ if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
} }
$data = []; $data = [];
$data[0] = __('Agent');
$data[1] = __('Module'); $data[0] = __('Module');
$data[2] = __('Period'); $data[1] = __('Period');
$table_simple->cellclass['caption_prediction_module'][0] = 'w33p'; $table_simple->cellclass['caption_prediction_module'][0] = 'w33p';
$table_simple->cellclass['caption_prediction_module'][1] = 'w33p'; $table_simple->cellclass['caption_prediction_module'][1] = 'w33p';
$table_simple->cellclass['caption_prediction_module'][2] = 'w33p'; $table_simple->cellclass['caption_prediction_module'][2] = 'w33p';
@ -163,34 +164,68 @@ $params['none_module_text'] = __('Select Module');
$params['use_hidden_input_idagent'] = true; $params['use_hidden_input_idagent'] = true;
$params['input_style'] = 'width: 100%;'; $params['input_style'] = 'width: 100%;';
$params['hidden_input_idagent_id'] = 'hidden-id_agente_module_prediction'; $params['hidden_input_idagent_id'] = 'hidden-id_agente_module_prediction';
$data[0] = ui_print_agent_autocomplete_input($params);
if ($id_agente > 0) { if (strstr($page, 'policy_modules') === false) {
$predictionModuleInput = html_print_select_from_sql( $modules = agents_get_modules($id_agente);
'SELECT id_agente_modulo, nombre
FROM tagente_modulo $predictionModuleInput = html_print_select(
WHERE delete_pending = 0 $modules,
AND history_data = 1
AND id_agente = '.$id_agente_clean.'
AND id_agente_modulo <> '.$id_agente_modulo,
'prediction_module', 'prediction_module',
$prediction_module, $prediction_module,
'', '',
__('Select Module'), '',
0, 0,
true, true,
false, false,
true, true,
'',
false, false,
'width: 100%;' false,
false,
false,
false,
'',
false,
false,
false,
false,
true,
false,
false,
'',
false,
'pm'
); );
} else { } else {
$predictionModuleInput = '<select id="prediction_module" name="custom_integer_1" disabled="disabled"><option value="0">Select an Agent first</option></select>'; $modules = index_array(policies_get_modules($policy_id, false, ['id', 'name']));
$predictionModuleInput = html_print_select(
$modules,
'id_module_policy',
$module['custom_integer_1'],
'',
'',
0,
true,
false,
true,
'',
false,
false,
false,
false,
false,
'',
false,
false,
true
);
} }
$data[1] = $predictionModuleInput; $data[0] = $predictionModuleInput;
$data[2] = html_print_select([__('Weekly'), __('Monthly'), __('Daily')], 'custom_integer_2', $custom_integer_2, '', '', 0, true, false, true, '', false, 'width: 100%;'); $data[1] = html_print_select([__('Weekly'), __('Monthly'), __('Daily')], 'custom_integer_2', $custom_integer_2, '', '', 0, true, false, true, '', false, 'width: 100%;');
$data[2] .= html_print_input_hidden('id_agente_module_prediction', $id_agente, true); $data[1] .= html_print_input_hidden('id_agente_module_prediction', $id_agente, true);
$table_simple->cellclass['prediction_module'][0] = 'w33p'; $table_simple->cellclass['prediction_module'][0] = 'w33p';
$table_simple->cellclass['prediction_module'][1] = 'w33p'; $table_simple->cellclass['prediction_module'][1] = 'w33p';
$table_simple->cellclass['prediction_module'][2] = 'w33p'; $table_simple->cellclass['prediction_module'][2] = 'w33p';
@ -264,7 +299,7 @@ if ($selector_form !== ENTERPRISE_NOT_HOOK) {
} }
// Synthetic modules are an Enterprise feature. // Synthetic modules are an Enterprise feature.
$synthetic_module_form = enterprise_hook('get_synthetic_module_form'); $synthetic_module_form = enterprise_hook('get_synthetic_module_form', [$policy_id]);
if ($synthetic_module_form !== ENTERPRISE_NOT_HOOK) { if ($synthetic_module_form !== ENTERPRISE_NOT_HOOK) {
$data = []; $data = [];
$data[0] = $synthetic_module_form; $data[0] = $synthetic_module_form;

View File

@ -84,6 +84,9 @@ if (is_ajax() === true) {
} }
$group = db_get_row('tgrupo', 'id_grupo', $id_group); $group = db_get_row('tgrupo', 'id_grupo', $id_group);
if (str_contains($group['icon'], '.png') === true) {
$group['folder'] = 'groups_small/';
}
echo json_encode($group); echo json_encode($group);
return; return;

View File

@ -255,7 +255,18 @@ $table->data[1][1] = html_print_select(
true, true,
'', '',
false, false,
'width:180px;' 'width:180px;',
false,
false,
false,
'',
false,
false,
false,
false,
true,
true,
true
); );
$table->data[1][2] = __('When select agents'); $table->data[1][2] = __('When select agents');
$table->data[1][2] .= '<br>'; $table->data[1][2] .= '<br>';
@ -271,7 +282,31 @@ $table->data[1][2] .= html_print_select(
'', '',
true true
); );
$table->data[1][3] = html_print_select([], 'module[]', '', false, '', '', true, true, false, '', false, 'width:180px;'); $table->data[1][3] = html_print_select(
[],
'module[]',
'',
false,
'',
'',
true,
true,
false,
'',
false,
'width:180px;',
false,
false,
false,
'',
true,
false,
false,
false,
true,
true,
false
);
$usr_groups = users_get_groups($config['id_user'], 'LW', true); $usr_groups = users_get_groups($config['id_user'], 'LW', true);
$filter_groups = ''; $filter_groups = '';

View File

@ -367,6 +367,8 @@ if ($access_console_node === true) {
$sub['godmode/alerts/alert_list']['text'] = __('List of Alerts'); $sub['godmode/alerts/alert_list']['text'] = __('List of Alerts');
$sub['godmode/alerts/alert_list']['id'] = 'List_of_Alerts'; $sub['godmode/alerts/alert_list']['id'] = 'List_of_Alerts';
$sub['godmode/alerts/alert_list']['pages'] = ['godmode/alerts/alert_view']; $sub['godmode/alerts/alert_list']['pages'] = ['godmode/alerts/alert_view'];
$sub['godmode/agentes/planned_downtime.list']['text'] = __('Scheduled downtime');
$sub['godmode/agentes/planned_downtime.list']['id'] = 'scheduled_downtime';
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) { if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
$sub['godmode/alerts/alert_templates']['text'] = __('Templates'); $sub['godmode/alerts/alert_templates']['text'] = __('Templates');
@ -708,6 +710,17 @@ if ($access_console_node === true) {
} }
if ($access_console_node === true) { if ($access_console_node === true) {
// Tools
$menu_godmode['tools']['text'] = __('Tools');
$menu_godmode['tools']['sec2'] = 'operation/extensions';
$menu_godmode['tools']['id'] = 'oper-extensions';
$sub = [];
$sub['operation/agentes/exportdata']['text'] = __('Export data');
$sub['operation/agentes/exportdata']['id'] = 'export_data';
$sub['extensions/files_repo']['text'] = __('File repository');
$sub['extensions/files_repo']['id'] = 'file_repository';
$menu_godmode['tools']['sub'] = $sub;
// About. // About.
$menu_godmode['about']['text'] = __('About'); $menu_godmode['about']['text'] = __('About');
$menu_godmode['about']['id'] = 'about'; $menu_godmode['about']['id'] = 'about';

View File

@ -95,7 +95,7 @@ $subsection = reporting_enterprise_add_graph_template_subsection('', $buttons);
$buttons['graph_container'] = [ $buttons['graph_container'] = [
'active' => true, 'active' => true,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image( 'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_container">'.html_print_image(
'images/graph-container.svg@svg', 'images/graph-container@svg.svg',
true, true,
[ [
'title' => __('Graph container'), 'title' => __('Graph container'),

View File

@ -1086,6 +1086,50 @@ switch ($action) {
$period = $item['period']; $period = $item['period'];
break; break;
case 'vuls_severity_graph':
$group = $item['id_group'];
break;
case 'vuls_attack_complexity':
$group = $item['id_group'];
break;
case 'vuls_by_packages':
$group = $item['id_group'];
break;
case 'vuls_by_agent':
$group = $item['id_group'];
$es = json_decode($item['external_source'], true);
$selected_agent_custom_field_filter = $es['agent_custom_field_filter'];
$security_hardening_score = $es['security_hardening_score'];
$vulnerabilities_status = $es['vulnerabilities_status'];
$secmon_status = $es['secmon_status'];
break;
case 'vuls_info_agent':
$idAgent = $item['id_agent'];
$es = json_decode($item['external_source'], true);
$vul_package = $es['vul_package'];
$vul_severity = $es['vul_severity'];
$vul_ac = $es['vul_ac'];
$vul_pr = $es['vul_pr'];
$vul_ui = $es['vul_ui'];
$vul_av = (empty($es['vul_av']) === true) ? 'all' : $es['vul_av'];
break;
case 'top_n_agents_vuls':
$group = $item['id_group'];
$recursion = $item['recursion'];
$top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value'];
break;
case 'top_n_vuls_count':
$group = $item['id_group'];
$recursion = $item['recursion'];
$top_n_value = (empty($item['top_n_value']) === true) ? 10 : $item['top_n_value'];
break;
default: default:
// It's not possible. // It's not possible.
break; break;
@ -3965,6 +4009,217 @@ if (is_metaconsole() === true) {
?> ?>
</td> </td>
</tr> </tr>
<tr id="row_secmon_status" class="datos">
<td class="bolder">
<?php
echo __('Secmon status');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'critical' => __('Critical'),
'warning' => __('Warning'),
],
'secmon_status',
$secmon_status,
);
?>
</td>
</tr>
<tr id="row_security_hardening_score" class="datos">
<td class="bolder">
<?php
echo __('Security hardening score');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'90' => __('< 90%'),
'80' => __('< 80%'),
'70' => __('< 70%'),
'60' => __('< 60%'),
'50' => __('< 50%'),
'40' => __('< 40%'),
'30' => __('< 30%'),
'20' => __('< 20%'),
'10' => __('< 10%'),
],
'security_hardening_score',
(empty($security_hardening_score) === false) ? $security_hardening_score : 'all',
'',
'',
0,
false,
false,
false
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_status" class="datos">
<td class="bolder">
<?php
echo __('Vulnerabilities status');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'crit' => __('Critical'),
'warn' => __('Warning'),
],
'vulnerabilities_status',
$vulnerabilities_status,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_packages" class="datos">
<td class="bolder">
<?php
echo __('Package').ui_print_help_tip(__('Select a agent for load his packages.'), true);
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
],
'vul_package',
$vul_package,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_severity" class="datos">
<td class="bolder">
<?php
echo __('Severity');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'high' => __('High'),
'low' => __('Low'),
'none' => __('None'),
],
'vul_severity',
$vul_severity,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_ac" class="datos">
<td class="bolder">
<?php
echo __('Attack Complexity');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'H' => __('High'),
'L' => __('Low'),
],
'vul_ac',
$vul_ac,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_pr" class="datos">
<td class="bolder">
<?php
echo __('Privileges Required');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'H' => __('High'),
'L' => __('Low'),
'N' => __('None'),
],
'vul_pr',
$vul_pr,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_ui" class="datos">
<td class="bolder">
<?php
echo __('User Interaction');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'R' => __('Required'),
'N' => __('None'),
],
'vul_ui',
$vul_ui,
);
?>
</td>
</tr>
<tr id="row_vulnerabilities_av" class="datos">
<td class="bolder">
<?php
echo __('Attack vector');
?>
</td>
<td>
<?php
html_print_select(
[
'all' => __('All'),
'A' => __('Adjacent Network'),
'L' => __('Local'),
'N' => __('Network'),
'P' => __('Physical'),
],
'vul_av',
(empty($vul_av) === true) ? 'all' : $vul_av,
'',
'',
0,
false,
false,
false
);
?>
</td>
</tr>
<?php endif; ?> <?php endif; ?>
<tr id="row_status_check" class="datos"> <tr id="row_status_check" class="datos">
@ -5692,6 +5947,27 @@ $(document).ready (function () {
return false; return false;
} }
break; break;
case 'vuls_info_agent':
if ($("#hidden-id_agent").val() == 0) {
dialog_message('#message_no_agent');
return false;
}
break;
case 'top_n_agents_vuls':
if ($("#text-max_items").val() == '') {
dialog_message('#message_no_max_item');
return false;
}
break;
case 'top_n_vuls_count':
if ($("#text-max_items").val() == '') {
dialog_message('#message_no_max_item');
return false;
}
break;
default: default:
break; break;
} }
@ -5846,7 +6122,24 @@ $(document).ready (function () {
return false; return false;
} }
break; break;
case 'vuls_info_agent':
if ($("#hidden-id_agent").val() == 0) {
dialog_message('#message_no_agent');
return false;
}
break;
case 'top_n_agents_vuls':
if ($("#text-max_items").val() == '') {
dialog_message('#message_no_max_item');
return false;
}
break;
case 'top_n_vuls_count':
if ($("#text-max_items").val() == '') {
dialog_message('#message_no_max_item');
return false;
}
break;
default: default:
break; break;
} }
@ -6903,6 +7196,15 @@ function chooseType() {
$("#row_cat_security_hardening").hide(); $("#row_cat_security_hardening").hide();
$("#row_ignore_skipped").hide(); $("#row_ignore_skipped").hide();
$("#row_status_check").hide(); $("#row_status_check").hide();
$("#row_secmon_status").hide();
$("#row_security_hardening_score").hide();
$("#row_vulnerabilities_status").hide();
$("#row_vulnerabilities_packages").hide();
$("#row_vulnerabilities_severity").hide();
$("#row_vulnerabilities_ac").hide();
$("#row_vulnerabilities_pr").hide();
$("#row_vulnerabilities_ui").hide();
$("#row_vulnerabilities_av").hide();
// SLA list default state. // SLA list default state.
$("#sla_list").hide(); $("#sla_list").hide();
@ -7803,6 +8105,50 @@ function chooseType() {
$("#row_group").show(); $("#row_group").show();
$('#row_period').show(); $('#row_period').show();
break; break;
case 'vuls_severity_graph':
$("#row_group").show();
break;
case 'vuls_attack_complexity':
$("#row_group").show();
break;
case 'vuls_by_packages':
$("#row_group").show();
break;
case 'vuls_by_agent':
$("#row_group").show();
$("#row_custom_field_filter").show();
$("#row_secmon_status").show();
$("#row_security_hardening_score").show();
$("#row_vulnerabilities_status").show();
break;
case 'vuls_info_agent':
$("#row_agent").show();
$("#row_vulnerabilities_packages").show();
$("#row_vulnerabilities_severity").show();
$("#row_vulnerabilities_ac").show();
$("#row_vulnerabilities_pr").show();
$("#row_vulnerabilities_ui").show();
$("#row_vulnerabilities_av").show();
updatePackages();
$('#row_agent input[type=text]').change(function(e) {
updatePackages();
});
break;
case 'top_n_agents_vuls':
$("#row_group").show();
$("#row_max_items").show();
break;
case 'top_n_vuls_count':
$("#row_group").show();
$("#row_max_items").show();
break;
} }
switch (type) { switch (type) {
@ -8045,6 +8391,46 @@ function control_period_range() {
}, 800); }, 800);
} }
} }
function updateSelect(element, fields, selected) {
if (typeof fields === "object") {
$(element).find("select").empty();
$(element).find(".select2-container .select2-selection__rendered").empty();
Object.keys(fields).forEach(function(key) {
if (key === selected) {
$(element).find(".select2-container .select2-selection__rendered").append(`${fields[key]}`);
$(element).find("select").append(`<option value="${key}" selected>${fields[key]}</option>`);
} else {
$(element).find("select").append(`<option value="${key}">${fields[key]}</option>`);
}
});
}
}
function updatePackages() {
let id_agent = $('#hidden-id_agent').val();
let server_id = $('#hidden-server_id').val();
$.ajax({
method: "POST",
url: "<?php echo ui_get_full_url('ajax.php'); ?>",
data: {
page: "<?php echo ENTERPRISE_DIR.'/include/ajax/vulnerabilities.ajax'; ?>",
action: "updatePackages",
id_agent: id_agent,
server_id: server_id,
},
success: function(data) {
const json = JSON.parse(data);
if (json.success) {
updateSelect("#row_vulnerabilities_packages", json.data, '<?php echo $vul_package; ?>');
}
}
});
}
$(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);

View File

@ -180,8 +180,8 @@ if ($report_id_user == $config['id_user']
$options['div_class'] = ''; $options['div_class'] = '';
} }
$table->data[2][1] = html_print_label_input_block( $table->data[3][0] = html_print_label_input_block(
__('Group'), __('Write Access Group'),
html_print_select_groups( html_print_select_groups(
false, false,
'RW', 'RW',
@ -216,7 +216,7 @@ if ($enterpriseEnable) {
if (enterprise_installed() === true) { if (enterprise_installed() === true) {
$table->data[3][0] = html_print_label_input_block( $table->data[4][0] = html_print_label_input_block(
__('Generate cover page in PDF render'), __('Generate cover page in PDF render'),
html_print_checkbox_switch( html_print_checkbox_switch(
'cover_page_render', 'cover_page_render',
@ -226,7 +226,7 @@ if (enterprise_installed() === true) {
) )
); );
$table->data[3][1] = html_print_label_input_block( $table->data[4][1] = html_print_label_input_block(
__('Generate index in PDF render'), __('Generate index in PDF render'),
html_print_checkbox_switch( html_print_checkbox_switch(
'index_render', 'index_render',

View File

@ -2046,6 +2046,56 @@ switch ($action) {
$good_format = true; $good_format = true;
break; break;
case 'vuls_severity_graph':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_attack_complexity':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_by_packages':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_by_agent':
$values['id_group'] = get_parameter('combo_group');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['secmon_status'] = get_parameter('secmon_status');
$es['security_hardening_score'] = get_parameter('security_hardening_score');
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
$values['external_source'] = json_encode($es);
$good_format = true;
break;
case 'vuls_info_agent':
$values['id_agent'] = get_parameter('id_agent');
$es['server_id'] = get_parameter('server_id');
$es['vul_package'] = get_parameter('vul_package');
$es['vul_severity'] = get_parameter('vul_severity');
$es['vul_ac'] = get_parameter('vul_ac');
$es['vul_pr'] = get_parameter('vul_pr');
$es['vul_ui'] = get_parameter('vul_ui');
$es['vul_av'] = get_parameter('vul_av');
$values['external_source'] = json_encode($es);
$good_format = true;
break;
case 'top_n_agents_vuls':
$values['id_group'] = get_parameter('combo_group');
$values['top_n_value'] = get_parameter('max_items');
$good_format = true;
break;
case 'top_n_vuls_count':
$values['id_group'] = get_parameter('combo_group');
$values['top_n_value'] = get_parameter('max_items');
$good_format = true;
break;
default: default:
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$values['top_n'] = get_parameter( $values['top_n'] = get_parameter(
@ -2979,6 +3029,56 @@ switch ($action) {
$good_format = true; $good_format = true;
break; break;
case 'vuls_severity_graph':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_attack_complexity':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_by_packages':
$values['id_group'] = get_parameter('combo_group');
$good_format = true;
break;
case 'vuls_by_agent':
$values['id_group'] = get_parameter('combo_group');
$es['agent_custom_field_filter'] = get_parameter('agent_custom_field_filter');
$es['secmon_status'] = get_parameter('secmon_status');
$es['security_hardening_score'] = get_parameter('security_hardening_score');
$es['vulnerabilities_status'] = get_parameter('vulnerabilities_status');
$values['external_source'] = json_encode($es);
$good_format = true;
break;
case 'vuls_info_agent':
$values['id_agent'] = get_parameter('id_agent');
$es['server_id'] = get_parameter('server_id');
$es['vul_package'] = get_parameter('vul_package');
$es['vul_severity'] = get_parameter('vul_severity');
$es['vul_ac'] = get_parameter('vul_ac');
$es['vul_pr'] = get_parameter('vul_pr');
$es['vul_ui'] = get_parameter('vul_ui');
$es['vul_av'] = get_parameter('vul_av');
$values['external_source'] = json_encode($es);
$good_format = true;
break;
case 'top_n_agents_vuls':
$values['id_group'] = get_parameter('combo_group');
$values['top_n_value'] = get_parameter('max_items');
$good_format = true;
break;
case 'top_n_vuls_count':
$values['id_group'] = get_parameter('combo_group');
$values['top_n_value'] = get_parameter('max_items');
$good_format = true;
break;
default: default:
$values['period'] = get_parameter('period'); $values['period'] = get_parameter('period');
$values['top_n'] = get_parameter( $values['top_n'] = get_parameter(

View File

@ -860,8 +860,10 @@ if (empty($create) === false || empty($view) === false) {
if ($management_allowed === false) { if ($management_allowed === false) {
ui_print_warning_message( ui_print_warning_message(
__( __(
'This console is not manager of this environment, 'This console is not manager of this environment, please manage this feature from feature from %s.',
please manage this feature from centralized manager console (Metaconsole).' '<a target="_blank" href="'.ui_get_meta_url(
'index.php?sec=advanced&sec2=godmode/servers/plugin_registration&tab=plugin_registration&pure=0'
).'">'.__('metaconsole').'</a>'
) )
); );
} }

View File

@ -179,7 +179,7 @@ foreach ($servers as $server) {
} }
$data[7] = ''; $data[7] = '';
if ($server['queued_modules'] > 500) { if ($server['queued_modules'] >= $config['number_modules_queue']) {
$data[7] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image( $data[7] .= '<div class="inline"><a onclick="show_dialog();" >'.html_print_image(
'images/info-warning.svg', 'images/info-warning.svg',
true, true,
@ -276,7 +276,7 @@ foreach ($servers as $server) {
$data[9] .= '</a>'; $data[9] .= '</a>';
if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) { if (($names_servers[$safe_server_name] === true) && ($ext === '_server' || $server['type'] === 'enterprise satellite')) {
$data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=agent_editor').'">'; $data[9] .= '<a href="'.ui_get_full_url('index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$server['id_server'].'&ext='.$ext.'&tab=advanced_editor').'">';
$data[9] .= html_print_image( $data[9] .= html_print_image(
'images/agents@svg.svg', 'images/agents@svg.svg',
true, true,

View File

@ -54,8 +54,12 @@ if (isset($_POST['create'])) {
if (! $result) { if (! $result) {
ui_print_error_message(__('There was a problem creating link')); ui_print_error_message(__('There was a problem creating link'));
} else { } else {
ui_print_success_message(__('Successfully created'));
$id_link = $result; $id_link = $result;
ui_print_result_message(
$id_link,
__('Successfully created'),
__('Could not be created')
);
} }
} }
@ -111,8 +115,8 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
$link = ''; $link = '';
} }
echo '<table class="databox filters filter-table-adv max_floating_element_size" cellpadding="4" cellspacing="4" width="100%">';
echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/links">'; echo '<form name="ilink" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/links">';
echo '<table class="databox filters filter-table-adv max_floating_element_size" cellpadding="4" cellspacing="4" width="100%">';
if ($creation_mode == 1) { if ($creation_mode == 1) {
echo "<input type='hidden' name='create' value='1'>"; echo "<input type='hidden' name='create' value='1'>";
} else { } else {
@ -179,10 +183,10 @@ if ((isset($_GET['form_add'])) or (isset($_GET['form_edit']))) {
) )
); );
echo '</form></td></tr></table>'; echo '</td></tr></table></form>';
} else { } else {
// Main list view for Links editor // Main list view for Links editor.
$rows = db_get_all_rows_in_table('tlink', 'name'); $rows = db_get_all_fields_in_table('tlink', '', '', 'name');
if ($rows === false) { if ($rows === false) {
$rows = []; $rows = [];
} }

View File

@ -93,7 +93,7 @@ $buttons['general'] = [
'images/setup.png', 'images/setup.png',
true, true,
[ [
'title' => __('General'), 'title' => __('General setup'),
'class' => 'invert_filter', 'class' => 'invert_filter',
] ]
@ -265,7 +265,7 @@ if (enterprise_installed()) {
switch ($section) { switch ($section) {
case 'general': case 'general':
$buttons['general']['active'] = true; $buttons['general']['active'] = true;
$subpage = __('General'); $subpage = __('General setup');
$help_header = 'setup_general_tab'; $help_header = 'setup_general_tab';
break; break;
@ -377,7 +377,7 @@ switch ($section) {
// Header. // Header.
ui_print_standard_header( ui_print_standard_header(
$subpage, __('Setup').' &raquo; '.$subpage,
'', '',
false, false,
$help_header, $help_header,
@ -388,6 +388,10 @@ ui_print_standard_header(
'link' => '', 'link' => '',
'label' => __('Setup'), 'label' => __('Setup'),
], ],
[
'link' => '',
'label' => $subpage,
],
] ]
); );

View File

@ -766,6 +766,16 @@ $table->data[$i][] = html_print_label_input_block(
true true
) )
); );
$table->data[$i++][] = html_print_label_input_block(
__('Number of modules in queue'),
html_print_input_number(
[
'name' => 'number_modules_queue',
'min' => 0,
'value' => $config['number_modules_queue'],
]
)
);
echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">'; echo '<form class="max_floating_element_size" id="form_setup" method="post" action="index.php?sec=gsetup&sec2=godmode/setup/setup&amp;section=general&amp;pure='.$config['pure'].'">';

View File

@ -1952,6 +1952,7 @@ if ($create_alert || $update_alert) {
[ [
'border' => '0', 'border' => '0',
'alt' => __('Delete'), 'alt' => __('Delete'),
'class' => 'invert_filter main_menu_icon',
] ]
).'</a> </td>'; ).'</a> </td>';
$data[1] .= '</tr>'; $data[1] .= '</tr>';

View File

@ -155,14 +155,92 @@ if (is_ajax() === true) {
return; return;
} }
if ($delete_profile === true) {
// Get parameters.
$result = false;
$id_user = (string) get_parameter('id_user');
$id_up = (int) get_parameter('id_user_profile');
$delete_user = (bool) get_parameter('delete_user', false);
$user_is_global_admin = users_is_admin($id_user);
$perfilUser = db_get_row('tusuario_perfil', 'id_up', $id_up);
$id_perfil = $perfilUser['id_perfil'];
db_pandora_audit(
AUDIT_LOG_USER_MANAGEMENT,
'Deleted profile for user '.io_safe_output($id_user),
false,
false,
'The profile with id '.$id_perfil.' in the group '.$perfilUser['id_grupo']
);
// Delete profile.
$profile_deleted = profile_delete_user_profile($id_user, $id_up);
// Check if exists more profiles.
$has_profile = db_get_row('tusuario_perfil', 'id_usuario', $id_user);
if ($profile_deleted === true) {
if ($has_profile === false && $user_is_global_admin === false && $delete_user === true) {
if (is_metaconsole() === true) {
$servers = metaconsole_get_servers();
foreach ($servers as $server) {
// Connect to the remote console.
metaconsole_connect($server);
// Delete the user.
$result = delete_user($id_user);
if ($result === true) {
db_pandora_audit(
AUDIT_LOG_USER_MANAGEMENT,
__('Deleted user %s from metaconsole', io_safe_output($id_user))
);
}
// Restore the db connection.
metaconsole_restore_db();
// Log to the metaconsole too.
if ($result === true) {
db_pandora_audit(
AUDIT_LOG_USER_MANAGEMENT,
__(
'Deleted user %s from %s',
io_safe_input($id_user),
io_safe_input($server['server_name'])
)
);
}
}
$result = delete_user((string) $id_user);
if ($result === true) {
db_pandora_audit(
AUDIT_LOG_USER_MANAGEMENT,
__('Deleted user %s', io_safe_output($id_user))
);
}
} else {
$result = delete_user((string) $id_user);
if ($result === true) {
db_pandora_audit(
AUDIT_LOG_USER_MANAGEMENT,
__('Deleted user %s', io_safe_output($id_user))
);
}
}
} else {
$result = $profile_deleted;
}
}
return $result;
}
} }
$tab = get_parameter('tab', 'user'); $tab = get_parameter('tab', 'user');
// Save autorefresh list. // Save autorefresh list.
$autorefresh_list = (array) get_parameter_post('autorefresh_list'); $autorefresh_list = (array) get_parameter_post('autorefresh_list');
$autorefresh_white_list = (($autorefresh_list[0] === '') || ($autorefresh_list[0] === '0')) ? '' : json_encode($autorefresh_list); $autorefresh_white_list = (($autorefresh_list[0] === '') || ($autorefresh_list[0] === '0')) ? '' : json_encode($autorefresh_list);
// Header. // Header.
if (is_metaconsole() === true) { if (is_metaconsole() === true) {
user_meta_print_header(); user_meta_print_header();
@ -195,11 +273,11 @@ if (is_metaconsole() === true) {
).'</a>', ).'</a>',
], ],
]; ];
$buttons[$tab]['active'] = true; $buttons[$tab]['active'] = true;
} }
$edit_user = get_parameter('edit_user'); $edit_user = get_parameter('edit_user');
ui_print_standard_header( ui_print_standard_header(
($edit_user) ? sprintf('%s [ %s ]', __('Update User'), $id) : __('Create User'), ($edit_user) ? sprintf('%s [ %s ]', __('Update User'), $id) : __('Create User'),
'images/gm_users.png', 'images/gm_users.png',
@ -222,11 +300,9 @@ if (is_metaconsole() === true) {
], ],
] ]
); );
$sec = 'gusuarios'; $sec = 'gusuarios';
} }
if ((bool) $config['user_can_update_info'] === true) { if ((bool) $config['user_can_update_info'] === true) {
$view_mode = false; $view_mode = false;
} else { } else {
@ -348,8 +424,10 @@ if ($create_user === true) {
$values['data_section'] = $dashboard; $values['data_section'] = $dashboard;
} else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) { } else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) {
$values['data_section'] = $visual_console; $values['data_section'] = $visual_console;
} else if ($values['section'] === HOME_SCREEN_OTHER || io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) { } else if ($values['section'] === HOME_SCREEN_OTHER) {
$values['data_section'] = get_parameter('data_section'); $values['data_section'] = get_parameter('data_section_other');
} else if (io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) {
$values['data_section'] = get_parameter('data_section_external');
} }
// $values['section'] = $homeScreenValues[$values['section']]; // $values['section'] = $homeScreenValues[$values['section']];
@ -596,8 +674,11 @@ if ($update_user) {
$values['email'] = (string) get_parameter('email'); $values['email'] = (string) get_parameter('email');
$values['phone'] = (string) get_parameter('phone'); $values['phone'] = (string) get_parameter('phone');
$values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments')))); $values['comments'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('comments'))));
$values['allowed_ip_active'] = ((int) get_parameter('allowed_ip_active', -1) === 0); if (users_is_admin($config['id_user']) === true || (bool) check_acl($config['id_user'], 0, 'PM') === true) {
$values['allowed_ip_list'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('allowed_ip_list')))); $values['allowed_ip_active'] = ((int) get_parameter('allowed_ip_active', -1) === 0);
$values['allowed_ip_list'] = io_safe_input(strip_tags(io_safe_output((string) get_parameter('allowed_ip_list'))));
}
$values['is_admin'] = (get_parameter('is_admin', 0) === 0) ? 0 : 1; $values['is_admin'] = (get_parameter('is_admin', 0) === 0) ? 0 : 1;
$values['language'] = (string) get_parameter('language'); $values['language'] = (string) get_parameter('language');
$values['timezone'] = (string) get_parameter('timezone'); $values['timezone'] = (string) get_parameter('timezone');
@ -643,8 +724,10 @@ if ($update_user) {
$values['data_section'] = $dashboard; $values['data_section'] = $dashboard;
} else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) { } else if (io_safe_output($values['section']) === HOME_SCREEN_VISUAL_CONSOLE) {
$values['data_section'] = $visual_console; $values['data_section'] = $visual_console;
} else if ($values['section'] === HOME_SCREEN_OTHER || io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) { } else if ($values['section'] === HOME_SCREEN_OTHER) {
$values['data_section'] = get_parameter('data_section'); $values['data_section'] = get_parameter('data_section_other');
} else if (io_safe_output($values['section']) === HOME_SCREEN_EXTERNAL_LINK) {
$values['data_section'] = get_parameter('data_section_external');
} }
// $values['section'] = $homeScreenValues[$values['section']]; // $values['section'] = $homeScreenValues[$values['section']];
@ -866,89 +949,6 @@ if ($update_user) {
$user_info = $values; $user_info = $values;
} }
if ($delete_profile) {
$id2 = (string) get_parameter('id_user');
$id_up = (int) get_parameter('id_user_profile');
$perfilUser = db_get_row('tusuario_perfil', 'id_up', $id_up);
$id_perfil = $perfilUser['id_perfil'];
$perfil = db_get_row('tperfil', 'id_perfil', $id_perfil);
db_pandora_audit(
AUDIT_LOG_USER_MANAGEMENT,
'Deleted profile for user '.io_safe_output($id2),
false,
false,
'The profile with id '.$id_perfil.' in the group '.$perfilUser['id_grupo']
);
$return = profile_delete_user_profile($id2, $id_up);
ui_print_result_message(
$return,
__('Successfully deleted'),
__('Could not be deleted')
);
$has_profile = db_get_row('tusuario_perfil', 'id_usuario', $id2);
$user_is_global_admin = users_is_admin($id2);
if ($has_profile === false && $user_is_global_admin === false) {
$result = delete_user($id2);
if ($result === true) {
db_pandora_audit(
AUDIT_LOG_USER_MANAGEMENT,
__('Deleted user %s', io_safe_output($id_user))
);
}
ui_print_result_message(
$result,
__('Successfully deleted'),
__('There was a problem deleting the user')
);
// Delete the user in all the consoles.
if (is_metaconsole() === true) {
$servers = metaconsole_get_servers();
foreach ($servers as $server) {
// Connect to the remote console.
metaconsole_connect($server);
// Delete the user.
$result = delete_user($id_user);
if ($result === true) {
db_pandora_audit(
AUDIT_LOG_USER_MANAGEMENT,
__('Deleted user %s from metaconsole', io_safe_output($id_user))
);
}
// Restore the db connection.
metaconsole_restore_db();
// Log to the metaconsole too.
if ($result === true) {
db_pandora_audit(
AUDIT_LOG_USER_MANAGEMENT,
__(
'Deleted user %s from %s',
io_safe_input($id_user),
io_safe_input($server['server_name'])
)
);
}
ui_print_result_message(
$result,
__('Successfully deleted from %s', io_safe_input($server['server_name'])),
__('There was a problem deleting the user from %s', io_safe_input($server['server_name']))
);
}
}
}
}
if ((int) $status !== -1) { if ((int) $status !== -1) {
ui_print_result_message( ui_print_result_message(
$status, $status,
@ -1159,6 +1159,13 @@ if (is_user_admin($id) === true) {
); );
} }
html_print_div(
[
'id' => 'delete_profile_modal',
'content' => '',
]
);
$full_name = ' <div class="label_select_simple">'.html_print_input_text_extended( $full_name = ' <div class="label_select_simple">'.html_print_input_text_extended(
'fullname', 'fullname',
$user_info['fullname'], $user_info['fullname'],
@ -1931,24 +1938,87 @@ if (is_metaconsole() === false) {
} }
}); });
}); });
$('input:image[name="del"]').click(function(e) { $('input:image[name="del"]').click(function(e) {
if ($(json_profile).length > 0) return;
if (!confirm('Are you sure?')) return;
e.preventDefault();
var rows = $("#table_profiles tr").length;
if (((is_metaconsole === '1' && rows <= 4) || (is_metaconsole === '' && rows <= 3)) && user_is_global_admin !== '1') {
if (!confirm('<?php echo __('Deleting last profile will delete this user'); ?>' + '. ' + '<?php echo __('Are you sure?'); ?>')) {
return;
}
}
var rows = $("#table_profiles tr").length;
let deleteuser = 0;
e.preventDefault();
var id_user_profile = $(this).siblings(); var id_user_profile = $(this).siblings();
id_user_profile = id_user_profile[1].value; id_user_profile = id_user_profile[1].value;
var row = $(this).closest('tr'); var row = $(this).closest('tr');
if (((is_metaconsole === '1' && rows <= 3) || (is_metaconsole !== '1' && rows <= 3)) && user_is_global_admin !== '1') {
$("#delete_profile_modal")
.empty()
.html("<?php echo __('Deleting this profile will leave your user without a profile or group. You can continue by deleting the user or preserving it.'); ?>");
// Set the title.
$("#delete_profile_modal").prop("title", "<?php echo __('Are you sure?'); ?>");
// Build the dialog for show the mesage.
$("#delete_profile_modal").dialog({
resizable: true,
draggable: true,
modal: true,
width: 500,
buttons: [
{
text: "Cancel",
click: function() {
$(this).dialog("close");
return false;
}
},
{
text: "Delete",
click: function() {
$(this).dialog("close");
deleteuser = 1;
delete_user_profile(id_user_profile, row, id_user, deleteuser);
}
},
{
text: "Preserve",
click: function() {
$(this).dialog("close");
deleteuser = 0;
delete_user_profile(id_user_profile, row, id_user, deleteuser)
}
}
],
overlay: {
opacity: 0.5,
background: "black"
},
closeOnEscape: false,
open: function(event, ui) {
$(".ui-dialog-titlebar-close").hide();
}
});
} else {
if (((is_metaconsole === '1' && rows <= 3) || (is_metaconsole === '' && rows <= 3)) && user_is_global_admin !== '1') {
if (!confirm('<?php echo __('Deleting last profile will delete this user'); ?>' + '. ' + '<?php echo __('Are you sure?'); ?>')) {
return false;
} else {
delete_user_profile(id_user_profile, row, id_user, deleteuser);
}
} else {
if (!confirm('Are you sure?')) {
return false;
} else {
delete_user_profile(id_user_profile, row, id_user, deleteuser);
}
}
}
if ($(json_profile).length > 0) return;
});
function delete_user_profile(id_user_profile, row, id_user, deleteuser){
var params = []; var params = [];
params.push("delete_profile=1"); params.push("delete_profile=1");
params.push("edit_user=1");
params.push("delete_user=" + deleteuser);
params.push("id_user=" + id_user); params.push("id_user=" + id_user);
params.push("id_user_profile=" + id_user_profile); params.push("id_user_profile=" + id_user_profile);
params.push("page=godmode/users/configure_user"); params.push("page=godmode/users/configure_user");
@ -1959,15 +2029,14 @@ if (is_metaconsole() === false) {
success: function(data) { success: function(data) {
row.remove(); row.remove();
var rows = $("#table_profiles tr").length; var rows = $("#table_profiles tr").length;
if (is_metaconsole === '' && rows <= 2 && user_is_global_admin !== '1' && deleteuser == '1') {
if (is_metaconsole === '' && rows <= 2 && user_is_global_admin !== '1') {
window.location.replace("<?php echo ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure=0', false, false, false); ?>"); window.location.replace("<?php echo ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure=0', false, false, false); ?>");
} else if (is_metaconsole === '1' && rows <= 3 && user_is_global_admin !== '1') { } else if (is_metaconsole === '1' && rows <= 2 && user_is_global_admin !== '1' && deleteuser == '1') {
window.location.replace("<?php echo ui_get_full_url('index.php?sec=advanced&sec2=advanced/users_setup', false, false, true); ?>"); window.location.replace("<?php echo ui_get_full_url('index.php?sec=advanced&sec2=advanced/users_setup', false, false, true); ?>");
} }
} }
}); });
}); }
function checkProfiles(e) { function checkProfiles(e) {
e.preventDefault(); e.preventDefault();

View File

@ -81,6 +81,11 @@ $customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select(
false, false,
'width: 100%' 'width: 100%'
); );
// Home screen. Visual consoles.
$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select($layouts_aux, 'visual_console', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%');
// Home screen. External link and Other.
$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section_external', $user_info['data_section'], '', 60, 255, true);
$customHomeScreenAddition[HOME_SCREEN_OTHER] = html_print_input_text('data_section_other', $user_info['data_section'], '', 60, 255, true);
$layouts = visual_map_get_user_layouts($config['id_user'], true); $layouts = visual_map_get_user_layouts($config['id_user'], true);
$layouts_aux = []; $layouts_aux = [];
@ -859,50 +864,56 @@ $userManagementTable->data['fields_addSettings'][0] = html_print_textarea(
'' ''
); );
$userManagementTable->data['captions_addSettings'][1] = __('Login allowed IP list'); if (users_is_admin($config['id_user']) === true || (bool) check_acl($config['id_user'], 0, 'PM') === true) {
$userManagementTable->data['fields_addSettings'][1] = html_print_div( $allowAllIpsContent = [];
[ $allowAllIpsContent[] = '<span>'.__('Enable IP allowlist').'</span>';
'class' => 'edit_user_allowed_ip', $allowAllIpsContent[] = html_print_div(
'content' => html_print_textarea( [
'allowed_ip_list', 'content' => html_print_checkbox_switch(
5, 'allowed_ip_active',
65, 0,
($user_info['allowed_ip_list'] ?? ''), ($user_info['allowed_ip_active'] ?? 0),
(((bool) $view_mode === true) ? 'readonly="readonly"' : ''), true,
true false,
), 'handleIpAllowlist(this)'
], ),
true ],
); true
);
$userManagementTable->data['fields_addSettings'][1] .= ui_print_input_placeholder( $userManagementTable->data['captions_addSettings'][1] = html_print_div(
__('Add the source IPs that will allow console access. Each IP must be separated only by comma. * allows all.'), [
true 'class' => 'margin-top-10',
); 'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $allowAllIpsContent),
],
true
);
$allowAllIpsContent = []; $userManagementTable->data['fields_addSettings'][1] .= html_print_div(
$allowAllIpsContent[] = '<span>'.__('Allow all IPs').'</span>'; [
$allowAllIpsContent[] = html_print_div( 'class' => 'edit_user_allowed_ip '.(((int) $user_info['allowed_ip_active'] === 1) ? '' : 'invisible'),
[ 'content' => html_print_textarea(
'content' => html_print_checkbox_switch( 'allowed_ip_list',
'allowed_ip_active', 5,
0, 65,
($user_info['allowed_ip_active'] ?? 0), ($user_info['allowed_ip_list'] ?? ''),
true (((bool) $view_mode === true) ? 'readonly="readonly"' : ''),
), true
], ),
true ],
); true
);
$userManagementTable->data['fields_addSettings'][1] .= html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $allowAllIpsContent),
],
true
);
$userManagementTable->data['fields_addSettings'][1] .= ui_print_input_placeholder(
__('Add the source IPs that will allow console access. Each IP must be separated only by comma. * allows all.'),
true,
[
'id' => 'info_allowed_ip',
'class' => ((int) $user_info['allowed_ip_active'] === 1) ? 'input_sub_placeholder' : 'input_sub_placeholder invisible',
]
);
}
if ($config['ITSM_enabled'] && $config['ITSM_user_level_conf']) { if ($config['ITSM_enabled'] && $config['ITSM_user_level_conf']) {
// Pandora ITSM user remote login. // Pandora ITSM user remote login.
@ -1040,4 +1051,14 @@ $(document).ready(function () {
} }
}) })
}); });
function handleIpAllowlist(e){
if(e.checked === true) {
$('.edit_user_allowed_ip').show();
$('#info_allowed_ip').show();
} else {
$('.edit_user_allowed_ip').hide();
$('#info_allowed_ip').hide();
}
}
</script> </script>

View File

@ -1168,7 +1168,9 @@ if (check_login()) {
); );
} }
$data[2] .= '<a href ="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$id_agente.'&amp;tab=module&amp;id_agent_module='.$module['id_agente_modulo'].'&amp;edit_module='.$module['id_modulo'].'">';
$data[2] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '&hellip;', 'font-size: 9pt;'); $data[2] .= ui_print_truncate_text($module['nombre'], 'module_medium', false, true, true, '&hellip;', 'font-size: 9pt;');
$data[2] .= '</a>';
if (empty($module['extended_info']) === false) { if (empty($module['extended_info']) === false) {
$data[2] .= ui_print_help_tip($module['extended_info'], true, '/images/default_list.png'); $data[2] .= ui_print_help_tip($module['extended_info'], true, '/images/default_list.png');
} }

View File

@ -457,9 +457,7 @@ class AgentsAlerts extends HTML
$template2 = get_parameter('template'); $template2 = get_parameter('template');
$module_action_threshold = get_parameter('module_action_threshold'); $module_action_threshold = get_parameter('module_action_threshold');
$action_select = get_parameter('action_select', 0); $action_select = get_parameter('action_select', 0);
$id_alert = alerts_create_alert_agent_module($this->createAlert, $template2);
$id_alert = alerts_create_alert_agent_module($this->create_alert, $template2);
if ($id_alert !== false) { if ($id_alert !== false) {
if ($action_select != 0) { if ($action_select != 0) {
$values = []; $values = [];

View File

@ -737,7 +737,7 @@ class Diagnostics extends Wizard
$cpuModelName = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"'; $cpuModelName = 'cat /proc/cpuinfo | grep "model name" | tail -1 | cut -f 2 -d ":"';
$cpuProcessor = 'cat /proc/cpuinfo | grep "processor" | wc -l'; $cpuProcessor = 'cat /proc/cpuinfo | grep "processor" | wc -l';
$ramMemTotal = 'cat /proc/meminfo | grep "MemTotal"'; $ramMemTotal = 'cat /proc/meminfo | grep "MemTotal"';
$distroInfo = 'cat /etc/os-release | grep "PRETTY_NAME" | cut -f 2 -d "="';
exec( exec(
"ifconfig | awk '{ print $2}' | grep -E -o '([0-9]{1,3}[\.]){3}[0-9]{1,3}'", "ifconfig | awk '{ print $2}' | grep -E -o '([0-9]{1,3}[\.]){3}[0-9]{1,3}'",
$output $output
@ -756,6 +756,10 @@ class Diagnostics extends Wizard
'name' => __('RAM'), 'name' => __('RAM'),
'value' => exec($ramMemTotal), 'value' => exec($ramMemTotal),
], ],
'distroInfo' => [
'name' => __('Distro'),
'value' => str_replace('"', '', exec($distroInfo)),
],
'osInfo' => [ 'osInfo' => [
'name' => __('Os'), 'name' => __('Os'),
'value' => exec('uname -a'), 'value' => exec('uname -a'),

View File

@ -372,7 +372,7 @@ class WelcomeWindow extends Wizard
$flag_um = true; $flag_um = true;
} }
if (empty($config['welcome_mail_configured']) === false) { if (empty($config['email_username']) === false && empty($config['email_password']) === false) {
$btn_configure_mail_class = ''; $btn_configure_mail_class = '';
$li_configure_mail_class = 'row_green'; $li_configure_mail_class = 'row_green';
$flag_cm = true; $flag_cm = true;
@ -1135,7 +1135,7 @@ class WelcomeWindow extends Wizard
} }
function configureEmail() { function configureEmail() {
window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup&section=general#table3'); ?>'; window.location = '<?php echo ui_get_full_url('index.php?sec=general&sec2=godmode/setup/setup&section=general#table4'); ?>';
} }
function serversUp() { function serversUp() {

View File

@ -20,7 +20,7 @@
/** /**
* Pandora build version and version * Pandora build version and version
*/ */
$build_version = 'PC231127'; $build_version = 'PC231129';
$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

@ -4752,7 +4752,7 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
$secondary_groups = enterprise_hook('agents_get_secondary_groups', [$id_agente]); $secondary_groups = enterprise_hook('agents_get_secondary_groups', [$id_agente]);
$secondaryLinks = []; $secondaryLinks = [];
if (empty($secondary_groups['for_select']) === true) { if (empty($secondary_groups['for_select']) === true) {
$secondaryLinks[] = '<em>'.__('N/A').'</em>'; $secondaryLinks = [];
} else { } else {
foreach ($secondary_groups['for_select'] as $id => $name) { foreach ($secondary_groups['for_select'] as $id => $name) {
$secondaryLinks[] = html_print_anchor( $secondaryLinks[] = html_print_anchor(
@ -4811,22 +4811,22 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
'content' => groups_get_name($agent['id_grupo']), 'content' => groups_get_name($agent['id_grupo']),
], ],
true true
); ).' '.ui_print_group_icon($agent['id_grupo'], true, '', 'margin-left: 2%;', true, false, false, '', true);
$table_contact->data[] = $data; $table_contact->data[] = $data;
// Secondary groups. // Secondary groups.
$data = []; $data = [];
$data[0] = '<b>'.__('Secondary groups').'</b>'; if (!empty($secondaryLinks) === true) {
$data[1] = implode(', ', $secondaryLinks); $data[0] = '<b>'.__('Secondary groups').'</b>';
$table_contact->data[] = $data; $data[1] = implode(', ', $secondaryLinks);
$table_contact->data[] = $data;
}
// Parent agent line. // Parent agent line.
if (enterprise_installed() === true) { if (enterprise_installed() === true) {
$data = []; if ((int) $agent['id_parent'] !== 0) {
$data[0] = '<b>'.__('Parent').'</b>'; $data = [];
if ((int) $agent['id_parent'] === 0) { $data[0] = '<b>'.__('Parent').'</b>';
$data[1] = '<em>'.__('N/A').'</em>';
} else {
$data[1] = html_print_anchor( $data[1] = html_print_anchor(
[ [
'href' => 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$agent['id_parent'], 'href' => 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$agent['id_parent'],
@ -4834,9 +4834,9 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
], ],
true true
); );
}
$table_contact->data[] = $data; $table_contact->data[] = $data;
}
} }
// Last status change line. // Last status change line.
@ -4845,6 +4845,44 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
$data[1] = $time_elapsed; $data[1] = $time_elapsed;
$table_contact->data[] = $data; $table_contact->data[] = $data;
$has_remote_conf = enterprise_hook(
'config_agents_has_remote_configuration',
[$agent['id_agente']]
);
if ((bool) $has_remote_conf) {
$data = [];
$data[0] = __('Remote configuration');
$data[1] = '<spam style="position: relative;top: -10%; margin-right: 10px;">'.__('Enabled').'</spam>';
$data[1] .= html_print_menu_button(
[
'href' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$agent['id_agente'].'&disk_conf=1'),
'image' => 'images/remote-configuration@svg.svg',
'title' => __('Edit remote config'),
],
true
);
$satellite_server = (int) db_get_value_filter(
'satellite_server',
'tagente',
['id_agente' => $id_agente]
);
if (empty($satellite_server) === false) {
$satellite_name = db_get_value_filter(
'name',
'tserver',
['id_server' => $satellite_server]
);
$data[0] = __('Satellite server');
$data[1] = $satellite_name;
}
$table_contact->data[] = $data;
}
if (enterprise_installed() === true) { if (enterprise_installed() === true) {
// SecurityMon line. // SecurityMon line.
$id_module_group = db_get_value('id_mg', 'tmodule_group', 'name', 'Security'); $id_module_group = db_get_value('id_mg', 'tmodule_group', 'name', 'Security');
@ -4887,6 +4925,43 @@ function get_resume_agent_concat($id_agente, $all_groups, $agent)
} }
} }
// Optional data
// Position Information.
if ((bool) $config['activate_gis'] === true) {
$data = [];
$dataPositionAgent = gis_get_data_last_position_agent(
$agent['id_agente']
);
if (is_array($dataPositionAgent) === true && $dataPositionAgent['stored_longitude'] !== '' && $dataPositionAgent['stored_latitude'] !== '') {
$data[0] = __('Position (Long, Lat)');
$dataOptionalOutput = html_print_anchor(
[
'href' => 'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;tab=gis&amp;id_agente='.$id_agente,
'content' => $dataPositionAgent['stored_longitude'].', '.$dataPositionAgent['stored_latitude'],
],
true
);
if (empty($dataPositionAgent['description']) === false) {
$dataOptionalOutput .= ' ('.$dataPositionAgent['description'].')';
}
$data[1] = $dataOptionalOutput;
}
$table_contact->data[] = $data;
}
// Timezone Offset.
if ((int) $agent['timezone_offset'] !== 0) {
$data = [];
$data[0] = __('Timezone Offset');
$data[1] = $agent['timezone_offset'];
$table_contact->data[] = $data;
}
$agent_contact = html_print_div( $agent_contact = html_print_div(
[ [
'class' => 'agent_details_header', 'class' => 'agent_details_header',

View File

@ -371,6 +371,10 @@ function config_update_config()
$error_update[] = __('show_experimental_features'); $error_update[] = __('show_experimental_features');
} }
if (config_update_value('number_modules_queue', get_parameter('number_modules_queue'), true) === false) {
$error_update[] = __('number_modules_queue');
}
if (config_update_value('console_log_enabled', get_parameter('console_log_enabled'), true) === false) { if (config_update_value('console_log_enabled', get_parameter('console_log_enabled'), true) === false) {
$error_update[] = __('Console log enabled'); $error_update[] = __('Console log enabled');
} }
@ -2441,6 +2445,10 @@ function config_process_config()
config_update_value('show_experimental_features', 0); config_update_value('show_experimental_features', 0);
} }
if (!isset($config['number_modules_queue'])) {
config_update_value('number_modules_queue', 500);
}
if (!isset($config['agent_vulnerabilities'])) { if (!isset($config['agent_vulnerabilities'])) {
config_update_value('agent_vulnerabilities', 1); config_update_value('agent_vulnerabilities', 1);
} }

View File

@ -774,6 +774,7 @@ function html_print_select(
$select2_multiple_enable_all=false, $select2_multiple_enable_all=false,
$form='', $form='',
$order=false, $order=false,
$custom_id=null
) { ) {
$output = "\n"; $output = "\n";
@ -789,6 +790,10 @@ function html_print_select(
$id = preg_replace('/[^a-z0-9\:\;\-\_]/i', '', $name.($idcounter[$name] ? $idcounter[$name] : '')); $id = preg_replace('/[^a-z0-9\:\;\-\_]/i', '', $name.($idcounter[$name] ? $idcounter[$name] : ''));
if ($custom_id !== null) {
$id = $custom_id;
}
$attributes = ''; $attributes = '';
if (!empty($script)) { if (!empty($script)) {
$attributes .= ' onchange="'.$script.'"'; $attributes .= ' onchange="'.$script.'"';
@ -1740,20 +1745,37 @@ function html_print_select_multiple_modules_filtered(array $data):string
} }
} }
$output .= html_print_input( if (is_metaconsole() === true) {
[ $output .= html_print_input(
'label' => __('Agents'), [
'label_class' => 'font-title-font', 'label' => __('Agents'),
'type' => 'select_from_sql', 'label_class' => 'font-title-font',
'sql' => 'SELECT `id_agente`,`alias` FROM tagente', 'type' => 'select',
'name' => 'filtered-module-agents-'.$uniqId, 'fields' => $agents,
'selected' => explode(',', $data['mAgents']), 'name' => 'filtered-module-agents-'.$uniqId,
'return' => true, 'selected' => explode(',', $data['mAgents']),
'multiple' => true, 'return' => true,
'style' => 'min-width: 200px;max-width:200px;', 'multiple' => true,
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')', 'style' => 'min-width: 200px;max-width:200px;',
] 'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
); ]
);
} else {
$output .= html_print_input(
[
'label' => __('Agents'),
'label_class' => 'font-title-font',
'type' => 'select_from_sql',
'sql' => 'SELECT `id_agente`,`alias` FROM tagente',
'name' => 'filtered-module-agents-'.$uniqId,
'selected' => explode(',', $data['mAgents']),
'return' => true,
'multiple' => true,
'style' => 'min-width: 200px;max-width:200px;',
'script' => 'fmModuleChange(\''.$uniqId.'\', '.(int) is_metaconsole().')',
]
);
}
$commonModules = 0; $commonModules = 0;
if (empty($data['mShowCommonModules']) === false) { if (empty($data['mShowCommonModules']) === false) {

View File

@ -1170,6 +1170,14 @@ if (is_ajax()) {
<p style="font-size: 10pt;">'.$sys_info->data->ramInfo->value.'</p> <p style="font-size: 10pt;">'.$sys_info->data->ramInfo->value.'</p>
</th> </th>
</tr> </tr>
<tr>
<th style="width: 15%;">
<p><span>'.$sys_info->data->distroInfo->name.'</span></p>
</th>
<th style="width: 85%;">
<p style="font-size: 10pt;">'.$sys_info->data->distroInfo->value.'</p>
</th>
</tr>
<tr> <tr>
<th style="width: 15%;"> <th style="width: 15%;">
<p><span>'.$sys_info->data->osInfo->name.'</span></p> <p><span>'.$sys_info->data->osInfo->name.'</span></p>

View File

@ -122,6 +122,7 @@ function messages_create_message(
'id_usuario_origen' => $usuario_origen, 'id_usuario_origen' => $usuario_origen,
'subject' => $subject, 'subject' => $subject,
'mensaje' => $mensaje, 'mensaje' => $mensaje,
'subtype' => 'NOTIF.MESSAGE',
'id_source' => get_notification_source_id('message'), 'id_source' => get_notification_source_id('message'),
'timestamp' => get_system_time(), 'timestamp' => get_system_time(),
] ]

View File

@ -4735,7 +4735,7 @@ function export_agents_module_csv($filters)
$query_filter .= ' AND tam.nombre IN '.$module_filter.' '; $query_filter .= ' AND tam.nombre IN '.$module_filter.' ';
} else { } else {
$module_filter = '('.implode(', ', $filter).')'; $module_filter = '('.implode(', ', $filter).')';
$query_filter .= ' AND tam.id_tipo_modulo IN '.$module_filter.' '; $query_filter .= ' AND tam.id_agente_modulo IN '.$module_filter.' ';
} }
} }
break; break;

View File

@ -308,7 +308,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
'del', 'del',
'images/delete.svg', 'images/delete.svg',
1, 1,
'', 'background-color: transparent !important;',
true, true,
[ [
'onclick' => 'delete_profile(event, this)', 'onclick' => 'delete_profile(event, this)',
@ -316,8 +316,15 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
] ]
); );
} else { } else {
$data['actions'] = '<form method="post" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">'; $data['actions'] = '<form method="post" onsubmit="">';
$data['actions'] .= html_print_input_image('del', 'images/delete.svg', 1, '', true, ['class' => 'main_menu_icon invert_filter']); $data['actions'] .= html_print_input_image(
'del',
'images/delete.svg',
1,
'background-color: transparent !important;',
true,
['class' => 'main_menu_icon invert_filter']
);
$data['actions'] .= html_print_input_hidden('delete_profile', 1, true); $data['actions'] .= html_print_input_hidden('delete_profile', 1, true);
$data['actions'] .= html_print_input_hidden('id_user_profile', $profile['id_up'], true); $data['actions'] .= html_print_input_hidden('id_user_profile', $profile['id_up'], true);
$data['actions'] .= html_print_input_hidden('id_user', $id, true); $data['actions'] .= html_print_input_hidden('id_user', $id, true);
@ -391,7 +398,14 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
$data['last_hierarchy'] = html_print_checkbox('no_hierarchy', 1, false, true); $data['last_hierarchy'] = html_print_checkbox('no_hierarchy', 1, false, true);
$data['last_actions'] = html_print_input_image('add', 'images/validate.svg', 1, '', true, ['class' => 'main_menu_icon invert_filter']); $data['last_actions'] = html_print_input_image(
'add',
'images/validate.svg',
1,
'background-color: transparent !important;',
true,
['class' => 'main_menu_icon invert_filter']
);
$data['last_actions'] .= html_print_input_hidden('id', $id, true); $data['last_actions'] .= html_print_input_hidden('id', $id, true);
$data['last_actions'] .= html_print_input_hidden('add_profile', 1, true); $data['last_actions'] .= html_print_input_hidden('add_profile', 1, true);
$data['last_actions'] .= '</form>'; $data['last_actions'] .= '</form>';

View File

@ -42,6 +42,7 @@ require_once $config['homedir'].'/include/functions_users.php';
enterprise_include_once('include/functions_reporting.php'); enterprise_include_once('include/functions_reporting.php');
enterprise_include_once('include/functions_metaconsole.php'); enterprise_include_once('include/functions_metaconsole.php');
enterprise_include_once('include/functions_inventory.php'); enterprise_include_once('include/functions_inventory.php');
require_once $config['homedir'].'/include/functions_inventory.php';
enterprise_include_once('include/functions_cron.php'); enterprise_include_once('include/functions_cron.php');
require_once $config['homedir'].'/include/functions_forecast.php'; require_once $config['homedir'].'/include/functions_forecast.php';
require_once $config['homedir'].'/include/functions_ui.php'; require_once $config['homedir'].'/include/functions_ui.php';
@ -1023,6 +1024,62 @@ function reporting_make_reporting_data(
); );
break; break;
case 'vuls_severity_graph':
$report['contents'][] = reporting_vuls_severity_graph(
$report,
$content,
$type
);
break;
case 'vuls_attack_complexity':
$report['contents'][] = reporting_vuls_attack_complexity_graph(
$report,
$content,
$type
);
break;
case 'vuls_by_packages':
$report['contents'][] = reporting_vuls_by_packages_graph(
$report,
$content,
$type
);
break;
case 'vuls_by_agent':
$report['contents'][] = reporting_vuls_by_agent(
$report,
$content,
$type
);
break;
case 'vuls_info_agent':
$report['contents'][] = reporting_vuls_info_agent(
$report,
$content,
$type
);
break;
case 'top_n_agents_vuls':
$report['contents'][] = reporting_top_n_agents_vuls(
$report,
$content,
$type
);
break;
case 'top_n_vuls_count':
$report['contents'][] = reporting_top_n_vuls_count(
$report,
$content,
$type
);
break;
default: default:
// Default. // Default.
break; break;
@ -13641,38 +13698,47 @@ function reporting_tiny_stats(
} }
if ($modern === true) { if ($modern === true) {
$out .= '<div id="bullets_modules">';
if (isset($fired_count) && $fired_count > 0) { if (isset($fired_count) && $fired_count > 0) {
$out .= '<div class="bullets_modules">';
$out .= '<div><div id="fired_count_'.$uniq_id.'" class="forced_title bullet_modules orange_background"></div>'; $out .= '<div><div id="fired_count_'.$uniq_id.'" class="forced_title bullet_modules orange_background"></div>';
$out .= '<span class="font_12pt">'.$fired_count.'</span></div>'; $out .= '<span class="font_12pt">'.$fired_count.'</span></div>';
$out .= '</div>';
} }
if (isset($critical_count) && $critical_count > 0) { if (isset($critical_count) && $critical_count > 0) {
$out .= '<div class="bullets_modules">';
$out .= '<div><div id="critical_count_'.$uniq_id.'" class="forced_title bullet_modules red_background"></div>'; $out .= '<div><div id="critical_count_'.$uniq_id.'" class="forced_title bullet_modules red_background"></div>';
$out .= '<span class="font_12pt">'.$critical_count.'</span></div>'; $out .= '<span class="font_12pt">'.$critical_count.'</span></div>';
$out .= '</div>';
} }
if (isset($warning_count) && $warning_count > 0) { if (isset($warning_count) && $warning_count > 0) {
$out .= '<div class="bullets_modules">';
$out .= '<div><div id="warning_count_'.$uniq_id.'" class="forced_title bullet_modules yellow_background"></div>'; $out .= '<div><div id="warning_count_'.$uniq_id.'" class="forced_title bullet_modules yellow_background"></div>';
$out .= '<span class="font_12pt">'.$warning_count.'</span></div>'; $out .= '<span class="font_12pt">'.$warning_count.'</span></div>';
$out .= '</div>';
} }
if (isset($unknown_count) && $unknown_count > 0) { if (isset($unknown_count) && $unknown_count > 0) {
$out .= '<div class="bullets_modules">';
$out .= '<div><div id="unknown_count_'.$uniq_id.'" class="forced_title bullet_modules grey_background"></div>'; $out .= '<div><div id="unknown_count_'.$uniq_id.'" class="forced_title bullet_modules grey_background"></div>';
$out .= '<span class="font_12pt">'.$unknown_count.'</span></div>'; $out .= '<span class="font_12pt">'.$unknown_count.'</span></div>';
$out .= '</div>';
} }
if (isset($not_init_count) && $not_init_count > 0) { if (isset($not_init_count) && $not_init_count > 0) {
$out .= '<div class="bullets_modules">';
$out .= '<div><div id="not_init_count_'.$uniq_id.'" class="forced_title bullet_modules blue_background"></div>'; $out .= '<div><div id="not_init_count_'.$uniq_id.'" class="forced_title bullet_modules blue_background"></div>';
$out .= '<span class="font_12pt">'.$not_init_count.'</span></div>'; $out .= '<span class="font_12pt">'.$not_init_count.'</span></div>';
$out .= '</div>';
} }
if (isset($normal_count) && $normal_count > 0) { if (isset($normal_count) && $normal_count > 0) {
$out .= '<div class="bullets_modules">';
$out .= '<div><div id="normal_count_'.$uniq_id.'" class="forced_title bullet_modules green_background"></div>'; $out .= '<div><div id="normal_count_'.$uniq_id.'" class="forced_title bullet_modules green_background"></div>';
$out .= '<span class="font_12pt">'.$normal_count.'</span></div>'; $out .= '<span class="font_12pt">'.$normal_count.'</span></div>';
$out .= '</div>';
} }
$out .= '</div>';
} else { } else {
// Classic ones. // Classic ones.
$out .= '<b><span id="total_count_'.$uniq_id.'" class="forced_title" >'.$total_count.'</span>'; $out .= '<b><span id="total_count_'.$uniq_id.'" class="forced_title" >'.$total_count.'</span>';

View File

@ -507,6 +507,34 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust
case 'evolution': case 'evolution':
reporting_evolution_graph($table, $item); reporting_evolution_graph($table, $item);
break; break;
case 'vuls_severity_graph':
reporting_html_vuls_severity_graph($table, $item);
break;
case 'vuls_attack_complexity':
reporting_html_vuls_attack_complexity($table, $item);
break;
case 'vuls_by_packages':
reporting_html_vuls_by_packages($table, $item);
break;
case 'vuls_by_agent':
reporting_html_vuls_by_agent($table, $item);
break;
case 'vuls_info_agent':
reporting_html_vuls_info_agent($table, $item);
break;
case 'top_n_agents_vuls':
reporting_html_top_n_agents_vuls($table, $item);
break;
case 'top_n_vuls_count':
reporting_html_top_n_vuls_count($table, $item);
break;
} }
if ($item['type'] == 'agent_module') { if ($item['type'] == 'agent_module') {
@ -522,6 +550,300 @@ function reporting_html_print_report($report, $mini=false, $report_info=1, $cust
} }
/**
* Function to print top vulnerabiries more common.
*
* @param object $table Head table or false if it comes from pdf.
* @param array $item Items data.
* @param integer $pdf Flag for return table.
*
* @return mixed
*/
function reporting_html_top_n_vuls_count($table, $item, $pdf=0)
{
global $config;
$table->width = '99%';
$table->styleTable = 'border: 0px;';
$table->colspan[2][0] = 3;
$table1 = new stdClass();
$table1->headstyle = [];
$table1->width = '99%';
$table1->class = 'info_table';
$table1->titleclass = 'title_table_pdf';
$table1->rowclass[0] = '';
$table1->head[0] = __('Vulnerability');
$table1->head[2] = __('Total');
$row = 2;
foreach ($item['data'] as $key => $vul) {
$table1->data[$row][0] = $vul['cve_id'];
$table1->data[$row][2] = $vul['count'];
$row++;
}
if ($pdf === 1) {
$table1->title = $item['title'];
$table1->titleclass = 'title_table_pdf';
$table1->titlestyle = 'text-align:left;';
}
$table->data[2][0] = html_print_table($table1, true);
if ($pdf === 1) {
return html_print_table($table, true);
}
}
/**
* Function to print top agents with worst score.
*
* @param object $table Head table or false if it comes from pdf.
* @param array $item Items data.
* @param integer $pdf Flag for return table.
*
* @return mixed
*/
function reporting_html_top_n_agents_vuls($table, $item, $pdf=0)
{
global $config;
$table->width = '99%';
$table->styleTable = 'border: 0px;';
$table->colspan[2][0] = 3;
$table1 = new stdClass();
$table1->headstyle = [];
$table1->width = '99%';
$table1->class = 'info_table';
$table1->titleclass = 'title_table_pdf';
$table1->rowclass[0] = '';
$table1->head[0] = __('Agent');
$table1->head[2] = __('Risk');
$row = 2;
foreach ($item['data'] as $key => $agent) {
$table1->data[$row][0] = $agent['alias'];
$table1->data[$row][2] = $agent['score'];
$row++;
}
if ($pdf === 1) {
$table1->title = $item['title'];
$table1->titleclass = 'title_table_pdf';
$table1->titlestyle = 'text-align:left;';
}
$table->data[2][0] = html_print_table($table1, true);
if ($pdf === 1) {
return html_print_table($table, true);
}
}
/**
* Function to print vulnerabilities of agent.
*
* @param object $table Head table or false if it comes from pdf.
* @param array $item Items data.
* @param integer $pdf Flag for return table.
*
* @return mixed
*/
function reporting_html_vuls_info_agent($table, $item, $pdf=0)
{
$table->width = '99%';
$table->styleTable = 'border: 0px;';
$table->colspan[2][0] = 3;
$table1 = new stdClass();
$table1->headstyle[0] = 'text-align: left';
$table1->headstyle[1] = 'text-align: left';
$table1->headstyle[2] = 'text-align: left';
$table1->width = '99%';
$table1->class = 'info_table';
$table1->titleclass = 'title_table_pdf';
$table1->rowclass[0] = '';
$table1->head[0] = __('Name');
$table1->head[1] = __('CVE');
$table1->head[2] = __('Version');
$table1->head[3] = __('Score');
$table1->head[4] = __('Detection time');
$table1->head[5] = __('Severity');
$table1->head[6] = __('Version');
$table1->head[7] = __('Attack Vector');
$table1->head[8] = __('Attack Complexity');
$table1->head[9] = __('Privileges Required');
$table1->head[10] = __('User Interaction');
$table1->head[11] = __('Scope');
$table1->head[12] = __('Confidentiality');
$table1->head[13] = __('Integrity');
$table1->head[14] = __('Availability');
$row = 1;
foreach ($item['data'] as $key => $vul) {
$table1->data[$row][0] = (key_exists('name', $vul) === true) ? $vul['name'] : '';
$table1->data[$row][1] = (key_exists('cve', $vul) === true) ? $vul['cve'] : '';
$table1->data[$row][2] = (key_exists('version', $vul) === true) ? $vul['version'] : '';
$table1->data[$row][3] = (key_exists('score', $vul) === true) ? $vul['score'] : '';
$table1->data[$row][4] = (key_exists('detection_time', $vul) === true) ? $vul['detection_time'] : '';
$table1->data[$row][5] = (key_exists('severity', $vul) === true) ? $vul['severity'] : '';
$table1->data[$row][6] = (key_exists('CVSS', $vul) === true) ? $vul['CVSS'] : '';
$table1->data[$row][7] = (key_exists('AV', $vul) === true) ? $vul['AV'] : '';
$table1->data[$row][8] = (key_exists('AC', $vul) === true) ? $vul['AC'] : '';
$table1->data[$row][9] = (key_exists('PR', $vul) === true) ? $vul['PR'] : '';
$table1->data[$row][10] = (key_exists('UI', $vul) === true) ? $vul['UI'] : '';
$table1->data[$row][11] = (key_exists('S', $vul) === true) ? $vul['S'] : '';
$table1->data[$row][12] = (key_exists('C', $vul) === true) ? $vul['C'] : '';
$table1->data[$row][13] = (key_exists('I', $vul) === true) ? $vul['I'] : '';
$table1->data[$row][14] = (key_exists('A', $vul) === true) ? $vul['A'] : '';
$row++;
}
$table->data[2][0] = html_print_table($table1, true);
if ($pdf === 1) {
$table1->title = $item['title'];
$table1->titleclass = 'title_table_pdf';
$table1->titlestyle = 'text-align:left;';
return html_print_table($table1, true);
}
}
/**
* Function to print total vulnerabilities by packages in graph.
*
* @param object $table Head table or false if it comes from pdf.
* @param array $item Items data.
* @param integer $pdf Flag for return table.
*
* @return mixed
*/
function reporting_html_vuls_by_packages($table, $item, $pdf=0)
{
$table->rowclass[0] = '';
$table->colspan['chart']['cell'] = 3;
$table->cellstyle['chart']['cell'] = 'text-align: center;';
$table->data['chart']['cell'] = $item['chart'];
if ($pdf === 1) {
return html_print_table($table, true);
}
}
/**
* Function to print attack complexity in graph
*
* @param object $table Head table or false if it comes from pdf.
* @param array $item Items data.
* @param integer $pdf Flag for return table.
*
* @return mixed
*/
function reporting_html_vuls_attack_complexity($table, $item, $pdf=0)
{
$table->rowclass[0] = '';
$table->colspan['chart']['cell'] = 3;
$table->cellstyle['chart']['cell'] = 'text-align: center;';
$table->data['chart']['cell'] = html_print_div(
[
'content' => $item['chart'],
'style' => 'width: 450px; height: 300px; margin: 0 auto;',
],
true
);
if ($pdf === 1) {
return html_print_table($table, true);
}
}
/**
* Function to print the severity vuls in graph.
*
* @param object $table Head table or false if it comes from pdf.
* @param array $item Items data.
* @param integer $pdf Flag for return table.
*
* @return mixed
*/
function reporting_html_vuls_severity_graph($table, $item, $pdf=0)
{
$table->rowclass[0] = '';
$table->colspan['chart']['cell'] = 3;
$table->cellstyle['chart']['cell'] = 'text-align: center;';
$table->data['chart']['cell'] = $item['chart'];
if ($pdf === 1) {
return html_print_table($table, true);
}
}
/**
* Function to print the all vulnerabilities by agent.
*
* @param object $table Head table or false if it comes from pdf.
* @param array $item Items data.
* @param integer $pdf Flag for return table.
*
* @return mixed
*/
function reporting_html_vuls_by_agent($table, $item, $pdf=0)
{
$table->width = '99%';
$table->styleTable = 'border: 0px;';
$table->colspan[2][0] = 3;
$table1 = new stdClass();
$table1->headstyle[0] = 'text-align: left';
$table1->headstyle[1] = 'text-align: left';
$table1->headstyle[2] = 'text-align: left';
$table1->width = '99%';
$table1->class = 'info_table';
$table1->titleclass = 'title_table_pdf';
$table1->rowclass[0] = '';
$table1->head[0] = __('Agent');
$table1->head[1] = __('OS');
$table1->head[2] = __('OS Version');
$table1->head[3] = __('Group');
$table1->head[4] = __('Ip');
$table1->head[5] = __('Status');
$table1->head[6] = __('SecMon');
$table1->head[7] = __('Hardening');
$table1->head[8] = __('Vulnerability');
$table1->head[9] = __('Last contact');
$table1->head[10] = __('L.S. Change');
$row = 1;
foreach ($item['data'] as $key => $vul) {
$table1->data[$row][0] = $vul['alias'];
$table1->data[$row][2] = $vul['name'];
$table1->data[$row][3] = $vul['os_version'];
$table1->data[$row][4] = $vul['nombre_gr'];
$table1->data[$row][5] = $vul['direccion'];
$table1->data[$row][6] = $vul['status'];
$table1->data[$row][7] = $vul['secmon'];
$table1->data[$row][8] = $vul['hardening'];
$table1->data[$row][9] = $vul['vulnerabilities'];
$table1->data[$row][10] = $vul['ultimo_contacto'];
$table1->data[$row][11] = $vul['last_status_c'];
$row++;
}
if ($pdf === 1) {
$table1->title = $item['title'];
$table1->titleclass = 'title_table_pdf';
$table1->titlestyle = 'text-align:left;';
}
$table->data[2][0] = html_print_table($table1, true);
if ($pdf === 1) {
return html_print_table($table1, true);
}
}
/** /**
* Function to print the security hardening evolution. * Function to print the security hardening evolution.
* *

View File

@ -1003,6 +1003,41 @@ function reports_get_report_types($template=false, $not_editor=false)
'optgroup' => __('Security hardening'), 'optgroup' => __('Security hardening'),
'name' => __('Evolution'), 'name' => __('Evolution'),
]; ];
$types['vuls_severity_graph'] = [
'optgroup' => __('Vulnerabilities'),
'name' => __('Severity graph bar'),
];
$types['vuls_attack_complexity'] = [
'optgroup' => __('Vulnerabilities'),
'name' => __('Attack complexity graph donut'),
];
$types['vuls_by_packages'] = [
'optgroup' => __('Vulnerabilities'),
'name' => __('By packages in graph pie'),
];
$types['vuls_by_agent'] = [
'optgroup' => __('Vulnerabilities'),
'name' => __('Detailed security report'),
];
$types['vuls_info_agent'] = [
'optgroup' => __('Vulnerabilities'),
'name' => __('Vulnerabilities of agent'),
];
$types['top_n_agents_vuls'] = [
'optgroup' => __('Vulnerabilities'),
'name' => __('Top-N agents with more risk'),
];
$types['top_n_vuls_count'] = [
'optgroup' => __('Vulnerabilities'),
'name' => __('Top-N common vulnerabilities'),
];
} }
return $types; return $types;

View File

@ -409,8 +409,7 @@ function ui_print_message($message, $class='', $attributes='', $return=false, $t
$messageTable->colspan[1][0] = 2; $messageTable->colspan[1][0] = 2;
$messageTable->data = []; $messageTable->data = [];
$messageTable->data[0][0] = '<b>'.$text_title.'</b>'; $messageTable->data[0][0] = '<b>'.$text_title.'</b>'.$closeButton;
$messageTable->data[0][1] = $closeButton;
$messageTable->data[1][0] = '<span>'.$text_message.'</b>'; $messageTable->data[1][0] = '<span>'.$text_message.'</b>';
// JavaScript help vars. // JavaScript help vars.

View File

@ -331,9 +331,13 @@
id_group: id_group id_group: id_group
}, },
function(data) { function(data) {
let routeImg =
typeof data.folder === "undefined"
? "images/"
: "images/" + data.folder;
$("img", config.spanPreview).attr( $("img", config.spanPreview).attr(
"src", "src",
"images/" + data["icon"] routeImg + data["icon"]
); );
$("a", config.spanPreview).attr("href", hrefNew); $("a", config.spanPreview).attr("href", hrefNew);
}, },

View File

@ -305,7 +305,7 @@ function agent_changed_by_multiple_agents(event, id_agent, selected) {
$("<option></option>") $("<option></option>")
.html(anyText) .html(anyText)
.attr("value", 0) .attr("value", 0)
.prop("selected", true) .prop("selected", false)
); );
} }
} }
@ -1653,6 +1653,10 @@ function paint_graph_status(
max_c = 0; max_c = 0;
} }
// Remove Error class.
$("#text-max_warning").removeClass("input_error");
$("#text-max_critical").removeClass("input_error");
//if haven't errors //if haven't errors
if (error_w == 0 && error_c == 0) { if (error_w == 0 && error_c == 0) {
//parse element //parse element
@ -1958,6 +1962,9 @@ function paint_graph_status(
.html(message_error_critical) .html(message_error_critical)
.style("text-anchor", "first"); .style("text-anchor", "first");
} }
if (error_c == 2) {
$("#text-max_critical").addClass("input_error");
}
} }
} }

View File

@ -310,8 +310,6 @@ function initialiceLayout(data) {
} }
function duplicateWidget(original_cellId, original_widgetId) { function duplicateWidget(original_cellId, original_widgetId) {
let duplicate_cellId = insertCellLayoutForDuplicate();
$.ajax({ $.ajax({
method: "post", method: "post",
url: data.url, url: data.url,
@ -320,16 +318,14 @@ function initialiceLayout(data) {
method: "duplicateWidget", method: "duplicateWidget",
dashboardId: data.dashboardId, dashboardId: data.dashboardId,
widgetId: original_widgetId, widgetId: original_widgetId,
cellId: original_cellId, cellId: original_cellId
duplicateCellId: duplicate_cellId
}, },
dataType: "json", dataType: "json",
success: function(success) { success: function(data) {
console.log(success); addCell(data.cellId, 0, 0, 4, 4, true, 0, 2000, 0, 2000, 0, true);
}, },
error: function(error) { error: function(xhr, textStatus, errorMessage) {
console.log(error); console.log("ERROR" + errorMessage + textStatus + xhr);
return [];
} }
}); });
} }
@ -428,8 +424,8 @@ function initialiceLayout(data) {
} }
}); });
} }
/*
function insertCellLayoutForDuplicate() { function insertCellLayoutForDuplicate(original_cell_id) {
let duplicateCellId = 0; let duplicateCellId = 0;
$.ajax({ $.ajax({
async: false, async: false,
@ -441,7 +437,8 @@ function initialiceLayout(data) {
dashboardId: data.dashboardId, dashboardId: data.dashboardId,
auth_class: data.auth.class, auth_class: data.auth.class,
auth_hash: data.auth.hash, auth_hash: data.auth.hash,
id_user: data.auth.user id_user: data.auth.user,
copy: original_cell_id
}, },
dataType: "json", dataType: "json",
success: function(data) { success: function(data) {
@ -449,7 +446,7 @@ function initialiceLayout(data) {
// width and height = 4 // width and height = 4
// position auto = true. // position auto = true.
if (data.cellId !== 0) { if (data.cellId !== 0) {
addCell(data.cellId, 0, 0, 4, 4, true, 0, 2000, 0, 2000, 0, true); addCell(data.cellId, 0, 0, 4, 4, true, 0, 2000, 0, 2000, 0, true, original_cell_id);
duplicateCellId = data.cellId; duplicateCellId = data.cellId;
} }
}, },
@ -458,7 +455,7 @@ function initialiceLayout(data) {
} }
}); });
return duplicateCellId; return duplicateCellId;
} }*/
function configurationWidget(cellId, widgetId, size) { function configurationWidget(cellId, widgetId, size) {
load_modal({ load_modal({

View File

@ -615,10 +615,25 @@ class Manager implements PublicLogin
/** /**
* Duplicate widget. * Duplicate widget.
* *
* @return integer * @return void
*/ */
public function duplicateWidget():int public function duplicateWidget():void
{ {
global $config;
$return = false;
$position = [
'x' => 0,
'y' => 0,
'width' => 4,
'height' => 4,
];
$cellClass = new Cell($position, $this->dashboardId);
$dataCell = $cellClass->get();
// $result = ['cellId' => $dataCell['id']];
$original_widget = []; $original_widget = [];
$original_cellId = $this->cellId; $original_cellId = $this->cellId;
@ -638,12 +653,23 @@ class Manager implements PublicLogin
'options' => $options_json, 'options' => $options_json,
'id_widget' => $original_widget['id_widget'], 'id_widget' => $original_widget['id_widget'],
]; ];
$res = \db_process_sql_update( $res = \db_process_sql_update(
'twidget_dashboard', 'twidget_dashboard',
$values, $values,
['id' => $this->duplicateCellId] ['id' => $dataCell['id']]
); );
return $res;
if ($res === 1) {
$return = [
'cellId' => $dataCell['id'],
'widgetId' => $original_widget['id_widget'],
];
$json_return = json_encode($return);
}
echo $json_return;
} }

View File

@ -393,9 +393,10 @@ class InventoryWidget extends Widget
public function load() public function load()
{ {
global $config; global $config;
include_once $config['homedir'].'/include/functions_inventory.php';
$inventory_id_agent = $this->values['agentId']; $inventory_id_agent = $this->values['agentId'];
$inventory_agent = $this->values['agentAlias']; $inventory_agent = $this->values['agentAlias'];
$cellId = $this->cellId;
if (strlen($inventory_agent) === 0) { if (strlen($inventory_agent) === 0) {
$inventory_id_agent = -1; $inventory_id_agent = -1;
@ -610,7 +611,7 @@ class InventoryWidget extends Widget
} }
} }
$id_table = 'id_'.$row['id_module_inventory'].'_'.uniqid().'_'.$nodo['server_uid']; $id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid'].'_'.$cellId;
$table = ui_print_datatable( $table = ui_print_datatable(
[ [
'id' => $id_table, 'id' => $id_table,
@ -682,7 +683,7 @@ class InventoryWidget extends Widget
$agents, $agents,
'<span class="toggle-inventory-nodo">'.$node_name.'</span>', '<span class="toggle-inventory-nodo">'.$node_name.'</span>',
'', '',
'', $cellId,
false, false,
false, false,
'', '',
@ -729,7 +730,7 @@ class InventoryWidget extends Widget
} }
} }
$id_table = 'id_'.$row['id_module_inventory'].'_'.uniqid().'_'.$nodo['server_uid']; $id_table = 'id_'.$row['id_module_inventory'].'_'.$nodo['server_uid'].'_'.$cellId;
$table = ui_print_datatable( $table = ui_print_datatable(
[ [
@ -801,7 +802,7 @@ class InventoryWidget extends Widget
$agents, $agents,
'<span class="toggle-inventory-nodo">'.$node_name.'</span>', '<span class="toggle-inventory-nodo">'.$node_name.'</span>',
'', '',
'', $cellId,
false, false,
false false
); );
@ -826,7 +827,7 @@ class InventoryWidget extends Widget
); );
} }
if (count($agents_ids) === 0 || (int) $rows === ERR_NODATA) { if (count($agents_ids) === 0 || (int) $rows === ERR_NODATA || empty($rows) === true) {
ui_print_info_message( ui_print_info_message(
[ [
'no_close' => true, 'no_close' => true,
@ -895,7 +896,7 @@ class InventoryWidget extends Widget
} }
} }
$id_table = 'id_'.$key_row.'_'.$row['id_module_inventory'].'_'.uniqid().'_'.$row['id_agente']; $id_table = 'id_'.$key_row.'_'.$row['id_module_inventory'].'_'.$row['id_agente'].'_'.$cellId;
$table = ui_print_datatable( $table = ui_print_datatable(
[ [
@ -950,7 +951,7 @@ class InventoryWidget extends Widget
$modules, $modules,
$agent_rows['agent'], $agent_rows['agent'],
'', '',
'', $cellId,
false, false,
false, false,
'', '',
@ -987,7 +988,7 @@ class InventoryWidget extends Widget
array_push($data, $data_tmp); array_push($data, $data_tmp);
} }
$id_table = 'id_'.$row['id_module_inventory'].'_'.uniqid(); $id_table = 'id_'.$row['id_module_inventory'].'_'.$cellId;
} }
if ($count_rows > 1) { if ($count_rows > 1) {
@ -1000,8 +1001,8 @@ class InventoryWidget extends Widget
'column_names' => $columns, 'column_names' => $columns,
'no_sortable_columns' => [], 'no_sortable_columns' => [],
'data_element' => $data, 'data_element' => $data,
'searching' => true, 'searching' => false,
'dom_elements' => 'rtilp', 'dom_elements' => 'frtilp',
'order' => [ 'order' => [
'field' => $columns[0], 'field' => $columns[0],
'direction' => 'asc', 'direction' => 'asc',
@ -1010,11 +1011,9 @@ class InventoryWidget extends Widget
'emptyTable' => __('No inventory found'), 'emptyTable' => __('No inventory found'),
'return' => true, 'return' => true,
'no_sortable_columns' => [], 'no_sortable_columns' => [],
'mini_search' => true, 'mini_search' => false,
'mini_pagination' => true, 'mini_pagination' => true,
'csv' => 0, 'csv' => 0,
'mini_pagination' => true,
'mini_search' => true,
] ]
); );
@ -1022,7 +1021,7 @@ class InventoryWidget extends Widget
$table, $table,
array_shift($module_rows)['name'], array_shift($module_rows)['name'],
'', '',
'', $cellId,
false, false,
false false
); );
@ -1092,9 +1091,11 @@ class InventoryWidget extends Widget
__('Values Custom Fields'), __('Values Custom Fields'),
]; ];
$basic_info_id = 'id_'.$row['id_module_inventory'].'_'.$cellId;
ui_print_datatable( ui_print_datatable(
[ [
'id' => 'basic_info', 'id' => $basic_info_id,
'class' => $class, 'class' => $class,
'style' => $style, 'style' => $style,
'columns' => $columns, 'columns' => $columns,

View File

@ -221,9 +221,10 @@ class PostWidget extends Widget
'type' => 'textarea', 'type' => 'textarea',
'value' => $values['text'], 'value' => $values['text'],
'return' => true, 'return' => true,
'rows' => 1, 'rows' => 25,
'columns' => 1, 'columns' => 100,
'size' => 25, 'size' => 25,
'style' => 'display: none;',
], ],
]; ];
@ -296,7 +297,7 @@ class PostWidget extends Widget
public function getSizeModalConfiguration(): array public function getSizeModalConfiguration(): array
{ {
$size = [ $size = [
'width' => 500, 'width' => 1000,
'height' => 500, 'height' => 500,
]; ];

View File

@ -328,7 +328,7 @@ class SingleGraphWidget extends Widget
// Autocomplete module. // Autocomplete module.
$inputs[] = [ $inputs[] = [
'label' => __('Module'), 'label' => __('Module').ui_print_help_tip(__('Warning, this requires to have data for a mid-term (days/weeks) of the source data, if not, projection will not be reliable.'), true),
'arguments' => [ 'arguments' => [
'type' => 'autocomplete_module', 'type' => 'autocomplete_module',
'name' => 'moduleId', 'name' => 'moduleId',

View File

@ -424,6 +424,20 @@ class TopNWidget extends Widget
// Prevent double safe input in agents_get_group_agents function. // Prevent double safe input in agents_get_group_agents function.
$agentRegex = io_safe_output($agentRegex); $agentRegex = io_safe_output($agentRegex);
// Validate regex.
if (@preg_match('/'.$agentRegex.'/', '') === false
|| @preg_match('/'.$this->values['module'].'/', '') === false
) {
$output .= '<div class="container-center">';
$output .= \ui_print_info_message(
__('Invalid regex'),
'',
true
);
$output .= '</div>';
return $output;
}
// This function check ACL. // This function check ACL.
$agents = @agents_get_group_agents(0, ['aliasRegex' => $agentRegex]); $agents = @agents_get_group_agents(0, ['aliasRegex' => $agentRegex]);
$agentsId = \array_keys($agents); $agentsId = \array_keys($agents);

View File

@ -6,6 +6,10 @@ div#bullets_modules span {
font-weight: 700; font-weight: 700;
} }
div.bullets_modules span {
font-weight: 700;
}
div.agent_details_agent_caption { div.agent_details_agent_caption {
flex: 1; flex: 1;
} }

View File

@ -279,8 +279,8 @@ form.modal ul.wizard li {
flex-wrap: nowrap; flex-wrap: nowrap;
} }
form.modal-dashboard ul.wizard li *, form.modal-dashboard ul.wizard li > *,
form.modal ul.wizard li *:not(.tox.tox-tinymce *) { form.modal ul.wizard li > *:not(.tox.tox-tinymce *) {
flex: 1 1 50%; flex: 1 1 50%;
} }

View File

@ -6043,18 +6043,18 @@ div.switch_radio_button label:last-of-type {
margin-top: -2px; margin-top: -2px;
} }
/*
div#bullets_modules {
display: flex;
margin-left: 2em;
}
*/
div#bullets_modules div { div#bullets_modules div {
display: flex; display: flex;
align-items: center; align-items: center;
margin: 0 5px; margin: 0 5px;
} }
div.bullets_modules div {
display: flex;
align-items: center;
margin: 0 10px;
}
.orange_background { .orange_background {
background: #ffa631; background: #ffa631;
} }
@ -6225,7 +6225,7 @@ div#status_pie {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
padding: 20px; padding: 20px;
padding-bottom: 0; padding-bottom: 1%;
} }
.agent_details_content_cluster { .agent_details_content_cluster {
@ -6315,6 +6315,7 @@ div#status_pie {
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%;
} }
.agent_details_agent_data { .agent_details_agent_data {
@ -6344,23 +6345,45 @@ div#status_pie {
justify-content: flex-start; justify-content: flex-start;
} }
.agent_details_bullets .bullets_modules {
display: flex;
justify-content: flex-start;
}
.agent_details_bullets_cluster #bullets_modules { .agent_details_bullets_cluster #bullets_modules {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
flex-direction: column; flex-direction: column;
} }
.agent_details_bullets_cluster .bullets_modules {
display: flex;
justify-content: flex-start;
flex-direction: column;
}
.agent_details_bullets_cluster #bullets_modules > div { .agent_details_bullets_cluster #bullets_modules > div {
padding: 0px; padding: 0px;
margin-bottom: 10px; margin-bottom: 10px;
} }
.agent_details_bullets_cluster .bullets_modules > div {
padding: 0px;
margin-bottom: 10px;
}
.agent_details_bullets #bullets_modules > div { .agent_details_bullets #bullets_modules > div {
display: flex; display: flex;
align-items: center; align-items: center;
padding-bottom: 20px; padding-bottom: 20px;
} }
.agent_details_bullets .bullets_modules > div {
display: flex;
align-items: center;
padding-bottom: 20px;
}
#agent_contact_main tr td img { #agent_contact_main tr td img {
max-width: 100%; max-width: 100%;
} }
@ -6412,6 +6435,11 @@ div#status_pie {
float: right; float: right;
} }
.white_table_graph_header div.bullets_modules {
display: flex;
float: right;
}
.white_table_graph_header img, .white_table_graph_header img,
.white_table_graph_header span { .white_table_graph_header span {
vertical-align: middle; vertical-align: middle;

View File

@ -1471,6 +1471,10 @@ ul.datatable_filter:has(li > div.action-buttons) {
background-color: #222 !important; background-color: #222 !important;
} }
ul.datatable_filter {
background-color: #222 !important;
}
span.ui-dialog-title { span.ui-dialog-title {
color: #fff !important; color: #fff !important;
} }

View File

@ -653,6 +653,7 @@ div.advanced-options-events > div.filter_input {
.vert-align-bottom { .vert-align-bottom {
vertical-align: bottom; vertical-align: bottom;
font-size: 8pt;
} }
label.vert-align-bottom > a.tip { label.vert-align-bottom > a.tip {

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 = '231127'; $build = '231129';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

View File

@ -523,6 +523,9 @@ if ($agent_view_page === true) {
echo $html_content; echo $html_content;
} }
// Filter control.
echo '<input type="hidden" id="filter_applied" value="0" />';
// Strict user hidden. // Strict user hidden.
echo '<div id="strict_hidden" class="invisible">'; echo '<div id="strict_hidden" class="invisible">';
html_print_input_text('strict_user_hidden', $strict_user); html_print_input_text('strict_user_hidden', $strict_user);
@ -565,6 +568,10 @@ function alerts_table_controls() {
} }
$(document).ready ( function () { $(document).ready ( function () {
if ($('#filter_applied').val() == 0){
$('#button-form_alerts_status_datatable_search_bt').trigger('click');
$('#filter_applied').val(1);
}
alerts_table_controls(); alerts_table_controls();
$('#button-alert_validate').on('click', function () { $('#button-alert_validate').on('click', function () {
validateAlerts(); validateAlerts();

View File

@ -102,17 +102,37 @@ $agentCountModules = html_print_div(
$table_status = new stdClass(); $table_status = new stdClass();
$table_status->id = 'agent_status_main'; $table_status->id = 'agent_status_main';
$table_status->width = '100%'; $table_status->width = '90%';
$table_status->height = 'auto';
$table_status->cellspacing = 0; $table_status->cellspacing = 0;
$table_status->cellpadding = 0; $table_status->cellpadding = 0;
$table_status->class = 'floating_form'; $table_status->class = 'floating_form';
$table_status->style[0] = 'height: 32px; width: 30%; padding-right: 5px; text-align: end; vertical-align: top'; $table_status->style[0] = 'height: 28px; width: 30%; padding-right: 5px; text-align: end; vertical-align: top';
$table_status->style[1] = 'height: 32px; width: 70%; padding-left: 5px; font-weight: lighter; vertical-align: top'; $table_status->style[1] = 'height: 28px; width: 70%; padding-left: 5px; font-weight: lighter; vertical-align: top';
$table_status->data['agent_os'][0] = __('OS');
$agentOS = []; $os_agent_text = '';
$agentOS[] = html_print_div([ 'content' => (empty($agent['os_version']) === true) ? get_os_name((int) $agent['id_os']) : $agent['os_version']], true); $os_name = get_os_name((int) $agent['id_os']);
$agentOS[] = html_print_div([ 'style' => 'width: 16px;padding-left: 5px', 'content' => ui_print_os_icon($agent['id_os'], false, true, true, false, false, false, ['width' => '16px'])], true); if (empty($agent['os_version']) !== true) {
$table_status->data['agent_os'][1] = html_print_div(['class' => 'agent_details_agent_data', 'content' => implode('', $agentOS)], true); $agent['os_version'] = io_safe_output($agent['os_version']);
if (strpos($agent['os_version'], '(') !== false) {
$os_name = preg_split('/[0-9]|[\(]/', $agent['os_version'])[0];
$os_version = explode($os_name, explode('(', $agent['os_version'])[0])[1];
$os_version_name = preg_split('/[\(]|[\)]/', $agent['os_version']);
$os_agent_text = $os_version.' ('.$os_version_name[1].')';
} else {
$os_name = preg_split('/[0-9]/', $agent['os_version'])[0];
$os_version = explode($os_name, explode('(', $agent['os_version'])[0])[1];
$os_agent_text = $os_version;
}
}
$table_status->data['agent_os'][0] = html_print_div([ 'style' => 'width: 16px; position: relative; left: 75%', 'content' => ui_print_os_icon($agent['id_os'], false, true, true, false, false, false, ['width' => '16px'])], true);
$table_status->data['agent_os'][1] = $os_name;
if (empty($agent['os_version']) !== true) {
$table_status->data['agent_os_version'][0] = __('OS Version');
$table_status->data['agent_os_version'][1] = $os_agent_text;
}
$addresses = agents_get_addresses($id_agente); $addresses = agents_get_addresses($id_agente);
$address = agents_get_address($id_agente); $address = agents_get_address($id_agente);
@ -124,43 +144,48 @@ foreach ($addresses as $k => $add) {
} }
if (empty($address) === false) { if (empty($address) === false) {
$address_text = '<span class="bolder" >'.$address.'</span>';
if (!empty($addresses) === true) {
foreach ($addresses as $sec_address) {
$address_text .= '<br/><span class="italic">'.$sec_address.'</span>';
}
}
$table_status->data['ip_address'][0] = __('IP address'); $table_status->data['ip_address'][0] = __('IP address');
$table_status->data['ip_address'][1] = (empty($address) === true) ? '<em>'.__('N/A').'</em>' : $address; $table_status->data['ip_address'][1] = (empty($address) === true) ? '<em>'.__('N/A').'</em>' : $address_text;
} }
$table_status->data['agent_version'][0] = __('Agent Version'); $table_status->data['agent_version'][0] = __('Agent Version');
$table_status->data['agent_version'][1] = (empty($agent['agent_version']) === true) ? '<i>'.__('N/A').'</i>' : $agent['agent_version']; $table_status->data['agent_version'][1] = (empty($agent['agent_version']) === true) ? '<i>'.__('N/A').'</i>' : $agent['agent_version'];
$table_status->data['description'][0] = __('Description'); $table_status->data['description'][0] = __('Description');
$table_status->data['description'][1] = (empty($agent['comentarios']) === true) ? '<em>'.__('N/A').'</em>' : $agent['comentarios']; $table_status->data['description'][1] = (empty($agent['comentarios']) === true) ? '<em>'.__('N/A').'</em>' : ui_print_truncate_text($agent['comentarios'], 'description', true);
$has_remote_conf = enterprise_hook( $agentEventsHeader = html_print_div(
'config_agents_has_remote_configuration', [
[$agent['id_agente']] 'class' => 'agent_details_header',
'content' => '<span class="subsection_header_title">'.__('Events (Last 24h)').'</span>',
],
true
); );
if ((bool) $has_remote_conf) { $agentEventsGraph = html_print_div(
$table_status->data['remote_config'][0] = __('Remote configuration'); [
$table_status->data['remote_config'][1] = __('Enabled'); 'class' => 'white-table-graph-content',
'content' => graph_graphic_agentevents(
$satellite_server = (int) db_get_value_filter( $id_agente,
'satellite_server', 95,
'tagente', 50,
['id_agente' => $id_agente] SECONDS_1DAY,
); '',
true,
if (empty($satellite_server) === false) { true,
$satellite_name = db_get_value_filter( 500
'name', ),
'tserver', 'style' => 'margin-top: -25px',
['id_server' => $satellite_server] ],
); true
);
$table_status->data['remote_config'][0] = __('Satellite server');
$table_status->data['remote_config'][1] = $satellite_name;
}
}
$table_agent = $agentStatusHeader.' $table_agent = $agentStatusHeader.'
<div class="agent_details_content"> <div class="agent_details_content">
@ -170,6 +195,9 @@ $table_agent = $agentStatusHeader.'
<div class="agent_details_info"> <div class="agent_details_info">
'.$alive_animation.html_print_table($table_status, true).' '.$alive_animation.html_print_table($table_status, true).'
</div> </div>
</div>
<div class="agent_details_graph">
'.$agentEventsHeader.$agentEventsGraph.'
</div>'; </div>';
@ -189,11 +217,12 @@ $data_opcional->class = 'floating_form';
// Gis and url address. // Gis and url address.
$agentAdditionalContent = ''; $agentAdditionalContent = '';
// Position Information. // Position Information.
if ((bool) $config['activate_gis'] === true) { /*
if ((bool) $config['activate_gis'] === true) {
$dataPositionAgent = gis_get_data_last_position_agent( $dataPositionAgent = gis_get_data_last_position_agent(
$agent['id_agente'] $agent['id_agente']
); );
if (is_array($dataPositionAgent) === true && $dataPositionAgent['stored_longitude'] !== '' && $dataPositionAgent['stored_longitude'] !== '') { if (is_array($dataPositionAgent) === true && $dataPositionAgent['stored_longitude'] !== '' && $dataPositionAgent['stored_latitude'] !== '') {
$data_opcional->data['agent_position'][0] = __('Position (Long, Lat)'); $data_opcional->data['agent_position'][0] = __('Position (Long, Lat)');
$dataOptionalOutput = html_print_anchor( $dataOptionalOutput = html_print_anchor(
@ -210,10 +239,11 @@ if ((bool) $config['activate_gis'] === true) {
$data_opcional->data['agent_position'][1] = $dataOptionalOutput; $data_opcional->data['agent_position'][1] = $dataOptionalOutput;
} }
} }*/
// If the url description is set. // If the url description is set.
if (empty($agent['url_address']) === false) { /*
if (empty($agent['url_address']) === false) {
$data_opcional->data['url_address'][0] = __('Url address'); $data_opcional->data['url_address'][0] = __('Url address');
$data_opcional->data['url_address'][1] = html_print_anchor( $data_opcional->data['url_address'][1] = html_print_anchor(
[ [
@ -222,11 +252,12 @@ if (empty($agent['url_address']) === false) {
], ],
true true
); );
} }*/
// Other IP address and timezone offset. // Other IP address and timezone offset.
if (empty($addresses) === false) { /*
if (empty($addresses) === false) {
$data_opcional->data['other_ip_address'][0] = __('Other IP addresses'); $data_opcional->data['other_ip_address'][0] = __('Other IP addresses');
$data_opcional->data['other_ip_address'][1] = html_print_div( $data_opcional->data['other_ip_address'][1] = html_print_div(
[ [
@ -235,13 +266,14 @@ if (empty($addresses) === false) {
], ],
true true
); );
} }
*/
// Timezone Offset. // Timezone Offset.
if ((int) $agent['timezone_offset'] !== 0) { /*
if ((int) $agent['timezone_offset'] !== 0) {
$data_opcional->data['timezone_offset'][0] = __('Timezone Offset'); $data_opcional->data['timezone_offset'][0] = __('Timezone Offset');
$data_opcional->data['timezone_offset'][1] = $agent['timezone_offset']; $data_opcional->data['timezone_offset'][1] = $agent['timezone_offset'];
} }*/
// Custom fields. // Custom fields.
$fields = db_get_all_rows_filter( $fields = db_get_all_rows_filter(
@ -485,39 +517,6 @@ $agentContact = html_print_div(
true true
); );
$agentEventsHeader = html_print_div(
[
'class' => 'agent_details_header',
'content' => '<span class="subsection_header_title">'.__('Events (Last 24h)').'</span>',
],
true
);
$agentEventsGraph = html_print_div(
[
'class' => 'white-table-graph-content',
'content' => graph_graphic_agentevents(
$id_agente,
95,
70,
SECONDS_1DAY,
'',
true,
true,
500
),
],
true
);
$agentEvents = html_print_div(
[
'class' => 'box-flat agent_details_col w50p',
'content' => $agentEventsHeader.$agentEventsGraph,
],
true
);
/* /*
* EVENTS TABLE END. * EVENTS TABLE END.
*/ */

View File

@ -541,19 +541,6 @@ if (is_ajax() === true) {
); );
} }
if (empty($tmp->module_name) === false) {
$tmp->module_name = ui_print_truncate_text(
$tmp->module_name,
'module_medium',
false,
true,
false,
'&hellip;',
true,
true,
);
}
if (empty($tmp->comments) === false) { if (empty($tmp->comments) === false) {
$tmp->comments = ui_print_comments($tmp->comments, 20); $tmp->comments = ui_print_comments($tmp->comments, 20);
} }

View File

@ -819,13 +819,6 @@ if ($access_console_node === true) {
} }
} }
} }
if (!empty($sub)) {
$menu_operation['extensions']['text'] = __('Tools');
$menu_operation['extensions']['sec2'] = 'operation/extensions';
$menu_operation['extensions']['id'] = 'oper-extensions';
$menu_operation['extensions']['sub'] = $sub;
}
} }
// ~ } // ~ }

View File

@ -19,17 +19,25 @@ require_once $config['homedir'].'/include/functions_users.php';
$searchModules = check_acl($config['id_user'], 0, 'AR'); $searchModules = check_acl($config['id_user'], 0, 'AR');
$selectModuleNameUp = ''; if ($config['style'] === 'pandora_black') {
$selectModuleNameDown = ''; $selectModuleNameUp = '';
$selectAgentNameUp = ''; $selectModuleNameDown = '';
$selectAgentNameDown = ''; $selectAgentNameUp = '';
$selectAgentNameDown = '';
} else {
$selectModuleNameUp = '_black';
$selectModuleNameDown = '_black';
$selectAgentNameUp = '_black';
$selectAgentNameDown = '_black';
}
$is_admin = (bool) db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']); $is_admin = (bool) db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
switch ($sortField) { switch ($sortField) {
case 'module_name': case 'module_name':
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectModuleNameUp = $selected; $selectModuleNameUp = $selected_module;
$order = [ $order = [
'field' => 'module_name', 'field' => 'module_name',
'order' => 'ASC', 'order' => 'ASC',
@ -37,7 +45,7 @@ switch ($sortField) {
break; break;
case 'down': case 'down':
$selectModuleNameDown = $selected; $selectModuleNameDown = $selected_module;
$order = [ $order = [
'field' => 'module_name', 'field' => 'module_name',
'order' => 'DESC', 'order' => 'DESC',
@ -49,7 +57,7 @@ switch ($sortField) {
case 'agent_name': case 'agent_name':
switch ($sort) { switch ($sort) {
case 'up': case 'up':
$selectAgentNameUp = $selected; $selectAgentNameUp = $selected_module;
$order = [ $order = [
'field' => 'agent_name', 'field' => 'agent_name',
'order' => 'ASC', 'order' => 'ASC',
@ -57,7 +65,7 @@ switch ($sortField) {
break; break;
case 'down': case 'down':
$selectAgentNameDown = $selected; $selectAgentNameDown = $selected_module;
$order = [ $order = [
'field' => 'agent_name', 'field' => 'agent_name',
'order' => 'DESC', 'order' => 'DESC',
@ -67,7 +75,7 @@ switch ($sortField) {
break; break;
default: default:
$selectModuleNameUp = $selected; $selectModuleNameUp = $selected_module;
$order = [ $order = [
'field' => 'module_name', 'field' => 'module_name',
'order' => 'ASC', 'order' => 'ASC',

View File

@ -30,10 +30,9 @@ if (!$modules || !$searchModules) {
$table->cellspacing = 4; $table->cellspacing = 4;
$table->width = '98%'; $table->width = '98%';
$table->class = 'info_table'; $table->class = 'info_table';
$table->head = []; $table->head = [];
$table->head[0] = __('Module').' <a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=module_name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectModuleNameUp]).'</a><a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=module_name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectModuleNameDown]).'</a>'; $table->head[0] = __('Module').' <a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=module_name&sort=up">'.html_print_image('images/sort_up'.$selectModuleNameUp.'.png', true).'</a><a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=module_name&sort=down">'.html_print_image('images/sort_down'.$selectModuleNameDown.'.png', true).'</a>';
$table->head[1] = __('Agent').' <a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=agent_name&sort=up">'.html_print_image('images/sort_up.png', true, ['style' => $selectAgentNameUp]).'</a><a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=agent_name&sort=down">'.html_print_image('images/sort_down.png', true, ['style' => $selectAgentNameDown]).'</a>'; $table->head[1] = __('Agent').' <a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=agent_name&sort=up">'.html_print_image('images/sort_up'.$selectAgentNameUp.'.png', true).'</a><a href="index.php?search_category=modules&keywords='.$config['search_keywords'].'&head_search_keywords=abc&offset='.$offset.'&sort_field=agent_name&sort=down">'.html_print_image('images/sort_down'.$selectAgentNameDown.'.png', true).'</a>';
$table->head[2] = __('Type'); $table->head[2] = __('Type');
$table->head[3] = __('Interval'); $table->head[3] = __('Interval');
$table->head[4] = __('Status'); $table->head[4] = __('Status');
@ -80,6 +79,9 @@ if (!$modules || !$searchModules) {
$module['datos'] = modules_get_last_value($module['id_agente_modulo']); $module['datos'] = modules_get_last_value($module['id_agente_modulo']);
$module['module_name'] = $module['nombre']; $module['module_name'] = $module['nombre'];
$linked_module_name = '<a href="index.php?sec=gagente&amp;sec2=godmode/agentes/configurar_agente&amp;id_agente='.$module['id_agente'].'&amp;tab=module&amp;id_agent_module='.$module['id_agente_modulo'].'&amp;edit_module='.$module['id_modulo'].'">';
$linked_module_name .= $module['module_name'];
$linked_module_name .= '</a>';
// To search the monitor status // To search the monitor status
$status_sql = sprintf('SELECT estado from tagente_estado where id_agente_modulo ='.$module['id_agente_modulo']); $status_sql = sprintf('SELECT estado from tagente_estado where id_agente_modulo ='.$module['id_agente_modulo']);
$status_sql = db_process_sql($status_sql); $status_sql = db_process_sql($status_sql);
@ -217,7 +219,7 @@ if (!$modules || !$searchModules) {
$url_edit = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$module['id_agente'].'&tab=module&id_agent_module='.$module['id_agente_modulo'].'&edit_module=1'; $url_edit = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$module['id_agente'].'&tab=module&id_agent_module='.$module['id_agente_modulo'].'&edit_module=1';
$edit_module = '<a href="'.$url_edit.'">'.html_print_image('images/edit.svg', true).'</a>'; $edit_module = '<a href="'.$url_edit.'">'.html_print_image('images/edit.svg', true, ['class' => 'invert_filter main_menu_icon']).'</a>';
} else { } else {
$edit_module = ''; $edit_module = '';
} }
@ -226,7 +228,7 @@ if (!$modules || !$searchModules) {
array_push( array_push(
$table->data, $table->data,
[ [
$module['module_name'], $linked_module_name,
$agentCell, $agentCell,
$typeCell, $typeCell,
$intervalCell, $intervalCell,

View File

@ -60,7 +60,7 @@ $order = null;
$sortField = get_parameter('sort_field'); $sortField = get_parameter('sort_field');
$sort = get_parameter('sort', 'none'); $sort = get_parameter('sort', 'none');
$selected = 'border: 1px solid black;'; $selected = 'border: 1px solid black;';
$selected_module = '_green';
if ($searchMain) { if ($searchMain) {
$main_tab = [ $main_tab = [
'text' => "<a href='index.php?search_category=main&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image( 'text' => "<a href='index.php?search_category=main&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".html_print_image(

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 231127 %define release 231129
# 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 231127 %define release 231129
# 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 231127 %define release 231129
%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

@ -1167,9 +1167,9 @@ INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`) VALUES (6,'Create&#x20;Pandora&#x20;ITSM&#x20;ticket',16); INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`) VALUES (6,'Create&#x20;Pandora&#x20;ITSM&#x20;ticket',16);
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (7, 'Pandora&#x20;Google&#x20;chat', 17, "", "data=_data_", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "", "data=_data_", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", ""); INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (7, 'Pandora&#x20;Google&#x20;chat', 17, "", "data=_data_", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "", "data=_data_", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "");
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (8, 'Pandora&#x20;Slack', 18, "data=_data_", "", ":red_circle:", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", 0, 0, "data=_data_", "", ":green_circle:", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", ""); INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (8, 'Pandora&#x20;Slack', 18, "data=_data_", "", ":red_circle:", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", 0, 0, "data=_data_", "", ":green_circle:", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "");
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (9, 'Pandora&#x20;Telegram', 19, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", ""); INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (9, 'Pandora&#x20;Telegram', 19, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _timestamp_ / _data_", "", "", "", "", "", "", "", "");
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (10, 'Pandora&#x20;ilert', 20, "alert", "", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "resolved", "", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", ""); INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (10, 'Pandora&#x20;ilert', 20, "alert", "", "[PANDORA] Alert FIRED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "", 0, 0, "resolved", "", "[PANDORA] Alert RECOVERED on _agent_ / _module_", "_agent_ | _module_ | _data_ | _timestamp_", "", "", "", "", "", "");
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (11, 'Pandora&#x20;Vonage', 21, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _tiemstamp_ / _data_", "", "", "", "", "", "", "", ""); INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `field4`, `field5`, `field6`, `field7`, `field8`, `field9`, `field10`, `id_group`, `action_threshold`, `field1_recovery`, `field2_recovery`, `field3_recovery`, `field4_recovery`, `field5_recovery`, `field6_recovery`, `field7_recovery`, `field8_recovery`, `field9_recovery`, `field10_recovery`) VALUES (11, 'Pandora&#x20;Vonage', 21, "", "[PANDORA] Alert FIRED on _agent_ / _module_ / _timestamp_ / _data_", "", "", "", "", "", "", "", "", 0, 0, "", "[PANDORA] Alert RECOVERED on _agent_ / _module_ / _timestamp_ / _data_", "", "", "", "", "", "", "", "");
-- alert templates (default) -- alert templates (default)
@ -1194,7 +1194,7 @@ INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALU
INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (2, 'Discovery.Cloud', 'Discovery&#x20;Cloud&#x20;script&#x20;to&#x20;monitor&#x20;Cloud&#x20;technologies&#x20;&#40;AWS.EC2,&#x20;AWS.S3,&#x20;AWS.RDS,&#x20RDS,&#x20AWS.EKS&#41;', '/usr/share/pandora_server/util/recon_scripts/pcm_client.pl', '{"1":{"macro":"_field1_","desc":"Configuration&#x20;file","help":"","value":"","hide":""}}'); INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (2, 'Discovery.Cloud', 'Discovery&#x20;Cloud&#x20;script&#x20;to&#x20;monitor&#x20;Cloud&#x20;technologies&#x20;&#40;AWS.EC2,&#x20;AWS.S3,&#x20;AWS.RDS,&#x20RDS,&#x20AWS.EKS&#41;', '/usr/share/pandora_server/util/recon_scripts/pcm_client.pl', '{"1":{"macro":"_field1_","desc":"Configuration&#x20;file","help":"","value":"","hide":""}}');
-- IPAM is 3. -- IPAM is 3.
INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (4, 'IPMI&#x20;Recon','Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@artica.es&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0','/usr/share/pandora_server/util/recon_scripts/ipmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.:&#x20;192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional&#x20;parameters\",\"help\":\"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.\",\"value\":\"\",\"hide\":\"\"}}'); INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (4, 'IPMI&#x20;Recon','Specific&#x20;Pandora&#x20;FMS&#x20;Intel&#x20;DCM&#x20;Discovery&#x20;&#40;c&#41;&#x20;Artica&#x20;ST&#x20;2011&#x20;&lt;info@pandorafms.com&gt;&#x0d;&#x0a;&#x0d;&#x0a;Usage:&#x20;./ipmi-recon.pl&#x20;&lt;task_id&gt;&#x20;&lt;group_id&gt;&#x20;&lt;custom_field1&gt;&#x20;&lt;custom_field2&gt;&#x20;&lt;custom_field3&gt;&#x20;&lt;custom_field4&gt;&#x0d;&#x0a;&#x0d;&#x0a;*&#x20;custom_field1&#x20;=&#x20;Network&#x20;i.e.:&#x20;192.168.100.0/24&#x0d;&#x0a;*&#x20;custom_field2&#x20;=&#x20;Username&#x0d;&#x0a;*&#x20;custom_field3&#x20;=&#x20;Password&#x0d;&#x0a;*&#x20;custom_field4&#x20;=&#x20;Additional&#x20;parameters&#x20;i.e.:&#x20;-D&#x20;LAN_2_0','/usr/share/pandora_server/util/recon_scripts/ipmi-recon.pl','{\"1\":{\"macro\":\"_field1_\",\"desc\":\"Network\",\"help\":\"i.e.:&#x20;192.168.100.0/24\",\"value\":\"\",\"hide\":\"\"},\"2\":{\"macro\":\"_field2_\",\"desc\":\"Username\",\"help\":\"\",\"value\":\"\",\"hide\":\"\"},\"3\":{\"macro\":\"_field3_\",\"desc\":\"Password\",\"help\":\"\",\"value\":\"\",\"hide\":\"1\"},\"4\":{\"macro\":\"_field4_\",\"desc\":\"Additional&#x20;parameters\",\"help\":\"Optional&#x20;additional&#x20;parameters&#x20;such&#x20;as&#x20;-D&#x20;LAN_2_0&#x20;to&#x20;use&#x20;IPMI&#x20;ver&#x20;2.0&#x20;instead&#x20;of&#x20;1.5.&#x20;&#x20;These&#x20;options&#x20;will&#x20;also&#x20;be&#x20;passed&#x20;to&#x20;the&#x20;IPMI&#x20;plugin&#x20;when&#x20;the&#x20;current&#x20;values&#x20;are&#x20;read.\",\"value\":\"\",\"hide\":\"\"}}');
INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (3, 'IPAM Recon', 'This script is used to automatically detect network hosts availability and name, used as Recon Custom Script in the recon task. Parameters used are:\n\n* custom_field1 = network. i.e.: 192.168.100.0/24\n* custom_field2 = associated IPAM network id. i.e.: 4. Please do not change this value, it is assigned automatically in IPAM management.\n\nSee documentation for more information.', '/usr/share/pandora_server/util/recon_scripts/IPAMrecon.pl', '{"1":{"macro":"_field1_","desc":"Network","help":"i.e.:&#x20;192.168.100.0/24","value":"","hide":""}}'); INSERT INTO `trecon_script` (`type`,`name`,`description`,`script`,`macros`) VALUES (3, 'IPAM Recon', 'This script is used to automatically detect network hosts availability and name, used as Recon Custom Script in the recon task. Parameters used are:\n\n* custom_field1 = network. i.e.: 192.168.100.0/24\n* custom_field2 = associated IPAM network id. i.e.: 4. Please do not change this value, it is assigned automatically in IPAM management.\n\nSee documentation for more information.', '/usr/share/pandora_server/util/recon_scripts/IPAMrecon.pl', '{"1":{"macro":"_field1_","desc":"Network","help":"i.e.:&#x20;192.168.100.0/24","value":"","hide":""}}');
@ -1214,7 +1214,7 @@ INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `max_retries`
INSERT INTO `tagent_custom_fields` VALUES (1,'Serial&#x20;Number',0,0,'',0),(2,'Department',0,0,'',0),(3,'Additional&#x20;ID',0,0,'',0),(4,'eHorusID',0,0,'',0); INSERT INTO `tagent_custom_fields` VALUES (1,'Serial&#x20;Number',0,0,'',0),(2,'Department',0,0,'',0),(3,'Additional&#x20;ID',0,0,'',0),(4,'eHorusID',0,0,'',0);
INSERT INTO `ttag` VALUES (1,'network','Network&#x20;equipment','http://artica.es','','',''),(2,'critical','Critical&#x20;modules','','','',''),(3,'dmz','DMZ&#x20;Network&#x20;Zone','','','',''),(4,'performance','Performance&#x20;anda&#x20;capacity&#x20;modules','','','',''),(5,'configuration','','','','',''); INSERT INTO `ttag` VALUES (1,'network','Network&#x20;equipment','http://pandorafms.com','','',''),(2,'critical','Critical&#x20;modules','','','',''),(3,'dmz','DMZ&#x20;Network&#x20;Zone','','','',''),(4,'performance','Performance&#x20;anda&#x20;capacity&#x20;modules','','','',''),(5,'configuration','','','','','');
INSERT INTO `tevent_response` VALUES (1,'Ping&#x20;to&#x20;host','Ping&#x20;to&#x20;the&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_agent_address_','command',0,620,500,0,'',0,90,0),(3,'Create&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;the&#x20;standard&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS','index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form&amp;from_event=_event_id_','url',0,0,0,1,'',0,90,0),(5,'Restart&#x20;agent','Restart&#x20;the&#x20;agent&#x20;with&#x20;using&#x20;UDP&#x20;protocol.&#x0d;&#x0a;&#x0d;&#x0a;To&#x20;use&#x20;this&#x20;response&#x20;is&#x20;necessary&#x20;to&#x20;have&#x20;installed&#x20;Pandora&#x20;FMS&#x20;server&#x20;and&#x20;console&#x20;in&#x20;the&#x20;same&#x20;machine.','/usr/share/pandora_server/util/udp_client.pl&#x20;_agent_address_&#x20;41122&#x20;&quot;REFRESH&#x20;AGENT&quot;','command',0,620,500,0,'',0,90,0),(6,'Ping&#x20;to&#x20;module&#x20;agent&#x20;host','Ping&#x20;to&#x20;the&#x20;module&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_module_address_','command',0,620,500,0,'',0,90,0),(7,'Create&#x20;ticket&#x20;in&#x20;Pandora&#x20;ITSM&#x20;from&#x20;event','Create&#x20;a&#x20;ticket&#x20;in&#x20;Pandora&#x20;ITSM&#x20;from&#x20;an&#x20;event','index.php?sec=manageTickets&amp;sec2=operation/ITSM/itsm&amp;operation=edit&amp;from_event=_event_id_','url',0,0,0,1,'',0,90,1); INSERT INTO `tevent_response` VALUES (1,'Ping&#x20;to&#x20;host','Ping&#x20;to&#x20;the&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_agent_address_','command',0,620,500,0,'',0,90,0),(3,'Create&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;the&#x20;standard&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS','index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form&amp;from_event=_event_id_','url',0,0,0,1,'',0,90,0),(5,'Restart&#x20;agent','Restart&#x20;the&#x20;agent&#x20;with&#x20;using&#x20;UDP&#x20;protocol.&#x0d;&#x0a;&#x0d;&#x0a;To&#x20;use&#x20;this&#x20;response&#x20;is&#x20;necessary&#x20;to&#x20;have&#x20;installed&#x20;Pandora&#x20;FMS&#x20;server&#x20;and&#x20;console&#x20;in&#x20;the&#x20;same&#x20;machine.','/usr/share/pandora_server/util/udp_client.pl&#x20;_agent_address_&#x20;41122&#x20;&quot;REFRESH&#x20;AGENT&quot;','command',0,620,500,0,'',0,90,0),(6,'Ping&#x20;to&#x20;module&#x20;agent&#x20;host','Ping&#x20;to&#x20;the&#x20;module&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_module_address_','command',0,620,500,0,'',0,90,0),(7,'Create&#x20;ticket&#x20;in&#x20;Pandora&#x20;ITSM&#x20;from&#x20;event','Create&#x20;a&#x20;ticket&#x20;in&#x20;Pandora&#x20;ITSM&#x20;from&#x20;an&#x20;event','index.php?sec=manageTickets&amp;sec2=operation/ITSM/itsm&amp;operation=edit&amp;from_event=_event_id_','url',0,0,0,1,'',0,90,1);
@ -2775,7 +2775,7 @@ SET @short_name = 'pandorafms.oracle';
SET @name = 'Oracle'; SET @name = 'Oracle';
SET @section = 'app'; SET @section = 'app';
SET @description = 'Monitor&#x20;Oracle&#x20;databases'; SET @description = 'Monitor&#x20;Oracle&#x20;databases';
SET @version = '1.0'; SET @version = '1.1';
INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version); INSERT IGNORE INTO `tdiscovery_apps` (`id_app`, `short_name`, `name`, `section`, `description`, `version`) VALUES ('', @short_name, @name, @section, @description, @version);
SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name; SELECT @id_app := `id_app` FROM `tdiscovery_apps` WHERE `short_name` = @short_name;

View File

@ -1378,6 +1378,34 @@ class Client
} }
private function getDirectorySize($directory)
{
if (is_string($directory) === false || is_dir($directory) === false) {
throw new \InvalidArgumentException('Invalid directory path');
}
$size = 0;
if ($handle = opendir($directory)) {
while (false !== ($file = readdir($handle))) {
if ($file != '.' && $file != '..') {
$path = $directory.DIRECTORY_SEPARATOR.$file;
if (is_dir($path) === true) {
// Recursive call for subdirectories.
$size += $this->getDirectorySize($path);
} else {
$size += filesize($path);
}
}
}
closedir($handle);
}
return $size;
}
/** /**
* Update files. * Update files.
* *
@ -1395,7 +1423,8 @@ class Client
string $from, string $from,
string $to, string $to,
bool $test=false, bool $test=false,
bool $classic=false bool $classic=false,
bool $called_recursively=false
) :void { ) :void {
if (is_dir($from) !== true || is_readable($from) !== true) { if (is_dir($from) !== true || is_readable($from) !== true) {
throw new \Exception('Cannot access patch files '.$from); throw new \Exception('Cannot access patch files '.$from);
@ -1416,6 +1445,18 @@ class Client
throw new \Exception('Files are not readable'); throw new \Exception('Files are not readable');
} }
if ($test === true && $called_recursively === false) {
// Get size of folder and its subfolders corresponding to "from" path containing those files
// that will be updated in product.
// Do once.
$source_size = $this->getDirectorySize($from);
// Check available disk space before writing files.
if (disk_free_space($to) < $source_size) {
throw new \Exception('Not enough disk space to write the files');
}
}
$created_directories = []; $created_directories = [];
while (($pf = readdir($pd)) !== false) { while (($pf = readdir($pd)) !== false) {
@ -1440,11 +1481,13 @@ class Client
$created_directories[] = $dest; $created_directories[] = $dest;
} }
$this->updateFiles($version, $pf.'/', $to, $test, $classic); $this->updateFiles($version, $pf.'/', $to, $test, $classic, true);
} else { } else {
// It's a file. // It's a file.
if ($test === true) { if ($test === true) {
if (is_writable($target_folder) !== true) { if (is_writable($target_folder) !== true
|| (file_exists($dest) === true && is_writable($dest) !== true)
) {
throw new \Exception($dest.' is not writable'); throw new \Exception($dest.' is not writable');
} }
} else { } else {

View File

@ -34,9 +34,8 @@ if ($redraw === false) {
$output .= '<div class="header-widget">'; $output .= '<div class="header-widget">';
$output .= '<div>'; $output .= '<div>';
$options = json_decode($cellData['options'], true);
if ((int) $cellData['id_widget'] !== 0) { if ($cellData['id_widget'] !== '0') {
$options = json_decode($cellData['options'], true);
$output .= $options['title']; $output .= $options['title'];
} else { } else {
$output .= __('New widget'); $output .= __('New widget');
@ -44,10 +43,15 @@ if ((int) $cellData['id_widget'] !== 0) {
$output .= '</div>'; $output .= '</div>';
$output .= '<div class="header-options">'; $output .= '<div class="header-options">';
if ($manageDashboards !== 0 || $writeDashboards !== 0) { if ($manageDashboards !== 0 || $writeDashboards !== 0) {
if ((int) $cellData['id_widget'] !== 0) { if ((int) $cellData['id_widget'] !== 0) {
$output .= '<a id="copy-widget-'.$cellData['id'].'" class="">'; $count_options = count(json_decode($cellData['options'], true));
$invisible = '';
if ($count_options <= 2 && $options['copy'] == 0) {
$invisible = 'invisible';
}
$output .= '<a id="copy-widget-'.$cellData['id'].'" class="'.$invisible.'" >';
$output .= html_print_image( $output .= html_print_image(
'images/copy.svg', 'images/copy.svg',
true, true,

View File

@ -28,15 +28,11 @@
// Includes. // Includes.
require_once $config['homedir'].'/include/class/HTML.class.php'; require_once $config['homedir'].'/include/class/HTML.class.php';
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/', true);
ui_require_javascript_file('pandora', 'include/javascript/', true);
$output = ''; $output = '';
$output .= ui_require_javascript_file(
'tiny_mce',
'include/javascript/tiny_mce/',
true
);
$form = [ $form = [
'action' => '#', 'action' => '#',
'method' => 'POST', 'method' => 'POST',
@ -47,6 +43,18 @@ $form = [
'extra' => 'novalidate', 'extra' => 'novalidate',
]; ];
$js = 'tinymce.init({
selector: "#textarea_text",
plugins: "preview, searchreplace, table, nonbreaking, link, image",
promotion: false,
branding: false,
setup: function (editor) {
editor.on("change", function () {
tinymce.triggerSave();
})
}
});';
HTML::printForm( HTML::printForm(
[ [
'form' => $form, 'form' => $form,
@ -56,15 +64,4 @@ HTML::printForm(
] ]
); );
$output .= '<script>';
$output .= 'tinymce.init({
selector: "#textarea_text",
setup : function(ed) {
ed.onChange.add(function(e) {
tinyMCE.triggerSave();
console.log($("#textarea_text").val());
});
}
});';
$output .= '</script>';
echo $output; echo $output;

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.774-231127 Version: 7.0NG.774-231129
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-231127" pandora_version="7.0NG.774-231129"
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 = "231127"; my $pandora_build = "231129";
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 = "231127"; my $pandora_build = "231129";
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 231127 %define release 231129
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 231127 %define release 231129
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="231127" PI_BUILD="231129"
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 231127"; my $version = "7.0NG.774 Build 231129";
# 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 231127"; my $version = "7.0NG.774 Build 231129";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);