Merge remote-tracking branch 'origin/develop'

This commit is contained in:
artica 2023-12-28 11:21:13 +01:00
commit ce45ad69d9
41 changed files with 120470 additions and 105179 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.775
Version: 7.0NG.775-231228
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.775"
pandora_version="7.0NG.775-231228"
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.775';
use constant AGENT_BUILD => '231221';
use constant AGENT_BUILD => '231228';
# 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.775
%define release 1
%define release 231228
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.775
%define release 1
%define release 231228
%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.775
%define release 1
%define release 231228
%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.775
%define release 1
%define release 231228
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.775
%define release 1
%define release 231228
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.775"
PI_BUILD="231221"
PI_BUILD="231228"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{231221}
{231228}
ViewReadme
{Yes}
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
{No}
Windows,Executable
{<%AppName%>-Setup<%Ext%>}
{<%AppName%>-<%Version%>-Setup<%Ext%>}
Windows,FileDescription
{<%AppName%> <%Version%> Setup}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.775 Build 231221")
#define PANDORA_VERSION ("7.0NG.775 Build 231228")
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.775(Build 231221))"
VALUE "ProductVersion", "(7.0NG.775(Build 231228))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.775
Version: 7.0NG.775-231228
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.775"
pandora_version="7.0NG.775-231228"
package_pear=0
package_pandora=1

View File

