util
directory into the Pandora agent path.
+ */
+ class Pandora_Module_Exec_Powershell : public Pandora_Module {
+
+ private:
+ string module_exec;
+
+ public:
+ Pandora_Module_Exec_Powershell (string name, string exec);
+ void run ();
+ };
+}
+
+#endif
diff --git a/pandora_agents/win32/modules/pandora_module_factory.cc b/pandora_agents/win32/modules/pandora_module_factory.cc
index de149293ff..dd71dc2dd8 100644
--- a/pandora_agents/win32/modules/pandora_module_factory.cc
+++ b/pandora_agents/win32/modules/pandora_module_factory.cc
@@ -22,6 +22,7 @@
#include "pandora_module_factory.h"
#include "pandora_module.h"
#include "pandora_module_exec.h"
+#include "pandora_module_exec_powershell.h"
#include "pandora_module_proc.h"
#include "pandora_module_service.h"
#include "pandora_module_freedisk.h"
@@ -129,6 +130,7 @@ using namespace Pandora_Strutils;
#define TOKEN_ALERT_TEMPLATE ("module_alert_template")
#define TOKEN_USER_SESSION ("module_user_session ")
#define TOKEN_WAIT_TIMEOUT ("module_wait_timeout ")
+#define TOKEN_EXEC_POWERSHELL ("module_exec_powershell ")
string
parseLine (string line, string token) {
@@ -158,7 +160,7 @@ Pandora_Module *
Pandora_Module_Factory::getModuleFromDefinition (string definition) {
list"; - echo ' | '.__('Group filter: ').' | '; - echo ''; - html_print_select_groups(false, 'AW', true, 'group'); - echo ' | '; - echo ""; - echo ' |
'.$php_sys->data->memoryLimit->value.'
'.$php_sys->data->postMaxSize->name.'
+'.$php_sys->data->postMaxSize->value.'
+'.$php_sys->data->uploadMaxFilesize->name.'
+'.$php_sys->data->uploadMaxFilesize->value.'
+'.$php_sys->data->sessionLifetime->name.'
diff --git a/pandora_console/include/functions_netflow.php b/pandora_console/include/functions_netflow.php index bc8495969f..9ed730af38 100644 --- a/pandora_console/include/functions_netflow.php +++ b/pandora_console/include/functions_netflow.php @@ -328,12 +328,13 @@ function netflow_data_table($data, $start_date, $end_date, $aggregate, $pdf=fals /** * Show a table with netflow top N data. * - * @param array $data Netflow data. - * @param integer $total_bytes Total bytes count to calculate percent data. + * @param array $data Netflow data. + * @param integer $total_bytes Total bytes count to calculate percent data. + * @param boolean $show_extended Display extended table. * * @return string HTML data table. */ -function netflow_top_n_table(array $data, int $total_bytes) +function netflow_top_n_table(array $data, int $total_bytes, bool $show_extended=false) { global $nfdump_date_format; @@ -344,31 +345,44 @@ function netflow_top_n_table(array $data, int $total_bytes) $table->data = []; $table->head = []; - $table->head[0] = ''.__('Source IP').''; - $table->head[1] = ''.__('Destination IP').''; - $table->head[2] = ''.__('Bytes').''; - $table->head[3] = ''.__('% Traffic').''; - $table->head[4] = ''.__('Avg. Throughput').''; - $table->style[0] = 'padding: 4px'; + if ($show_extended === false) { + $table->head[0] = ''.__('Source IP').''; + $table->head[1] = ''.__('Destination IP').''; + $table->head[2] = ''.__('Bytes').''; + $table->head[3] = ''.__('Packets').''; + $table->head[4] = ''.__('% Traffic').''; + $table->head[5] = ''.__('Avg. Throughput').''; + $table->style[0] = 'padding: 4px'; + } else { + $table->head[0] = ''.__('Source IP').''; + $table->head[1] = ''.__('Destination IP').''; + $table->head[2] = ''.__('Ingress bytes').''; + $table->head[3] = ''.__('Egress bytes').''; + $table->head[4] = ''.__('Ingress packets').''; + $table->head[5] = ''.__('Egress packets').''; + $table->head[6] = ''.__('% Traffic').''; + $table->head[7] = ''.__('Avg. Throughput').''; + $table->style[0] = 'padding: 4px'; + } $i = 0; foreach ($data as $value) { $table->data[$i][0] = $value['ip_src']; $table->data[$i][1] = $value['ip_dst']; - $table->data[$i][2] = network_format_bytes($value['bytes']); - $traffic = '-'; - - if ($total_bytes > 0) { - $traffic = sprintf( - '%.2f', - (($value['bytes'] / $total_bytes) * 100) - ); + if ($show_extended === true) { + $table->data[$i][2] = network_format_bytes($value['ibytes']); + $table->data[$i][3] = network_format_bytes($value['obytes']); + $table->data[$i][4] = (empty($value['ipackages']) === true) ? 0 : $value['ipackages']; + $table->data[$i][5] = (empty($value['opackages']) === true) ? 0 : $value['opackages']; + $table->data[$i][6] = $value['traffic'].' %'; + } else { + $table->data[$i][2] = network_format_bytes($value['bytes']); + $table->data[$i][3] = (empty($value['ipackages']) === true) ? 0 : $value['ipackages']; + $table->data[$i][4] = $value['traffic'].' %'; } - $table->data[$i][3] = $traffic.' %'; - $units = [ 'bps', 'Kbps', @@ -382,7 +396,11 @@ function netflow_top_n_table(array $data, int $total_bytes) $value['bps'] /= pow(1024, $pow); - $table->data[$i][4] = round($value['bps'], 2).' '.$units[$pow]; + if ($show_extended === true) { + $table->data[$i][7] = round($value['bps'], 2).' '.$units[$pow]; + } else { + $table->data[$i][5] = round($value['bps'], 2).' '.$units[$pow]; + } $i++; } @@ -481,7 +499,9 @@ function netflow_get_top_N( string $end_date, array $filter, int $max, - string $connection_name='' + string $connection_name='', + bool $extended_info=false, + int $total_bytes=0 ) { global $nfdump_date_format; @@ -496,7 +516,8 @@ function netflow_get_top_N( return json_decode($data, true); } - $options = '-o "fmt:%sap,%dap,%ibyt,%bps" -q -n '.$max.' -s record/bytes -t '.date($nfdump_date_format, $start_date).'-'.date($nfdump_date_format, $end_date); + $opts = ($extended_info === true) ? 'fmt:%sap,%dap,%ibyt,%obyt,%ipkt,%opkt,%bps' : 'fmt:%sap,%dap,%ibyt,%ipkt,%bps'; + $options = '-o "'.$opts.'" -q -n '.$max.' -s record/bytes -t '.date($nfdump_date_format, $start_date).'-'.date($nfdump_date_format, $end_date); $command = netflow_get_command($options, $filter, $start_date, $end_date); @@ -516,8 +537,29 @@ function netflow_get_top_N( $values[$i]['ip_src'] = $parsed_line[0]; $values[$i]['ip_dst'] = $parsed_line[1]; - $values[$i]['bytes'] = $parsed_line[2]; - $values[$i]['bps'] = $parsed_line[3]; + + $traffic = '-'; + if ($total_bytes > 0) { + $conn_bytes = $parsed_line[2]; + + $traffic = sprintf( + '%.2f', + (($conn_bytes / $total_bytes) * 100) + ); + } + + $values[$i]['traffic'] = $traffic; + + if ($extended_info === true) { + $values[$i]['ibytes'] = $parsed_line[2]; + $values[$i]['obytes'] = $parsed_line[3]; + $values[$i]['ipackets'] = $parsed_line[4]; + $values[$i]['opackets'] = $parsed_line[5]; + $values[$i]['bps'] = $parsed_line[6]; + } else { + $values[$i]['bytes'] = $parsed_line[2]; + $values[$i]['bps'] = $parsed_line[3]; + } $i++; } @@ -1341,7 +1383,11 @@ function netflow_draw_item( $output='HTML', $address_resolution=false, $width_content=false, - $height_content=false + $height_content=false, + $extended=false, + $show_graph=true, + $show_summary=true, + $show_table=true ) { $aggregate = $filter['aggregate']; $interval = ($end_date - $start_date); @@ -1496,7 +1542,9 @@ function netflow_draw_item( $end_date, $filter, $max_aggregates, - $connection_name + $connection_name, + $extended, + $data_summary['totalbytes'] ); if (empty($data_top_n) === true) { @@ -1505,16 +1553,76 @@ function netflow_draw_item( if ($output === 'HTML' || $output === 'PDF') { $html = '"; - $html .= netflow_summary_table($data_summary); - $html .= ' | '; - $html .= '
"; - $html .= netflow_top_n_table($data_top_n, $data_summary['totalbytes']); - $html .= ' | '; - $html .= '
";
+
+ if ($output === 'PDF') {
+ $html .= ' | ';
+ $html .= '
"; + $html .= netflow_summary_table($data_summary); + $html .= ' | '; + $html .= '
"; + $html .= netflow_top_n_table( + $data_top_n, + $data_summary['totalbytes'], + $extended + ); + $html .= ' | '; + $html .= '
';
$result_pdf .= $title;
@@ -16181,7 +16206,8 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
// Si viene de no iniciado busco el primer dato del modulo y si es de histórico.
$first_utimestamp = false;
$search_historydb = false;
- $extract_first_data = modules_get_first_date($content['id_agent_module'], 0);
+ // Limitamos el primer dato al rango de tiempo seleccionado por el usuario.
+ $extract_first_data = modules_get_first_date($content['id_agent_module'], $date_start);
if (empty($extract_first_data) === false) {
$first_utimestamp = $extract_first_data['first_utimestamp'];
$search_historydb = (isset($extract_first_data['search_historydb']) === true) ? $extract_first_data['search_historydb'] : false;
@@ -16286,7 +16312,8 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
$return['data_ok'] = $check_ok;
$return['data_total'] = $check_total;
if ($check_total > 0) {
- $return['percent_ok'] = (($time_ok * 100) / $content['period']);
+ $percent_ok = (($time_ok * 100) / $content['period']);
+ $return['percent_ok'] = ($percent_ok > 100) ? 100 : $percent_ok;
} else {
$return['percent_ok'] = 0;
}
diff --git a/pandora_console/include/functions_servers.php b/pandora_console/include/functions_servers.php
index bdc8a56fc9..8805998232 100644
--- a/pandora_console/include/functions_servers.php
+++ b/pandora_console/include/functions_servers.php
@@ -615,7 +615,7 @@ function servers_get_rate($avg_interval, $num_modules)
* This function will get all the server information in an array
* or a specific server.
*
- * @param integer $id_server An optional integer or array of integers
+ * @param integer|array $id_server An optional integer or array of integers
* to select specific servers.
*
* @return mixed False in case the server doesn't exist or an array with info.
@@ -624,28 +624,63 @@ function servers_get_info($id_server=-1, $sql_limit=-1)
{
global $config;
- if (is_array($id_server)) {
- $select_id = ' WHERE id_server IN ('.implode(',', $id_server).')';
+ $select_id = '';
+ if (is_array($id_server) === true) {
+ $select_id = ' AND id_server IN ('.implode(',', $id_server).')';
} else if ($id_server > 0) {
- $select_id = ' WHERE id_server IN ('.(int) $id_server.')';
- } else {
- $select_id = '';
+ $select_id = ' AND id_server IN ('.(int) $id_server.')';
}
- $sql = '
- SELECT *
- FROM tserver '.$select_id.'
- ORDER BY server_type';
+ $types_sql = sprintf(
+ ' AND (
+ `server_type` != %d AND
+ `server_type` != %d
+ )',
+ SERVER_TYPE_AUTOPROVISION,
+ SERVER_TYPE_MIGRATION
+ );
+ if (is_metaconsole() === true && isset($config['ndbh']) === false) {
+ $types_sql = sprintf(
+ ' AND (
+ `server_type` = %d OR
+ `server_type` = %d OR
+ `server_type` = %d OR
+ `server_type` = %d
+ )',
+ SERVER_TYPE_AUTOPROVISION,
+ SERVER_TYPE_EVENT,
+ SERVER_TYPE_MIGRATION,
+ SERVER_TYPE_PREDICTION
+ );
+ }
+
+ $sql = sprintf(
+ 'SELECT *
+ FROM tserver
+ WHERE 1=1
+ %s
+ %s
+ ORDER BY server_type',
+ $select_id,
+ $types_sql
+ );
if ($sql_limit !== -1) {
- $sql = '
- SELECT *
- FROM tserver '.$select_id.'
- ORDER BY server_type'.$sql_limit;
+ $sql = sprintf(
+ 'SELECT *
+ FROM tserver
+ WHERE 1=1
+ %s
+ %s
+ ORDER BY server_type
+ %s',
+ $select_id,
+ $types_sql,
+ $sql_limit
+ );
}
$result = db_get_all_rows_sql($sql);
- $time = get_system_time();
if (empty($result)) {
return false;
@@ -1445,6 +1480,12 @@ function servers_get_server_string_name(int $server)
case SERVER_TYPE_NCM:
return __('NCM server');
+ case SERVER_TYPE_AUTOPROVISION:
+ return __('Autoprovision server');
+
+ case SERVER_TYPE_MIGRATION:
+ return __('Migration server');
+
default:
return __('N/A');
}
diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php
index 66dad24db6..ada7841ab7 100755
--- a/pandora_console/include/functions_treeview.php
+++ b/pandora_console/include/functions_treeview.php
@@ -1039,7 +1039,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
echo "
+
+
+ values['gis_map']);
+
+ $output .= '';
+ gis_print_map(
+ 'map_'.$this->cellId,
+ $map['zoom_level'],
+ $map['initial_latitude'],
+ $map['initial_longitude'],
+ $baselayers,
+ $controls
+ );
+ $output .= '';
+
+ if (empty($layers) === false) {
+ foreach ($layers as $layer) {
+ gis_make_layer(
+ $layer['layer_name'],
+ $layer['view_layer'],
+ null,
+ $layer['id_tmap_layer']
+ );
+
+ // Calling agents_get_group_agents with none to obtain the names in the same case as they are in the DB.
+ $agentNamesByGroup = [];
+ if ($layer['tgrupo_id_grupo'] >= 0) {
+ $agentNamesByGroup = agents_get_group_agents(
+ $layer['tgrupo_id_grupo'],
+ false,
+ 'none',
+ true,
+ true,
+ false
+ );
+ }
+
+ $agentNamesByLayer = gis_get_agents_layer($layer['id_tmap_layer']);
+
+ $groupsByAgentId = gis_get_groups_layer_by_agent_id($layer['id_tmap_layer']);
+ $agentNamesOfGroupItems = [];
+ foreach ($groupsByAgentId as $agentId => $groupInfo) {
+ $agentNamesOfGroupItems[$agentId] = $groupInfo['agent_name'];
+ }
+
+ $agentNames = array_unique($agentNamesByGroup + $agentNamesByLayer + $agentNamesOfGroupItems);
+
+ foreach ($agentNames as $key => $agentName) {
+ $idAgent = $key;
+ $coords = gis_get_data_last_position_agent($idAgent);
+
+ if ($coords === false) {
+ $coords['stored_latitude'] = $map['default_latitude'];
+ $coords['stored_longitude'] = $map['default_longitude'];
+ } else {
+ if ($show_history == 'y') {
+ $lastPosition = [
+ 'longitude' => $coords['stored_longitude'],
+ 'latitude' => $coords['stored_latitude'],
+ ];
+ gis_add_path($layer['layer_name'], $idAgent, $lastPosition);
+ }
+ }
+
+ $status = agents_get_status($idAgent, true);
+ $icon = gis_get_agent_icon_map($idAgent, true, $status);
+ $icon_size = getimagesize($icon);
+ $icon_width = $icon_size[0];
+ $icon_height = $icon_size[1];
+
+ // Is a group item.
+ if (empty($groupsByAgentId[$idAgent]) === false) {
+ $groupId = (int) $groupsByAgentId[$idAgent]['id'];
+ $groupName = $groupsByAgentId[$idAgent]['name'];
+
+ gis_add_agent_point(
+ $layer['layer_name'],
+ io_safe_output($groupName),
+ $coords['stored_latitude'],
+ $coords['stored_longitude'],
+ $icon,
+ $icon_width,
+ $icon_height,
+ $idAgent,
+ $status,
+ 'point_group_info',
+ $groupId
+ );
+ } else {
+ $parent = db_get_value('id_parent', 'tagente', 'id_agente', $idAgent);
+
+ gis_add_agent_point(
+ $layer['layer_name'],
+ io_safe_output($agentName),
+ $coords['stored_latitude'],
+ $coords['stored_longitude'],
+ $icon,
+ $icon_width,
+ $icon_height,
+ $idAgent,
+ $status,
+ 'point_agent_info',
+ $parent
+ );
+ }
+ }
+ }
+
+ gis_add_parent_lines();
+
+ $timestampLastOperation = db_get_value_sql('SELECT UNIX_TIMESTAMP()');
+
+ gis_activate_select_control();
+ gis_activate_ajax_refresh($layers, $timestampLastOperation);
+ }
+
+ return $output;
+ }
+
+
+ /**
+ * Get description.
+ *
+ * @return string.
+ */
+ public static function getDescription()
+ {
+ return __('GIS map');
+ }
+
+
+ /**
+ * Get Name.
+ *
+ * @return string.
+ */
+ public static function getName()
+ {
+ return 'GisMap';
+ }
+
+
+ /**
+ * Get size Modal Configuration.
+ *
+ * @return array
+ */
+ public function getSizeModalConfiguration(): array
+ {
+ $size = [
+ 'width' => 500,
+ 'height' => 300,
+ ];
+
+ return $size;
+ }
+
+
+}
diff --git a/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php b/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php
index e490135734..1bbcc3be33 100644
--- a/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php
+++ b/pandora_console/include/lib/Dashboard/Widgets/ModulesByStatus.php
@@ -115,6 +115,13 @@ class ModulesByStatus extends Widget
*/
protected $cellId;
+ /**
+ * Size
+ *
+ * @var array
+ */
+ public $size;
+
/**
* Construct.
@@ -200,6 +207,14 @@ class ModulesByStatus extends Widget
// Retrieve global - common inputs.
$values = parent::decoders($decoder);
+ if (isset($decoder['groupId']) === true) {
+ $values['groupId'] = $decoder['groupId'];
+ }
+
+ if (isset($decoder['search_agent']) === true) {
+ $values['search_agent'] = $decoder['search_agent'];
+ }
+
if (isset($decoder['search']) === true) {
$values['search'] = $decoder['search'];
}
@@ -240,9 +255,39 @@ class ModulesByStatus extends Widget
// Retrieve global - common inputs.
$inputs = parent::getFormInputs();
+ $return_all_group = false;
+ if (users_can_manage_group_all('RM') || $values['groupId'] == 0) {
+ $return_all_group = true;
+ }
+
+ // Groups.
+ $inputs[] = [
+ 'label' => __('Group'),
+ 'arguments' => [
+ 'type' => 'select_groups',
+ 'name' => 'groupId',
+ 'returnAllGroup' => $return_all_group,
+ 'privilege' => 'AR',
+ 'selected' => $values['groupId'],
+ 'return' => true,
+ ],
+ ];
+
+ // Search Agent.
+ $inputs[] = [
+ 'label' => __('Search agent').ui_print_help_tip(__('Search filter by Agent name field content'), true),
+ 'arguments' => [
+ 'name' => 'search_agent',
+ 'type' => 'text',
+ 'value' => $values['search_agent'],
+ 'return' => true,
+ 'size' => 0,
+ ],
+ ];
+
// Search.
$inputs[] = [
- 'label' => __('Free search').ui_print_help_tip(__('Search filter by Module name field content'), true),
+ 'label' => __('Search module').ui_print_help_tip(__('Search filter by Module name field content'), true),
'arguments' => [
'name' => 'search',
'type' => 'text',
@@ -373,7 +418,9 @@ class ModulesByStatus extends Widget
// Retrieve global - common inputs.
$values = parent::getPost();
+ $values['groupId'] = \get_parameter('groupId', 0);
$values['search'] = \get_parameter('search', '');
+ $values['search_agent'] = \get_parameter('search_agent', '');
$values['status'] = \get_parameter('status', '');
$values['limit'] = \get_parameter('limit', '');
$values['nodes'] = \get_parameter('nodes', '');
@@ -386,173 +433,73 @@ class ModulesByStatus extends Widget
/**
* Draw widget.
*
- * @return string;
+ * @return void Html output;
*/
public function load()
{
- $this->size = parent::getSize();
+ // Datatables list.
+ try {
+ $info_columns = $this->columns();
+ $column_names = $info_columns['column_names'];
+ $columns = $info_columns['columns'];
+ $hash = get_parameter('auth_hash', '');
+ $id_user = get_parameter('id_user', '');
- global $config;
-
- $output = '';
-
- if (is_metaconsole() === true) {
- $modules = [];
-
- $servers_ids = array_column(metaconsole_get_servers(), 'id');
-
- foreach ($servers_ids as $server_id) {
- try {
- $node = new Node((int) $server_id);
-
- $node->connect();
- $modules_tmp = $this->getInfoModules(
- $this->values['search'],
- $this->values['status'],
- $this->values['nodes']
- );
- $modules[$node->id()] = $modules_tmp[0];
- $node->disconnect();
- } catch (\Exception $e) {
- // Unexistent modules.
- $node->disconnect();
- }
- }
- } else {
- $modules = $this->getInfoModules(
- $this->values['search'],
- $this->values['status']
+ $tableId = 'ModuleByStatus_'.$this->dashboardId.'_'.$this->cellId;
+ // Load datatables user interface.
+ ui_print_datatable(
+ [
+ 'id' => $tableId,
+ 'class' => 'info_table align-left-important',
+ 'style' => 'width: 100%',
+ 'columns' => $columns,
+ 'column_names' => $column_names,
+ 'ajax_url' => 'include/ajax/module',
+ 'ajax_data' => [
+ 'get_data_ModulesByStatus' => 1,
+ 'table_id' => $tableId,
+ 'search_agent' => $this->values['search_agent'],
+ 'search' => $this->values['search'],
+ 'groupId' => $this->values['groupId'],
+ 'status' => $this->values['status'],
+ 'nodes' => $this->values['nodes'],
+ 'disabled_modules' => $this->values['disabled_modules'],
+ 'auth_hash' => $hash,
+ 'auth_class' => 'PandoraFMS\Dashboard\Manager',
+ 'id_user' => $id_user,
+ ],
+ 'default_pagination' => $this->values['limit'],
+ 'order' => [
+ 'field' => 'last_status_change',
+ 'direction' => 'desc',
+ ],
+ 'csv' => 0,
+ 'pagination_options' => [
+ [
+ 5,
+ 10,
+ 25,
+ 100,
+ 200,
+ 500,
+ 1000,
+ ],
+ [
+ 5,
+ 10,
+ 25,
+ 100,
+ 200,
+ 500,
+ 1000,
+ ],
+ ],
+ 'dom_elements' => 'frtilp',
+ ]
);
+ } catch (\Exception $e) {
+ echo $e->getMessage();
}
-
- if ($modules !== false && empty($modules) === false) {
- // Datatables list.
- try {
- $info_columns = $this->columns();
- $column_names = $info_columns['column_names'];
- $columns = $info_columns['columns'];
- $hash = get_parameter('auth_hash', '');
- $id_user = get_parameter('id_user', '');
-
- $tableId = 'ModuleByStatus_'.$this->dashboardId.'_'.$this->cellId;
- // Load datatables user interface.
- ui_print_datatable(
- [
- 'id' => $tableId,
- 'class' => 'info_table align-left-important',
- 'style' => 'width: 100%',
- 'columns' => $columns,
- 'column_names' => $column_names,
- 'ajax_url' => 'include/ajax/module',
- 'ajax_data' => [
- 'get_data_ModulesByStatus' => 1,
- 'table_id' => $tableId,
- 'search' => $this->values['search'],
- 'status' => $this->values['status'],
- 'nodes' => $this->values['nodes'],
- 'disabled_modules' => $this->values['disabled_modules'],
- 'auth_hash' => $hash,
- 'auth_class' => 'PandoraFMS\Dashboard\Manager',
- 'id_user' => $id_user,
- ],
- 'default_pagination' => $this->values['limit'],
- 'order' => [
- 'field' => 'last_status_change',
- 'direction' => 'desc',
- ],
- 'csv' => 0,
- 'pagination_options' => [
- [
- 5,
- 10,
- 25,
- 100,
- 200,
- 500,
- 1000,
- ],
- [
- 5,
- 10,
- 25,
- 100,
- 200,
- 500,
- 1000,
- ],
- ],
- 'dom_elements' => 'frtilp',
- ]
- );
- } catch (\Exception $e) {
- echo $e->getMessage();
- }
- } else {
- $output = '';
- $output .= ' ';
- $output .= \ui_print_info_message(
- __('Not found modules'),
- '',
- true
- );
- $output .= ' ';
-
- return $output;
- }
- }
-
-
- /**
- * Get info modules.
- *
- * @param string $search Free search.
- * @param string $status Modules status.
- *
- * @return array Data.
- */
- private function getInfoModules(string $search, string $status): array
- {
- if (empty($search) === false) {
- $where = 'tagente_modulo.nombre LIKE "%%'.$search.'%%" AND ';
- }
-
- if (str_contains($status, '6') === true) {
- $expl = explode(',', $status);
- $exist = array_search('6', $expl);
- if (isset($exist) === true) {
- unset($expl[$exist]);
- }
-
- array_push($expl, '1', '2');
-
- $status = implode(',', $expl);
- }
-
- $where .= sprintf(
- 'tagente_estado.estado IN (%s)
- AND tagente_modulo.delete_pending = 0',
- $status
- );
-
- $sql = sprintf(
- 'SELECT
- COUNT(*) AS "modules"
- FROM tagente_modulo
- INNER JOIN tagente
- ON tagente_modulo.id_agente = tagente.id_agente
- INNER JOIN tagente_estado
- ON tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
- WHERE %s',
- $where
- );
-
- $modules = db_get_all_rows_sql($sql);
-
- if ($modules === false) {
- $modules = [];
- }
-
- return $modules;
}
@@ -579,7 +526,10 @@ class ModulesByStatus extends Widget
'nombre',
'alias',
'server_name',
- 'last_status_change',
+ [
+ 'text' => 'last_status_change',
+ 'class' => '',
+ ],
'estado',
];
} else {
@@ -593,7 +543,10 @@ class ModulesByStatus extends Widget
$columns = [
'nombre',
'alias',
- 'last_status_change',
+ [
+ 'text' => 'last_status_change',
+ 'class' => '',
+ ],
'estado',
];
}
@@ -642,12 +595,12 @@ class ModulesByStatus extends Widget
$height_counter = (((int) count($nodes_fields)) * 20);
$size = [
- 'width' => 450,
+ 'width' => 470,
'height' => (520 + $height_counter),
];
} else {
$size = [
- 'width' => 450,
+ 'width' => 470,
'height' => 480,
];
}
diff --git a/pandora_console/include/lib/Dashboard/Widgets/agent_module.php b/pandora_console/include/lib/Dashboard/Widgets/agent_module.php
index 56ab854375..f5c4ff5a96 100644
--- a/pandora_console/include/lib/Dashboard/Widgets/agent_module.php
+++ b/pandora_console/include/lib/Dashboard/Widgets/agent_module.php
@@ -355,7 +355,7 @@ class AgentModuleWidget extends Widget
*/
public function getIdCacheAgent($id_agents)
{
- $target_agents = explode(',', $id_agents);
+ $target_agents = explode(',', ($id_agents ?? ''));
$cache_id_agents = [];
foreach ($target_agents as $agent_id) {
if (str_contains($agent_id, '|') === false) {
diff --git a/pandora_console/include/lib/Dashboard/Widgets/events_list.php b/pandora_console/include/lib/Dashboard/Widgets/events_list.php
index a50cab93e4..beb7a92b5f 100644
--- a/pandora_console/include/lib/Dashboard/Widgets/events_list.php
+++ b/pandora_console/include/lib/Dashboard/Widgets/events_list.php
@@ -111,6 +111,20 @@ class EventsListWidget extends Widget
*/
protected $publicLink;
+ /**
+ * Overflow scrollbar.
+ *
+ * @var boolean
+ */
+ public $overflow_scrollbars;
+
+ /**
+ * Position
+ *
+ * @var array
+ */
+ public $position;
+
/**
* Construct.
diff --git a/pandora_console/include/lib/Dashboard/Widgets/heatmap.php b/pandora_console/include/lib/Dashboard/Widgets/heatmap.php
index e199a80ad8..ada804bedb 100644
--- a/pandora_console/include/lib/Dashboard/Widgets/heatmap.php
+++ b/pandora_console/include/lib/Dashboard/Widgets/heatmap.php
@@ -271,7 +271,7 @@ class HeatmapWidget extends Widget
'name' => 'groups[]',
'returnAllGroup' => true,
'privilege' => 'AR',
- 'selected' => explode(',', $values['groups'][0]),
+ 'selected' => (isset($values['groups'][0]) === true) ? explode(',', $values['groups'][0]) : [],
'return' => true,
'multiple' => true,
],
@@ -305,7 +305,7 @@ class HeatmapWidget extends Widget
'type' => 'select',
'fields' => $tags,
'name' => 'tags[]',
- 'selected' => explode(',', $values['tags'][0]),
+ 'selected' => (isset($values['tags'][0]) === true) ? explode(',', $values['tags'][0]) : [],
'return' => true,
'multiple' => true,
],
@@ -332,7 +332,7 @@ class HeatmapWidget extends Widget
'type' => 'select',
'fields' => $module_groups,
'name' => 'module_groups[]',
- 'selected' => explode(',', $values['module_groups'][0]),
+ 'selected' => (isset($values['module_groups'][0]) === true) ? explode(',', $values['module_groups'][0]) : [],
'return' => true,
'multiple' => true,
'nothing' => __('Not assigned'),
diff --git a/pandora_console/include/lib/Dashboard/Widgets/security_hardening.php b/pandora_console/include/lib/Dashboard/Widgets/security_hardening.php
index 9f7d726677..88e37c58b5 100644
--- a/pandora_console/include/lib/Dashboard/Widgets/security_hardening.php
+++ b/pandora_console/include/lib/Dashboard/Widgets/security_hardening.php
@@ -446,7 +446,7 @@ class SecurityHardening extends Widget
{
global $config;
- $id_groups = explode(',', $group);
+ $id_groups = explode(',', ($group ?? ''));
if (in_array(0, $id_groups) === true) {
$id_groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
}
diff --git a/pandora_console/include/lib/TacticalView/GeneralTacticalView.php b/pandora_console/include/lib/TacticalView/GeneralTacticalView.php
index e00bc8fcf8..06e27e4fd6 100644
--- a/pandora_console/include/lib/TacticalView/GeneralTacticalView.php
+++ b/pandora_console/include/lib/TacticalView/GeneralTacticalView.php
@@ -224,18 +224,33 @@ class GeneralTacticalView
$zone_location = $date_zone->getLocation();
$latitude = $zone_location['latitude'];
- $emojiOptions = [
- 'have_good_day' => __('Have a good day %s ✌', $name),
- 'welcome_back' => __('Welcome back! %s 👋', $name),
- 'merry_christmas' => __('Welcome back! %s 🎅', $name),
- 'good_morning' => __('Good morning, %s! ☕', $name),
- 'good_evening' => __('Good evening, %s 🌇', $name),
- 'good_night' => __('Good night, %s 🌕', $name),
- 'happy_summer' => __('Happy summer, %s 🌞', $name),
- 'happy_winter' => __('Happy winter, %s ⛄', $name),
- 'happy_autumn' => __('Happy autumn, %s 🍂', $name),
- 'happy_spring' => __('Happy spring, %s 🌻', $name),
- ];
+ if ($name !== '') {
+ $emojiOptions = [
+ 'have_good_day' => __('Have a good day %s ✌', $name),
+ 'welcome_back' => __('Welcome back! %s 👋', $name),
+ 'merry_christmas' => __('Welcome back! %s 🎅', $name),
+ 'good_morning' => __('Good morning, %s! ☕', $name),
+ 'good_evening' => __('Good evening, %s 🌇', $name),
+ 'good_night' => __('Good night, %s 🌕', $name),
+ 'happy_summer' => __('Happy summer, %s 🌞', $name),
+ 'happy_winter' => __('Happy winter, %s ⛄', $name),
+ 'happy_autumn' => __('Happy autumn, %s 🍂', $name),
+ 'happy_spring' => __('Happy spring, %s 🌻', $name),
+ ];
+ } else {
+ $emojiOptions = [
+ 'have_good_day' => __('Have a good day ✌'),
+ 'welcome_back' => __('Welcome back! 👋'),
+ 'merry_christmas' => __('Welcome back! 🎅'),
+ 'good_morning' => __('Good morning! ☕'),
+ 'good_evening' => __('Good evening 🌇'),
+ 'good_night' => __('Good night 🌕'),
+ 'happy_summer' => __('Happy summer 🌞'),
+ 'happy_winter' => __('Happy winter ⛄'),
+ 'happy_autumn' => __('Happy autumn 🍂'),
+ 'happy_spring' => __('Happy spring 🌻'),
+ ];
+ }
// Welcome back.
$user_last_connect = $user['last_connect'];
diff --git a/pandora_console/include/lib/TacticalView/elements/SnmpTraps.php b/pandora_console/include/lib/TacticalView/elements/SnmpTraps.php
index f606893429..9e1de4d891 100644
--- a/pandora_console/include/lib/TacticalView/elements/SnmpTraps.php
+++ b/pandora_console/include/lib/TacticalView/elements/SnmpTraps.php
@@ -83,7 +83,11 @@ class SnmpTraps extends Element
{
if ($this->isEnabled() === true) {
$value = $this->valueMonitoring('snmp_trap_queue');
- $total = round($value[0]['data']);
+ if (isset($value[0]['data']) === true) {
+ $total = round($value[0]['data']);
+ } else {
+ $total = __('N/A');
+ }
} else {
$total = __('N/A');
}
@@ -109,7 +113,11 @@ class SnmpTraps extends Element
{
if ($this->isEnabled() === true) {
$value = $this->valueMonitoring('total_trap');
- $total = round($value[0]['data']);
+ if (isset($value[0]['data']) === true) {
+ $total = round($value[0]['data']);
+ } else {
+ $total = __('N/A');
+ }
} else {
$total = __('N/A');
}
diff --git a/pandora_console/include/rest-api/models/VisualConsole/View.php b/pandora_console/include/rest-api/models/VisualConsole/View.php
index 9ff824c242..e2e28f419a 100644
--- a/pandora_console/include/rest-api/models/VisualConsole/View.php
+++ b/pandora_console/include/rest-api/models/VisualConsole/View.php
@@ -637,6 +637,7 @@ class View extends \HTML
* Returns a popup for networkLink viewer.
*
* @return void
+ *
* phpcs:disable Squiz.Commenting.FunctionCommentThrowTag.Missing
*/
public function networkLinkPopup()
diff --git a/pandora_console/include/styles/dashboards.css b/pandora_console/include/styles/dashboards.css
index 8786faa843..00a780be6d 100644
--- a/pandora_console/include/styles/dashboards.css
+++ b/pandora_console/include/styles/dashboards.css
@@ -977,3 +977,19 @@ input.resize_button {
.event-cardboard-widget td {
cursor: pointer;
}
+
+.datatable-container-info-massage:not(:has(.invisible_important)) {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ height: 100%;
+ width: 100%;
+}
+
+.info_box_information.datatable-info-massage.info_box_container
+ .info_box.info.textodialogo {
+ display: flex;
+ width: 100%;
+ justify-content: center;
+}
diff --git a/pandora_console/include/styles/events.css b/pandora_console/include/styles/events.css
index 9a69ea8c56..c3c6f73f5d 100644
--- a/pandora_console/include/styles/events.css
+++ b/pandora_console/include/styles/events.css
@@ -505,10 +505,10 @@ div.multi-response-buttons {
justify-content: flex-start;
}
-td:has(div#server_to_exec_label),
+/*td:has(div#server_to_exec_label),
td:has(div#server_to_exec_value) {
padding: 0px;
-}
+}*/
table#save_filter_form,
table#load_filter_form {
@@ -569,3 +569,23 @@ div.container-filter-buttons {
.ui-dialog.modal-sound .ui-widget-header {
display: flex !important;
}
+
+.responsive_button_sound_events {
+ margin-right: 25% !important;
+}
+
+@media (max-width: 1640px) {
+ .responsive_button_sound_events {
+ margin-right: 10% !important;
+ }
+}
+
+@media (max-width: 1420px) {
+ .responsive_button_sound_events {
+ margin-right: 10px !important;
+ }
+}
+
+#button-start-search {
+ width: 115px;
+}
diff --git a/pandora_console/include/styles/jquery.tag-editor.css b/pandora_console/include/styles/jquery.tag-editor.css
index 5d535dba1e..31040fca45 100644
--- a/pandora_console/include/styles/jquery.tag-editor.css
+++ b/pandora_console/include/styles/jquery.tag-editor.css
@@ -108,9 +108,7 @@
cursor: default;
font-size: 14px;
}
-.ui-front {
- z-index: 9999;
-}
+
.ui-menu {
list-style: none;
padding: 1px;
diff --git a/pandora_console/include/styles/js/jquery-ui_custom.css b/pandora_console/include/styles/js/jquery-ui_custom.css
index 440540ab05..5bf343ee60 100644
--- a/pandora_console/include/styles/js/jquery-ui_custom.css
+++ b/pandora_console/include/styles/js/jquery-ui_custom.css
@@ -61,15 +61,11 @@
}
.ui-dialog .ui-dialog-titlebar-disengage {
- position: absolute !important;
- right: 50px;
- top: -3px;
- width: 40px;
margin: 0px 0 0 0;
padding: 1px;
- height: 40px;
+ height: 20px;
bottom: 30%;
- background-color: #fff !important;
+ background-color: white;
}
.ui-dialog .ui-dialog-titlebar-disengage:hover {
diff --git a/pandora_console/include/styles/pandora.css b/pandora_console/include/styles/pandora.css
index 8a361b187b..b94418b090 100644
--- a/pandora_console/include/styles/pandora.css
+++ b/pandora_console/include/styles/pandora.css
@@ -776,6 +776,10 @@ select:-internal-list-box {
width: 80%;
}
+.w85p {
+ width: 85%;
+}
+
.w88p {
width: 88%;
}
@@ -1036,6 +1040,10 @@ select:-internal-list-box {
padding-bottom: 5px;
}
+.padding-bottom-25px {
+ padding-bottom: 25px;
+}
+
.padding-right-2 {
padding-right: 2em;
}
@@ -10946,6 +10954,18 @@ div.status_dot {
-webkit-mask: url(../../images/status_dot.svg) no-repeat center / contain;
}
+button div.import {
+ mask: url(../../images/import.svg) no-repeat center / contain;
+ -webkit-mask: url(../../images/import.svg) no-repeat center / contain;
+ height: 1.5rem;
+}
+
+button div.export {
+ mask: url(../../images/export.svg) no-repeat center / contain;
+ -webkit-mask: url(../../images/export.svg) no-repeat center / contain;
+ height: 1.5rem;
+}
+
.status_dot.ok {
background-color: #82b92e;
}
@@ -12116,6 +12136,10 @@ div.relative > div > div#ui-datepicker-div {
width: 400px;
}
+.container-div-input-password {
+ display: block !important;
+}
+
#message_dialog_connection {
height: auto !important;
}
@@ -12807,9 +12831,9 @@ div.agents_custom_fields #datatables_wrapper div.bottom {
.actions-sound-modal .buttons-sound-modal button.play,
.actions-sound-modal .buttons-sound-modal input[type="button"].play {
- background: url(../../images/play-white.png), transparent !important;
+ /*background: url(../../images/play-white.png), transparent !important;
background-repeat: no-repeat !important;
- background-position: 82px 14px !important;
+ background-position: 82px 14px !important;*/
color: #ffffff;
padding-left: 20px;
border: 0;
@@ -12884,6 +12908,34 @@ tr.shown td.details-control {
background-color: #81b92e3b !important;
}
+@media screen and (min-width: 1190px) and (max-width: 1290px) {
+ #api_qrcode_display {
+ left: 580px;
+ }
+}
+
+@media screen and (min-width: 1143px) and (max-width: 1189px) {
+ #api_qrcode_display {
+ left: 528px;
+ }
+}
+
+@media screen and (min-width: 860px) and (max-width: 1142px) {
+ #api_qrcode_display {
+ left: 356px;
+ top: 120px;
+ }
+
+ .font-title-font {
+ line-height: 0;
+ }
+
+ #qr_code_agent_view > img {
+ width: 250px;
+ height: 250px;
+ }
+}
+
.ui-dialog .tips_header.ui-dialog-titlebar {
height: fit-content !important;
}
@@ -13464,3 +13516,71 @@ tr.shown td.details-control {
mask: url(../../images/minimizar.svg) no-repeat right / contain;
-webkit-mask: url(../../images/minimizar.svg) no-repeat right / contain;
}
+
+/* Import/export */
+.div-import-export {
+ display: flex;
+ flex-direction: row;
+}
+
+.form-import {
+ width: 48%;
+ height: auto;
+ margin-right: 40px;
+}
+
+.div-import {
+ background-color: #ffffff;
+ border: 1px solid #e5e9ed;
+ border-radius: 8px;
+ width: 100%;
+ height: 180px;
+ display: flex;
+ flex-direction: row;
+ align-items: normal;
+ padding-top: 20px;
+ padding-left: 20px;
+ margin-bottom: 20px;
+}
+
+.div-export {
+ background-color: #ffffff;
+ border: 1px solid #e5e9ed;
+ border-radius: 8px;
+ width: 48%;
+ height: 180px;
+ display: flex;
+ flex-direction: row;
+ align-items: normal;
+ padding-top: 20px;
+ padding-left: 20px;
+ margin-bottom: 20px;
+}
+
+@media (max-width: 1300px) {
+ .div-import-export {
+ display: flex;
+ flex-direction: column;
+ }
+
+ .div-export {
+ width: calc(100% - 20px);
+ }
+
+ .form-import {
+ width: calc(100% - 20px);
+ }
+}
+
+.input-file-style::file-selector-button {
+ background-color: #ffffff;
+ border: 1px solid #979797;
+ border-radius: 4px;
+ width: 120px;
+ height: 32px;
+}
+
+button.disabled {
+ background: #c0ccdc !important;
+ border: 0px;
+}
diff --git a/pandora_console/include/styles/sound_events.css b/pandora_console/include/styles/sound_events.css
index a572c219f3..a8068a8308 100644
--- a/pandora_console/include/styles/sound_events.css
+++ b/pandora_console/include/styles/sound_events.css
@@ -1,9 +1,6 @@
/*
* Css Modal Sound events.
*/
-div.container-button-play > button#button-start-search {
- transition: none !important;
-}
.wizard {
text-align: left;
}
@@ -217,9 +214,9 @@ div.container-button-play > button#button-start-search {
.actions-sound-modal .buttons-sound-modal button.play,
.actions-sound-modal .buttons-sound-modal input[type="button"].play {
- background: url(../../images/play-white.png), transparent !important;
+ /*background: url(../../images/play-white.png), transparent !important;
background-repeat: no-repeat !important;
- background-position: 82px 14px !important;
+ background-position: 82px 14px !important;*/
color: #ffffff !important;
padding-left: 20px;
border: 0;
@@ -263,11 +260,6 @@ button#button-no-alerts.silence-alerts:hover {
background-position: 138px 4px !important;
}
-.actions-sound-modal .container-button-play {
- background-color: var(--primary-color);
- border-radius: 8px;
-}
-
.actions-sound-modal .container-button-alert.fired {
background: #ee2132;
border-radius: 8px;
diff --git a/pandora_console/install.php b/pandora_console/install.php
index 6d491a85cb..0f60b2f62e 100644
--- a/pandora_console/install.php
+++ b/pandora_console/install.php
@@ -131,7 +131,7 @@
';
ui_require_css_file('cluetip', 'include/styles/js/');
ui_require_jquery_file('cluetip');
-$system_higher = false;
-$modules_agent = db_get_all_rows_sql(sprintf('SELECT id_agente FROM tagente_modulo WHERE id_agente = %s', $id_agente));
-if (is_array($modules_agent)) {
- $all_modules = db_get_all_rows_sql('SELECT id_agente FROM tagente_modulo');
- $all_agents = db_get_all_rows_sql('SELECT id_agente FROM tagente');
- if (is_array($all_modules) && is_array($all_agents)) {
- if ((count($all_modules) / count($all_agents)) >= 200) {
- $system_higher = true;
+if (isset($id_agente)) {
+ $system_higher = false;
+ $modules_agent = db_get_all_rows_sql(sprintf('SELECT id_agente FROM tagente_modulo WHERE id_agente = %s', $id_agente));
+ if (is_array($modules_agent)) {
+ $all_modules = db_get_all_rows_sql('SELECT id_agente FROM tagente_modulo');
+ $all_agents = db_get_all_rows_sql('SELECT id_agente FROM tagente');
+ if (is_array($all_modules) && is_array($all_agents)) {
+ if ((count($all_modules) / count($all_agents)) >= 200) {
+ $system_higher = true;
+ }
}
}
-}
-echo ' ';
$inputs[] = $in;
// REGEX search datatable.
-$in = '';
+$in = ' ';
@@ -572,6 +604,13 @@ html_print_div(
'style' => 'position: initial;',
]
);
+
+html_print_div(
+ [
+ 'id' => 'modal_whois',
+ 'class' => 'invisible',
+ ]
+);
?>
diff --git a/pandora_console/operation/reporting/reporting_viewer.php b/pandora_console/operation/reporting/reporting_viewer.php
index 4bc5a05b61..fdd950575c 100755
--- a/pandora_console/operation/reporting/reporting_viewer.php
+++ b/pandora_console/operation/reporting/reporting_viewer.php
@@ -428,6 +428,13 @@ echo '';
ui_include_time_picker();
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
+db_pandora_audit(
+ AUDIT_LOG_REPORT_MANAGEMENT,
+ sprintf('Report visualized %s #%s.', $report['name'], $report['id_report']),
+ false,
+ false
+);
+
?>
';
$in .= html_print_input_text('regex', $regex, '', '', 255, true);
$in .= ' ';
$inputs[] = $in;
@@ -2819,7 +2833,7 @@ try {
'extra_html' => $active_filters_div.$graph_div,
'pagination_options' => [
[
- $config['block_size'],
+ (int) $config['block_size'],
10,
25,
100,
@@ -2827,7 +2841,7 @@ try {
500,
],
[
- $config['block_size'],
+ (int) $config['block_size'],
10,
25,
100,
@@ -2835,6 +2849,7 @@ try {
500,
],
],
+ 'pagination_options_order' => 'true',
'order' => [
'field' => 'timestamp',
'direction' => 'desc',
@@ -2951,8 +2966,8 @@ if (check_acl(
false,
'openSoundEventsDialog("'.$data_sound.'")',
[
+ 'class' => 'responsive_button_sound_events',
'icon' => 'sound',
- 'style' => 'margin-right: 25% !important',
'minimize-arrow' => true,
'span_style' => 'width: 100%',
],
diff --git a/pandora_console/operation/gis_maps/render_view.php b/pandora_console/operation/gis_maps/render_view.php
index e6cfaaee99..d826095a50 100644
--- a/pandora_console/operation/gis_maps/render_view.php
+++ b/pandora_console/operation/gis_maps/render_view.php
@@ -304,23 +304,7 @@ if ($layers != false) {
gis_add_parent_lines();
- switch ($config['dbtype']) {
- case 'mysql':
- $timestampLastOperation = db_get_value_sql('SELECT UNIX_TIMESTAMP()');
- break;
-
- case 'postgresql':
- $timestampLastOperation = db_get_value_sql(
- "SELECT ceil(date_part('epoch', CURRENT_TIMESTAMP))"
- );
- break;
-
- case 'oracle':
- $timestampLastOperation = db_get_value_sql(
- "SELECT ceil((sysdate - to_date('19700101000000','YYYYMMDDHH24MISS')) * (".SECONDS_1DAY.')) FROM dual'
- );
- break;
- }
+ $timestampLastOperation = db_get_value_sql('SELECT UNIX_TIMESTAMP()');
gis_activate_select_control();
gis_activate_ajax_refresh($layers, $timestampLastOperation);
diff --git a/pandora_console/operation/inventory/inventory.php b/pandora_console/operation/inventory/inventory.php
index 43296a1b26..a841c53266 100755
--- a/pandora_console/operation/inventory/inventory.php
+++ b/pandora_console/operation/inventory/inventory.php
@@ -382,7 +382,7 @@ ui_print_standard_header(
$inventory_id_agent = (int) get_parameter('agent_id', -1);
$inventory_agent = (string) get_parameter('agent', '');
-if (strlen($inventory_agent) == 0) {
+if (strlen(($inventory_agent ?? '')) == 0) {
$inventory_id_agent = -1;
$inventory_agent = __('All');
} else if ($inventory_agent == __('All')) {
diff --git a/pandora_console/operation/network/network_report.php b/pandora_console/operation/network/network_report.php
index 66847f4c1b..bc72602fd0 100644
--- a/pandora_console/operation/network/network_report.php
+++ b/pandora_console/operation/network/network_report.php
@@ -41,7 +41,10 @@ if (! check_acl($config['id_user'], 0, 'AR')) {
// Ajax callbacks.
if (is_ajax() === true) {
+ include_once $config['homedir'].'/include/functions_netflow.php';
$get_filter_values = get_parameter('get_filter_values', 0);
+ $whois = (bool) get_parameter('whois', 0);
+
// Get values of the current network filter.
if ($get_filter_values) {
$id = get_parameter('id');
@@ -51,6 +54,34 @@ if (is_ajax() === true) {
echo json_encode($filter_values);
}
+ if ($whois) {
+ $ip = get_parameter('ip');
+ $info = command_whois($ip);
+ $output = '';
+ if (is_array($info) === true && count($info) > 0) {
+ $table = new \stdClass();
+ $table->class = 'details_table dataTable info_table';
+ $table->data = [];
+ $row = 0;
+ foreach ($info as $key => $value) {
+ $table->data[$row][0] = $key;
+ $table->data[$row][1] = $value;
+ $row++;
+ }
+
+ $output = html_print_table($table, true);
+ } else {
+ $output = ui_print_info_message(__('No data found'));
+ }
+
+ html_print_div(
+ [
+ 'content' => $output,
+ 'style' => 'max-height: 600px;',
+ ],
+ );
+ }
+
return;
}
@@ -462,6 +493,7 @@ foreach ($data as $item) {
array_merge($hidden_main_link, ['main_value' => $item['host']]),
'image'
);
+ $row['main'] .= html_print_input_image('whois', 'images/eye.png', 'whois', '', true, ['onclick' => 'whois(\''.$item['host'].'\')']);
}
$row['main'] .= ' |
---|