Merge remote-tracking branch 'origin/develop' into ent-12607-faltan-botones-de-desacoplar-y-minimizar-en-consola-sonora-command-center

This commit is contained in:
daniel 2023-12-15 09:12:39 +01:00
commit 0584b9afd0
35 changed files with 121 additions and 86 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{231214}
{231215}
ViewReadme
{Yes}

View File

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

View File

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

View File

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

View File

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

View File

@ -764,6 +764,16 @@ $table->data[$i++][] = html_print_label_input_block(
)
);
$table->data[$i][] = html_print_label_input_block(
__('Easter eggs'),
html_print_checkbox_switch(
'eastern_eggs_disabled',
1,
$config['eastern_eggs_disabled'],
true
)
);
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

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

View File

@ -367,6 +367,10 @@ function config_update_config()
$error_update[] = __('show_experimental_features');
}
if (config_update_value('eastern_eggs_disabled', get_parameter('eastern_eggs_disabled'), true) === false) {
$error_update[] = __('eastern_eggs_disabled');
}
if (config_update_value('number_modules_queue', get_parameter('number_modules_queue'), true) === false) {
$error_update[] = __('number_modules_queue');
}
@ -2453,6 +2457,10 @@ function config_process_config()
config_update_value('number_modules_queue', 500);
}
if (!isset($config['eastern_eggs_disabled'])) {
config_update_value('eastern_eggs_disabled', 1);
}
if (!isset($config['agent_vulnerabilities'])) {
config_update_value('agent_vulnerabilities', 1);
}

View File