@ -52,7 +52,9 @@ function agents_modules_load_js()
max_width = width;
}
});
loadRecursionGroups();
$.each($('.th_class_module_r'), function (i, elem) {
id = $(elem).attr('id').replace('th_module_r_', '');
$("#th_module_r_" + id).height(($("#div_module_r_" + id).width() + 10) + 'px');
@ -139,29 +141,7 @@ function agents_modules_load_js()
});
$("#checkbox-recursion").change (function () {
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_agents_group_json" : 1,
"id_group" : $("#group_id").val(),
"privilege" : "AW",
"keys_prefix" : "_",
"recursion" : $('#checkbox-recursion').is(':checked')
},
function (data, status) {
$("#id_agents2").html('');
$("#module").html('');
jQuery.each (data, function (id, value) {
// Remove keys_prefix from the index
id = id.substring(1);
option = $("<option></option>")
.attr ("value", value["id_agente"])
.html (value["alias"]);
$("#id_agents").append (option);
$("#id_agents2").append (option);
});
},
"json"
);
loadRecursionGroups();
});
$("#modulegroup").change (function () {
@ -265,6 +245,33 @@ function agents_modules_load_js()
f.action = "index.php?sec=view&sec2=extensions/agents_modules";
$('#filter_form').submit();
}
function loadRecursionGroups () {
jQuery.post ("ajax.php",
{"page" : "operation/agentes/ver_agente",
"get_agents_group_json" : 1,
"id_group" : $("#group_id").val(),
"privilege" : "AW",
"keys_prefix" : "_",
"recursion" : $('#checkbox-recursion').is(':checked')
},
function (data, status) {
$("#id_agents2").html('');
$("#module").html('');
jQuery.each (data, function (id, value) {
// Remove keys_prefix from the index
id = id.substring(1);
option = $("<option></option>")
.attr ("value", value["id_agente"])
.html (value["alias"]);
$("#id_agents").append (option);
$("#id_agents2").append (option);
});
},
"json"
);
}
/* <![CDATA[ */
function export_csv() {
let group_id = $('#group_id option:selected').val();
@ -460,7 +467,7 @@ function mainAgentsModules()
$filter_groups .= html_print_label_input_block(
__('Recursion'),
html_print_checkbox_switch('recursion', 1, 0, true),
html_print_checkbox_switch('recursion', 1, $recursion, true),
[
'div_class' => 'add-input-reverse',
'label_class' => 'label-thin',
@ -720,6 +727,13 @@ function mainAgentsModules()
);
}
$group_id_for_agents_search = $group_id;
if ($group_id > 0) {
if ($recursion) {
$group_id_for_agents_search = groups_get_children_ids($group_id, true);
}
}
if (isset($agents_id[0]) === true && $agents_id[0] != -1) {
$agents = $agents_id;
} else {
@ -727,7 +741,7 @@ function mainAgentsModules()
$agents = $full_agents_id;
} else {
$agents = '';
$agents = agents_get_group_agents($group_id, ['disabled' => 0]);
$agents = agents_get_group_agents($group_id_for_agents_search, ['disabled' => 0]);
$agents = array_keys($agents);
}
}
@ -860,10 +874,7 @@ function mainAgentsModules()
if ($group_id > 0) {
if ($recursion) {
$filter_groups['id_grupo'] = array_merge(
$group_id,
groups_get_children_ids($group_id, true)
);
$filter_groups['id_grupo'] = groups_get_children_ids($group_id, true);
} else {
$filter_groups['id_grupo'] = $group_id;
}

View File

@ -214,7 +214,9 @@ if (is_ajax() === true) {
$tree->setFilter($filter);
ob_clean();
echo json_encode(['success' => 1, 'tree' => $tree->getArray()]);
$tree_json = json_encode(['success' => 1, 'tree' => $tree->getArray()]);
echo $tree_json;
return;
}

View File

@ -126,11 +126,12 @@ class Tree
public function setFilter($filter)
{
// There is not module filter in metaconsole.
/*
if (is_metaconsole()) {
if (is_metaconsole()) {
$filter['searchMetaconsoleModule'] = $filter['searchModule'];
$filter['searchModule'] = '';
$filter['statusMetaconsoleModule'] = $filter['statusModule'];
$filter['statusModule'] = self::TV_DEFAULT_AGENT_STATUS;
}*/
}
$this->filter = $filter;
}
@ -303,18 +304,23 @@ class Tree
$this->filter['statusModule'] = -1;
}
$filter_status = '';
if ((int) $this->filter['statusModule'] !== -1 && ($this->type === 'module' || $this->type === 'module_group' || $this->type === 'tag')) {
$filter_status = ' AND tae.estado = '.$this->filter['statusModule'];
}
$show_init_condition = ($this->filter['show_not_init_agents']) ? '' : ' AND ta.notinit_count <> ta.total_count';
if ($this->getEmptyModuleFilterStatus()) {
return $show_init_condition;
return $show_init_condition.$filter_status;
}
if ((int) $this->filter['statusModule'] === 6) {
return ' AND (ta.warning_count > 0 OR ta.critical_count > 0)';
return ' AND (ta.warning_count > 0 OR ta.critical_count > 0)'.$filter_status;
}
if ($this->filter['statusModule'] === 'fired') {
return ' AND ta.fired_count > 0';
return ' AND ta.fired_count > 0'.$filter_status;
}
$field_filter = modules_get_counter_by_states($this->filter['statusModule']);
@ -322,7 +328,7 @@ class Tree
return ' AND 1=0';
}
return "AND ta.$field_filter > 0".$show_init_condition;
return "AND ta.$field_filter > 0".$show_init_condition.$filter_status;
}
@ -1062,11 +1068,9 @@ class Tree
$module_search_filter = '';
if (!empty($this->filter['searchModule'])) {
$module_search_inner = '
INNER JOIN tagente_estado tae
ON tae.id_agente_modulo = tam_inner.id_agente_modulo';
$module_search_filter = "AND tam_inner.disabled = 0
AND tam_inner.nombre LIKE '%%".$this->filter['searchModule']."%%' ".$this->getModuleStatusFilterFromTestado();
$module_search_inner = '';
$module_search_filter = "AND tam.disabled = 0
AND tam.nombre LIKE '%%".$this->filter['searchModule']."%%' ".$this->getModuleStatusFilterFromTestado();
}
$sql_model = "SELECT %s FROM

View File

@ -28,9 +28,8 @@ class TreeModule extends Tree
$this->L1fieldNameSql = 'tam.nombre';
$this->L1inner = '';
$this->L1orderByFinal = 'name';
$this->L1innerInside = 'INNER JOIN tagente_modulo tam
ON ta.id_agente = tam.id_agente';
$this->L1innerInside = 'INNER JOIN tagente_modulo tam ON ta.id_agente = tam.id_agente
INNER JOIN tagente_estado tae ON tae.id_agente_modulo = tam.id_agente_modulo';
$this->L2condition = "AND tam.nombre = '".$this->symbol2name($this->rootID)."'";
}

View File

@ -31,8 +31,8 @@ class TreeModuleGroup extends Tree
'tmg.id_mg AS id',
];
$this->L1inner = 'INNER JOIN tmodule_group tmg ON tmg.id_mg = x2.g';
$this->L1innerInside = 'INNER JOIN tagente_modulo tam
ON ta.id_agente = tam.id_agente';
$this->L1innerInside = 'INNER JOIN tagente_modulo tam ON ta.id_agente = tam.id_agente
INNER JOIN tagente_estado tae ON tae.id_agente_modulo = tam.id_agente_modulo';
$this->L1orderByFinal = 'tmg.name';
$this->L2condition = 'AND tam.id_module_group = '.$this->rootID;

View File

@ -29,6 +29,8 @@ class TreeTag extends Tree
$this->L1innerInside = '
INNER JOIN tagente_modulo tam
ON ta.id_agente = tam.id_agente
INNER JOIN tagente_estado tae
ON tae.id_agente_modulo = tam.id_agente_modulo
INNER JOIN ttag_module ttm
ON ttm.id_agente_modulo = tam.id_agente_modulo
';

View File

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

View File

@ -953,11 +953,14 @@ function events_get_all(
}
}
$groups = (isset($filter['id_group_filter']) === true) ? $filter['id_group_filter'] : null;
if ((bool) $user_is_admin === false
&& isset($groups) === false
$groups = false;
$filter_groups = false;
if (isset($filter['id_group_filter']) === true
&& empty($filter['id_group_filter']) === false
) {
// Not being filtered by group but not an admin, limit results.
$filter_groups = true;
$groups = $filter['id_group_filter'];
} else if ((bool) $user_is_admin === false) {
$groups = array_keys(users_get_groups(false, 'AR'));
}
@ -1594,7 +1597,10 @@ function events_get_all(
&& (is_array($groups) === true
|| $groups > 0)
) {
$tgrupo_join = 'INNER';
if ($filter_groups === true) {
$tgrupo_join = 'INNER';
}
if (is_array($groups) === true) {
if ((bool) $filter['search_secondary_groups'] === true) {
$tgrupo_join_filters[] = sprintf(

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -108,7 +108,7 @@ td > input[id^="checkbox-multi"] {
height: 2.5em;
}
.info_table.events tr > td span:not(.invisible) {
.info_table.events tr:not(.group) > td span:not(.invisible) {
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;

View File

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

View File

@ -441,18 +441,13 @@ if ($ag_freestring != '') {
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.'%%\'
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.'%%\')
)';
}
// Status selector.
if ($status == AGENT_MODULE_STATUS_NORMAL) {
// Normal.

View File

@ -1167,7 +1167,7 @@ if (is_ajax() === true) {
parse_str($url_link_hash, $url_hash_array);
$redirection_form = "<form id='agent-table-redirection-".$redirection_form_id."' method='POST' action='".$url_link.$tmp->id_agente."'>";
$redirection_form = "<form id='agent-table-redirection-".$redirection_form_id."' class='invisible' method='POST' action='".$url_link.$tmp->id_agente."'>";
$redirection_form .= html_print_input_hidden(
'loginhash',
$url_hash_array['loginhash'],
@ -3080,7 +3080,10 @@ function process_datatables_callback(table, settings) {
.data()
.each( function ( group, i ) {
$(rows).eq( i ).show();
if ( last !== group ) {
// Compare only "a" tag because in metaconsole the node has "form".
let last_to_compare = $(last).filter('a').html();
let group_to_compare = $(group).filter('a').html();
if ( last_to_compare !== group_to_compare ) {
$(rows).eq( i ).before(
'<tr class="group"><td colspan="100%">'
+'<?php echo __('Agent').' '; ?>'

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.775
%define release 1
%define release 231228
# 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.775
%define release 1
%define release 231228
# 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.775
%define release 1
%define release 231228
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.775
Version: 7.0NG.775-231228
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.775"
pandora_version="7.0NG.775-231228"
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.775";
my $pandora_build = "231221";
my $pandora_build = "231228";
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.775";
my $pandora_build = "231221";
my $pandora_build = "231228";
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.775
%define release 1
%define release 231228
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.775
%define release 1
%define release 231228
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.775"
PI_BUILD="231221"
PI_BUILD="231228"
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.775 Build 231221";
my $version = "7.0NG.775 Build 231228";
# 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.775 Build 231221";
my $version = "7.0NG.775 Build 231228";
# save program name for logging
my $progname = basename($0);