@ -170,7 +170,7 @@ class LogStorage extends Element
public function getStoredData():string
{
if ($this->isEnabled() === true) {
$data = $this->valueMonitoring('Total lines of data');
$data = $this->valueMonitoring('Total documents');
$value = format_numeric($data[0]['datos']);
} else {
$value = __('N/A');

View File

@ -1515,6 +1515,15 @@ echo html_print_div(
true
);
echo html_print_input_hidden(
'flagEasternEgg',
$config['eastern_eggs_disabled'],
false,
'',
'',
'flagEasternEgg'
);
// Connection lost alert.
set_js_value('check_conexion_interval', $config['check_conexion_interval']);
set_js_value('title_conexion_interval', __('Connection with console has been lost'));

View File

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

View File

@ -27,6 +27,7 @@
*/
// Begin.
use PandoraFMS\Enterprise\Metaconsole\Node;
global $config;
check_login();
@ -188,7 +189,7 @@ $sql_from = ' FROM tagente_modulo
INNER JOIN tagente
ON tagente_modulo.id_agente = tagente.id_agente
LEFT JOIN tagent_secondary_group tasg
ON tagente.id_agente = tasg.id_agent
ON tagente_modulo.id_agente = tasg.id_agent
INNER JOIN tagente_estado
ON tagente_estado.id_agente_modulo = tagente_modulo.id_agente_modulo
INNER JOIN tmodule
@ -436,12 +437,22 @@ if ($moduletype != '') {
// Freestring selector.
if ($ag_freestring != '') {
$sql_conditions .= ' AND (tagente.nombre '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\'
OR tagente.alias '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\'
OR tagente_modulo.nombre '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\'
OR tagente_modulo.descripcion '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\')';
$sql_conditions .= ' AND EXISTS (
SELECT 1
FROM tagente
WHERE tagente.id_agente = tagente_modulo.id_agente
AND (
tagente.nombre '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\' OR tagente.alias '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\'
)
AND (
tagente_modulo.nombre '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\'
OR tagente_modulo.descripcion '.$not_condition.' LIKE \'%%'.$ag_freestring.'%%\')
)';
}
// Status selector.
if ($status == AGENT_MODULE_STATUS_NORMAL) {
// Normal.
@ -1348,15 +1359,10 @@ $sql = 'SELECT
tagente.nombre AS agent_name,
tagente_modulo.nombre AS module_name,
tagente_modulo.history_data,
tagente_modulo.flag AS flag,
tagente.id_grupo AS id_group,
tagente.id_agente AS id_agent,
tagente_modulo.id_tipo_modulo AS module_type,
tagente_modulo.module_interval,
tagente_modulo.tcp_send,
tagente_modulo.ip_target,
tagente_modulo.snmp_community,
tagente_modulo.snmp_oid,
tagente_estado.datos,
tagente_estado.estado,
tagente_estado.last_status_change,
@ -1370,13 +1376,12 @@ $sql = 'SELECT
tagente_modulo.extended_info,
tagente_modulo.critical_inverse,
tagente_modulo.warning_inverse,
tagente_modulo.critical_instructions,
tagente_modulo.warning_instructions,
tagente_modulo.unknown_instructions,
tagente_estado.utimestamp AS utimestamp'.$sql_from.$sql_conditions_all.'
GROUP BY tagente_modulo.id_agente_modulo
ORDER BY '.$order['field'].' '.$order['order'].'
LIMIT '.$offset.','.$limit_sql;
LIMIT '.$limit_sql.' OFFSET '.$offset;
hd($sql);
// We do not show the modules until the user searches with the filter.
if ($autosearch) {
@ -1402,53 +1407,53 @@ if ($autosearch) {
$result = [];
$count_modules = 0;
foreach ($servers as $server) {
// If connection was good then retrieve all data server.
if (metaconsole_connect($server) === NOERR) {
$connection = true;
} else {
$connection = false;
}
try {
$node = new Node((int) $server['id']);
$node->connect();
$result_server = db_get_all_rows_sql($sql);
$result_server = db_get_all_rows_sql($sql);
if (empty($result_server) === false) {
// Create HASH login info.
$pwd = $server['auth_token'];
$auth_serialized = json_decode($pwd, true);
if (empty($result_server) === false) {
// Create HASH login info.
$pwd = $server['auth_token'];
$auth_serialized = json_decode($pwd, true);
if (is_array($auth_serialized)) {
$pwd = $auth_serialized['auth_token'];
$api_password = $auth_serialized['api_password'];
$console_user = $auth_serialized['console_user'];
$console_password = $auth_serialized['console_password'];
if (is_array($auth_serialized)) {
$pwd = $auth_serialized['auth_token'];
$api_password = $auth_serialized['api_password'];
$console_user = $auth_serialized['console_user'];
$console_password = $auth_serialized['console_password'];
}
$user = $config['id_user'];
$user_rot13 = str_rot13($config['id_user']);
$hashdata = $user.$pwd;
$hashdata = md5($hashdata);
foreach ($result_server as $result_element_key => $result_element_value) {
$result_server[$result_element_key]['server_id'] = $server['id'];
$result_server[$result_element_key]['server_name'] = $server['server_name'];
$result_server[$result_element_key]['server_url'] = $server['server_url'].'/';
$result_server[$result_element_key]['hashdata'] = $hashdata;
$result_server[$result_element_key]['user'] = $config['id_user'];
$result_server[$result_element_key]['groups_in_server'] = agents_get_all_groups_agent(
$result_element_value['id_agent'],
$result_element_value['id_group']
);
$count_modules++;
}
$result = array_merge($result, $result_server);
}
$user = $config['id_user'];
$user_rot13 = str_rot13($config['id_user']);
$hashdata = $user.$pwd;
$hashdata = md5($hashdata);
$url_hash = '&'.'loginhash=auto&'.'loginhash_data='.$hashdata.'&'.'loginhash_user='.$user_rot13;
foreach ($result_server as $result_element_key => $result_element_value) {
$result_server[$result_element_key]['server_id'] = $server['id'];
$result_server[$result_element_key]['server_name'] = $server['server_name'];
$result_server[$result_element_key]['server_url'] = $server['server_url'].'/';
$result_server[$result_element_key]['hashdata'] = $hashdata;
$result_server[$result_element_key]['user'] = $config['id_user'];
$result_server[$result_element_key]['groups_in_server'] = agents_get_all_groups_agent(
$result_element_value['id_agent'],
$result_element_value['id_group']
);
$count_modules++;
}
$result = array_merge($result, $result_server);
usort($result, arrayOutputSorting($sort, $fieldForSorting));
} catch (\Exception $e) {
$node->disconnect();
return;
} finally {
$node->disconnect();
}
usort($result, arrayOutputSorting($sort, $fieldForSorting));
metaconsole_restore_db();
}
if ($count_modules > $config['block_size']) {

View File

@ -96,6 +96,7 @@ $date_init_less = (strtotime(date('Y/m/d')) - SECONDS_1DAY);
$date_init = get_parameter('date_init', date(DATE_FORMAT, $date_init_less));
$time_init = get_parameter('time_init', date(TIME_FORMAT, $date_init_less));
$datetime_init = strtotime($date_init.' '.$time_init);
$default_date_netflow = false;
if ($custom_date === '1') {
if ($datetime_init >= $datetime_end) {
$datetime_init = $date_init_less;
@ -137,6 +138,8 @@ if ($custom_date === '1') {
$date_end = date('Y/m/d H:i:s');
$date_init = date('Y/m/d H:i:s', (strtotime($date_end) - $range));
$period = (strtotime($date_end) - strtotime($date_init));
$top = 10;
$default_date_netflow = true;
}
$date_from = strtotime($date_init);
@ -336,7 +339,7 @@ ui_toggle(
$has_data = false;
if ((bool) get_parameter('update_netflow', 1) === true) {
if ((bool) get_parameter('update_netflow', 1) === true || $default_date_netflow === true) {
$map_data = netflow_build_map_data(
$date_from,
$date_to,

View File

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

View File

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

View File

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

View File

@ -193,7 +193,7 @@
<?php echo __('Stored data'); ?>
</div>
<?php echo $LogStorage->getStoredData(); ?>
<span class="indicative-text"><?php echo __('Lines'); ?></span>
<span class="indicative-text"><?php echo __('Documents'); ?></span>
</div>
<div class="col-6">
<div class="subtitle">

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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