Merge remote-tracking branch 'origin/develop' into ent-9086-eliminacion-de-la-replicacion-de-eventos-duplicado
This commit is contained in:
commit
5680b82563
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.762-220608
|
||||
Version: 7.0NG.762-220613
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.762-220608"
|
||||
pandora_version="7.0NG.762-220613"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1015,7 +1015,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.762';
|
||||
use constant AGENT_BUILD => '220608';
|
||||
use constant AGENT_BUILD => '220613';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.762
|
||||
%define release 220608
|
||||
%define release 220613
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_agent_unix
|
||||
%define version 7.0NG.762
|
||||
%define release 220608
|
||||
%define release 220613
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.762"
|
||||
PI_BUILD="220608"
|
||||
PI_BUILD="220613"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{220608}
|
||||
{220613}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.762 Build 220608")
|
||||
#define PANDORA_VERSION ("7.0NG.762 Build 220613")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.762(Build 220608))"
|
||||
VALUE "ProductVersion", "(7.0NG.762(Build 220613))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.762-220608
|
||||
Version: 7.0NG.762-220613
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.762-220608"
|
||||
pandora_version="7.0NG.762-220613"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -523,7 +523,6 @@ if (enterprise_installed()) {
|
|||
$table_adv_cascade .= $cps_html;
|
||||
}
|
||||
|
||||
|
||||
$table_adv_parent = '<div class="label_select"><label class="input_label">'.__('Parent').'</label>';
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
|
@ -536,6 +535,11 @@ $params['value'] = db_get_value('alias', 'tagente', 'id_agente', $id_parent);
|
|||
$params['selectbox_id'] = 'cascade_protection_module';
|
||||
$params['javascript_is_function_select'] = true;
|
||||
$params['cascade_protection'] = true;
|
||||
if ($id_agente !== 0) {
|
||||
// Deletes the agent's offspring.
|
||||
$params['delete_offspring_agents'] = $id_agente;
|
||||
}
|
||||
|
||||
$table_adv_parent .= '<div class="label_simple_items">';
|
||||
$table_adv_parent .= ui_print_agent_autocomplete_input($params);
|
||||
if (enterprise_installed()) {
|
||||
|
|
|
@ -539,6 +539,12 @@ if ($id_downtime > 0) {
|
|||
// only action to postpone on once type is enabled and the other are disabled.
|
||||
$disabled_in_execution = (int) $running;
|
||||
|
||||
$return_all_group = false;
|
||||
|
||||
if (users_can_manage_group_all('AW') === true || $disabled) {
|
||||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$table = new StdClass();
|
||||
$table->class = 'databox filters';
|
||||
$table->width = '100%';
|
||||
|
@ -557,7 +563,7 @@ $table->data[1][0] = __('Group');
|
|||
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
true,
|
||||
$return_all_group,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
|
@ -793,7 +799,7 @@ $table->width = '100%';
|
|||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = __('Group filter');
|
||||
$table->data[0][1] = html_print_select_groups(false, $access, true, 'filter_group', $filter_group, '', '', '', true, false, true, '', false, 'min-width:180px;margin-right:15px;');
|
||||
$table->data[0][1] = html_print_select_groups(false, $access, $return_all_group, 'filter_group', $filter_group, '', '', '', true, false, true, '', false, 'min-width:180px;margin-right:15px;');
|
||||
$table->data[0][2] = __('Recursion').'  '.html_print_checkbox('recursion', 1, $recursion, true, false, '');
|
||||
|
||||
$table->data[1][0] = __('Available agents');
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
|
||||
* Please see http://pandorafms.org for full contribution list
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -89,9 +89,9 @@ if ($update) {
|
|||
$agents_ = [];
|
||||
}
|
||||
|
||||
// If the option to select all of one group or module type is checked
|
||||
// If the option to select all of one group or module type is checked.
|
||||
if ($force) {
|
||||
if ($force == 'type') {
|
||||
if ($force === 'type') {
|
||||
$type_condition = '';
|
||||
if ($module_type != 0) {
|
||||
$type_condition = "AND tam.id_tipo_modulo = $module_type";
|
||||
|
@ -109,7 +109,7 @@ if ($update) {
|
|||
$agents_ = [];
|
||||
}
|
||||
|
||||
// Create an array of agent ids
|
||||
// Create an array of agent ids.
|
||||
$agents_ = extract_column($agents_, 'id_agente');
|
||||
|
||||
foreach ($agents_ as $id_agent) {
|
||||
|
@ -136,7 +136,7 @@ if ($update) {
|
|||
if ($success == 0) {
|
||||
$error_msg = __('Error updating the modules from a module type');
|
||||
}
|
||||
} else if ($force == 'group') {
|
||||
} else if ($force === 'group') {
|
||||
$agents_ = array_keys(agents_get_group_agents($group_select, false, 'none'));
|
||||
|
||||
foreach ($agents_ as $id_agent) {
|
||||
|
@ -2226,28 +2226,30 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
|
|||
$values['quiet'] = get_parameter('quiet_select');
|
||||
}
|
||||
|
||||
$filter_modules = false;
|
||||
|
||||
if (!is_numeric($module_name) or ($module_name != 0)) {
|
||||
$filter_modules['nombre'] = $module_name;
|
||||
}
|
||||
|
||||
// Whether to update module tag info
|
||||
// Whether to update module tag info.
|
||||
$update_tags = get_parameter('id_tag', false);
|
||||
|
||||
if (array_search(0, $agents_select) !== false) {
|
||||
// Apply at All agents.
|
||||
$modules = db_get_all_rows_filter(
|
||||
'tagente_modulo',
|
||||
$filter_modules,
|
||||
[
|
||||
'id_agente_modulo',
|
||||
'id_tipo_modulo',
|
||||
]
|
||||
if (is_numeric($module_name) === false || ($module_name !== 0)) {
|
||||
$filterModules = sprintf('AND tam.nombre = \'%s\'', $module_name);
|
||||
} else {
|
||||
$filterModules = '';
|
||||
}
|
||||
|
||||
// Apply at All agents (within valid groups).
|
||||
$modules = db_get_all_rows_sql(
|
||||
sprintf(
|
||||
'SELECT tam.id_agente_modulo, tam.id_tipo_modulo
|
||||
FROM tagente_modulo tam INNER JOIN tagente ta
|
||||
ON ta.id_agente = tam.id_agente
|
||||
WHERE ta.id_grupo IN (%s) %s;',
|
||||
implode(',', array_keys(users_get_groups())),
|
||||
$filterModules
|
||||
)
|
||||
);
|
||||
} else {
|
||||
if ($module_name == '0') {
|
||||
// Any module
|
||||
if ($module_name === '0') {
|
||||
// Any module.
|
||||
$modules = db_get_all_rows_filter(
|
||||
'tagente_modulo',
|
||||
['id_agente' => $agents_select],
|
||||
|
@ -2275,12 +2277,12 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
|
|||
return false;
|
||||
}
|
||||
|
||||
if (($module_status == 'unknown') && ($module_name == '0')) {
|
||||
if (($module_status === 'unknown') && ($module_name == '0')) {
|
||||
$modules_to_delete = [];
|
||||
foreach ($modules as $mod_id) {
|
||||
$mod_status = (int) db_get_value_filter('estado', 'tagente_estado', ['id_agente_modulo' => $mod_id]);
|
||||
|
||||
// Unknown, not init and no data modules
|
||||
// Unknown, not init and no data modules.
|
||||
if ($mod_status == 3 || $mod_status == 4 || $mod_status == 5) {
|
||||
$modules_to_delete[$mod_id] = $mod_id;
|
||||
}
|
||||
|
|
|
@ -86,6 +86,8 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
|||
$addedItems = json_decode($addedItems);
|
||||
$all = (string) get_parameter('all', 'all');
|
||||
|
||||
$delete_offspring_agents = (int) get_parameter('delete_offspring_agents', 0);
|
||||
|
||||
if ($addedItems != null) {
|
||||
foreach ($addedItems as $item) {
|
||||
echo $item."|\n";
|
||||
|
@ -111,21 +113,9 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
|||
}
|
||||
|
||||
$data = [];
|
||||
// Get agents for only the alias
|
||||
// Get agents for only the alias.
|
||||
$filter_alias = $filter;
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$filter_alias[] = '(UPPER(alias) LIKE "%'.$string.'%")';
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$filter_alias[] = '(UPPER(alias) LIKE \'%'.$string.'%\')';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$filter_alias[] = '(UPPER(alias) LIKE UPPER(\'%'.$string.'%\'))';
|
||||
break;
|
||||
}
|
||||
$filter_alias[] = '(UPPER(alias) LIKE "%'.$string.'%")';
|
||||
|
||||
$agents = agents_get_agents($filter_alias, ['id_agente', 'nombre', 'direccion', 'alias']);
|
||||
if ($agents !== false) {
|
||||
|
@ -142,19 +132,7 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
|||
|
||||
// Get agents for only the name.
|
||||
$filter_agents = $filter;
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$filter_agents[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) LIKE "%'.$string.'%")';
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$filter_agents[] = '(UPPER(alias) NOT LIKE \'%'.$string.'%\' AND UPPER(nombre) LIKE \'%'.$string.'%\')';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$filter_agents[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) LIKE UPPER(\'%'.$string.'%\'))';
|
||||
break;
|
||||
}
|
||||
$filter_agents[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) LIKE "%'.$string.'%")';
|
||||
|
||||
$agents = agents_get_agents($filter_agents, ['id_agente', 'nombre', 'direccion', 'alias']);
|
||||
if ($agents !== false) {
|
||||
|
@ -169,21 +147,9 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
|||
}
|
||||
}
|
||||
|
||||
// Get agents for only the address
|
||||
// Get agents for only the address.
|
||||
$filter_address = $filter;
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$filter_address[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) LIKE "%'.$string.'%")';
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$filter_address[] = '(UPPER(alias) NOT LIKE \'%'.$string.'%\' AND UPPER(nombre) NOT LIKE \'%'.$string.'%\' AND UPPER(direccion) LIKE \'%'.$string.'%\')';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$filter_address[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(direccion) LIKE UPPER(\'%'.$string.'%\'))';
|
||||
break;
|
||||
}
|
||||
$filter_address[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) LIKE "%'.$string.'%")';
|
||||
|
||||
$agents = agents_get_agents($filter_address, ['id_agente', 'nombre', 'direccion', 'alias']);
|
||||
if ($agents !== false) {
|
||||
|
@ -198,21 +164,9 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
|||
}
|
||||
}
|
||||
|
||||
// Get agents for only the description
|
||||
// Get agents for only the description.
|
||||
$filter_description = $filter;
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
$filter_description[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) NOT LIKE "%'.$string.'%" AND UPPER(comentarios) LIKE "%'.$string.'%")';
|
||||
break;
|
||||
|
||||
case 'postgresql':
|
||||
$filter_description[] = '(UPPER(alias) NOT LIKE \'%'.$string.'%\' AND UPPER(nombre) NOT LIKE \'%'.$string.'%\' AND UPPER(direccion) NOT LIKE \'%'.$string.'%\' AND UPPER(comentarios) LIKE \'%'.$string.'%\')';
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$filter_description[] = '(UPPER(alias) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(nombre) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(direccion) NOT LIKE UPPER(\'%'.$string.'%\') AND UPPER(comentarios) LIKE UPPER(\'%'.$string.'%\'))';
|
||||
break;
|
||||
}
|
||||
$filter_description[] = '(UPPER(alias) NOT LIKE "%'.$string.'%" AND UPPER(nombre) NOT LIKE "%'.$string.'%" AND UPPER(direccion) NOT LIKE "%'.$string.'%" AND UPPER(comentarios) LIKE "%'.$string.'%")';
|
||||
|
||||
$agents = agents_get_agents($filter_description, ['id_agente', 'nombre', 'direccion', 'alias']);
|
||||
if ($agents !== false) {
|
||||
|
@ -227,6 +181,18 @@ if ($search_agents && (!is_metaconsole() || $force_local)) {
|
|||
}
|
||||
}
|
||||
|
||||
if (empty($data) === false && $delete_offspring_agents !== 0) {
|
||||
// Gets offspring and deletes them, including himself.
|
||||
$agents_offspring = agents_get_offspring($delete_offspring_agents);
|
||||
if (empty($agents_offspring) === false) {
|
||||
foreach ($data as $key => $value) {
|
||||
if (isset($agents_offspring[$value['id']]) === true) {
|
||||
unset($data[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($data);
|
||||
return;
|
||||
} else if ($search_agents && is_metaconsole()) {
|
||||
|
|
|
@ -245,7 +245,7 @@ class AgentsAlerts extends HTML
|
|||
);
|
||||
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox data';
|
||||
$table->class = 'info_table';
|
||||
$table->id = 'table_agent_module';
|
||||
$table->data = [];
|
||||
|
||||
|
@ -537,7 +537,7 @@ class AgentsAlerts extends HTML
|
|||
'alerts_agents'
|
||||
);
|
||||
|
||||
echo '<table cellpadding="4" cellspacing="4" border="0" class="agents_modules_table table">';
|
||||
echo '<table cellpadding="4" cellspacing="4" border="0" class="info_table">';
|
||||
echo '<tr>';
|
||||
echo '<th class="header_table_principal_cell">'.__('Agents').' / '.__('Alerts').'</th>';
|
||||
|
||||
|
@ -576,10 +576,11 @@ class AgentsAlerts extends HTML
|
|||
'images/arrow_left_green.png',
|
||||
true,
|
||||
[
|
||||
'style' => 'float: right;',
|
||||
'style' => 'display:flex;justify-content: center',
|
||||
'title' => __('Previous alerts'),
|
||||
]
|
||||
),
|
||||
'style' => 'display:flex;justify-content: center',
|
||||
]
|
||||
);
|
||||
echo '</th>';
|
||||
|
@ -612,9 +613,9 @@ class AgentsAlerts extends HTML
|
|||
$outputLine = html_print_div(
|
||||
[
|
||||
'id' => 'line_header_'.$id,
|
||||
'class' => 'rotate_text_module position_text_module',
|
||||
'class' => 'position_text_module',
|
||||
'style' => '',
|
||||
'content' => '<div title="'.io_safe_output($name).'">'.ui_print_truncate_text(io_safe_output($name), 20).'</div>',
|
||||
'content' => '<div style="font-size: 7.5pt !important" title="'.io_safe_output($name).'">'.ui_print_truncate_text(io_safe_output($name), 20).'</div>',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
@ -657,7 +658,7 @@ class AgentsAlerts extends HTML
|
|||
$alias = db_get_row('tagente', 'id_agente', $agent['id_agente']);
|
||||
echo '<tr>';
|
||||
// Name of the agent.
|
||||
echo '<td class="bolder" style="text-align: right" >'.$alias['alias'].'</td>';
|
||||
echo '<td style="text-align: left;font-weight: bold;color: #3f3f3f;">'.$alias['alias'].'</td>';
|
||||
// Alerts of the agent.
|
||||
foreach ($templates as $tid => $tname) {
|
||||
$anyfired = 0;
|
||||
|
@ -669,18 +670,6 @@ class AgentsAlerts extends HTML
|
|||
echo '<td class="center">';
|
||||
|
||||
if (isset($agent_alerts[$alias['alias']][$tid])) {
|
||||
foreach ($agent_alerts[$alias['alias']][$tid] as $alert) {
|
||||
if ((int) $alert['times_fired'] > 0) {
|
||||
$anyfired = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ($anyfired) {
|
||||
$cellstyle = 'background:'.COL_ALERTFIRED.';';
|
||||
} else {
|
||||
$cellstyle = 'background:'.COL_NORMAL.';';
|
||||
}
|
||||
|
||||
$uniqid = uniqid();
|
||||
|
||||
html_print_anchor(
|
||||
|
@ -689,8 +678,7 @@ class AgentsAlerts extends HTML
|
|||
'content' => html_print_div(
|
||||
[
|
||||
'id' => 'line_header_'.$temp['id'],
|
||||
'class' => 'status_rounded_rectangles text_inside',
|
||||
'style' => $cellstyle,
|
||||
'style' => 'font-size: 13pt;',
|
||||
'content' => count($agent_alerts[$alias['alias']][$tid]),
|
||||
],
|
||||
true
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
/**
|
||||
* Pandora build version and version
|
||||
*/
|
||||
$build_version = 'PC220608';
|
||||
$build_version = 'PC220613';
|
||||
$pandora_version = 'v7.0NG.762';
|
||||
|
||||
// Do not overwrite default timezone set if defined.
|
||||
|
|
|
@ -4268,3 +4268,30 @@ function get_status_data_agent_modules($id_group, $agents=[], $modules=[])
|
|||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
function agents_get_offspring(int $id_agent)
|
||||
{
|
||||
$return = [];
|
||||
// Get parent.
|
||||
$agents = db_get_all_rows_filter(
|
||||
'tagente',
|
||||
[
|
||||
'id_parent' => $id_agent,
|
||||
'disabled' => 0,
|
||||
],
|
||||
'id_agente'
|
||||
);
|
||||
|
||||
if ($agents !== false) {
|
||||
foreach ($agents as $agent) {
|
||||
if ((int) $agent['id_agente'] !== 0) {
|
||||
$return += agents_get_offspring((int) $agent['id_agente']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$return += [$id_agent => 0];
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
|
|
@ -1469,22 +1469,22 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3)
|
|||
// Check parameters.
|
||||
if ($idGroup == 0) {
|
||||
$agent_update_error = __('The agent could not be modified. For security reasons, use a group other than 0.');
|
||||
returnError('generic error', $agent_update_error);
|
||||
returnError($agent_update_error);
|
||||
return;
|
||||
}
|
||||
|
||||
$server_name = db_get_value_sql('SELECT name FROM tserver WHERE BINARY name LIKE "'.$nameServer.'"');
|
||||
if ($alias == '' && $alias_as_name === 0) {
|
||||
returnError('alias_not_specified', 'No agent alias specified');
|
||||
returnError('No agent alias specified');
|
||||
return;
|
||||
} else if (db_get_value_sql('SELECT id_grupo FROM tgrupo WHERE id_grupo = '.$idGroup) === false) {
|
||||
returnError('id_grupo_not_exist', 'The group doesn`t exist.');
|
||||
returnError('The group doesn`t exist.');
|
||||
return;
|
||||
} else if (db_get_value_sql('SELECT id_os FROM tconfig_os WHERE id_os = '.$idOS) === false) {
|
||||
returnError('id_os_not_exist', 'The OS doesn`t exist.');
|
||||
returnError('The OS doesn`t exist.');
|
||||
return;
|
||||
} else if ($server_name === false) {
|
||||
returnError('server_not_exist', 'The '.get_product_name().' Server doesn`t exist.');
|
||||
returnError('The '.get_product_name().' Server doesn`t exist.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1525,6 +1525,14 @@ function api_set_update_agent($id_agent, $thrash2, $other, $thrash3)
|
|||
returnError('The user cannot access to parent agent.');
|
||||
return;
|
||||
}
|
||||
|
||||
$agents_offspring = agents_get_offspring($id_agent);
|
||||
if (empty($agents_offspring) === false) {
|
||||
if (isset($agents_offspring[$idParent]) === true) {
|
||||
returnError('The parent cannot be a offspring');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$values_old = db_get_row_filter(
|
||||
|
@ -1751,6 +1759,14 @@ function api_set_update_agent_field($id_agent, $use_agent_alias, $params)
|
|||
returnError('The user cannot access to parent agent.');
|
||||
return;
|
||||
}
|
||||
|
||||
$agents_offspring = agents_get_offspring($id_agent);
|
||||
if (empty($agents_offspring) === false) {
|
||||
if (isset($agents_offspring[$data]) === true) {
|
||||
returnError('The parent cannot be a offspring');
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -1133,7 +1133,7 @@ function modules_get_table_data(?int $id_agent_module, ?int $id_type)
|
|||
|
||||
function modules_get_raw_data($id_agent_module, $date_init, $date_end)
|
||||
{
|
||||
$table = modules_get_table_data($id_agent_module);
|
||||
$table = modules_get_table_data($id_agent_module, null);
|
||||
|
||||
$datelimit = ($date_init - $date_end);
|
||||
$search_in_history_db = db_search_in_history_db($datelimit);
|
||||
|
@ -4213,7 +4213,7 @@ function modules_get_min_max_data($id_agent_module, $time_init=0)
|
|||
$data[0]['max'] = $min_max['max'];
|
||||
} else {
|
||||
// Search limits of the last two days.
|
||||
$table = modules_get_table_data($id_agent_module);
|
||||
$table = modules_get_table_data($id_agent_module, null);
|
||||
$data = db_get_all_rows_sql(
|
||||
'SELECT min(datos) as min, max(datos) as max
|
||||
FROM '.$table.'
|
||||
|
|
|
@ -5448,6 +5448,10 @@ function ui_print_agent_autocomplete_input($parameters)
|
|||
'q' => 'term',
|
||||
];
|
||||
|
||||
if (isset($parameters['delete_offspring_agents']) === true) {
|
||||
$javascript_change_ajax_params_original['delete_offspring_agents'] = $parameters['delete_offspring_agents'];
|
||||
}
|
||||
|
||||
if (!$metaconsole_enabled) {
|
||||
$javascript_change_ajax_params_original['force_local'] = 1;
|
||||
}
|
||||
|
|
|
@ -849,7 +849,8 @@ function add_macro_field(macro, row_model_id, type_copy, k) {
|
|||
$macro_field
|
||||
.find("input")
|
||||
.first()
|
||||
.attr("name", macro_macro);
|
||||
.attr("name", macro_macro)
|
||||
.val(macro_value);
|
||||
|
||||
$macro_field.attr("class", "macro_field");
|
||||
|
||||
|
|
|
@ -5,18 +5,18 @@
|
|||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.agents_modules_table .next_previous_step {
|
||||
.next_previous_step {
|
||||
width: 0.1%;
|
||||
}
|
||||
|
||||
.agents_modules_table .header_table_principal_cell {
|
||||
text-align: right !important;
|
||||
.header_table_principal_cell {
|
||||
text-align: left !important;
|
||||
padding-right: 13px;
|
||||
width: 20%;
|
||||
width: 5%;
|
||||
}
|
||||
|
||||
.agents_modules_table .header_table_caption_cell {
|
||||
height: 200px;
|
||||
.header_table_caption_cell {
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.agents_modules_table .position_text_module {
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
<div style='height: 10px'>
|
||||
<?php
|
||||
$version = '7.0NG.762';
|
||||
$build = '220608';
|
||||
$build = '220613';
|
||||
$banner = "v$version Build $build";
|
||||
|
||||
error_reporting(0);
|
||||
|
|
|
@ -249,26 +249,21 @@ echo '<form method="post" action="?sec=view&sec2=operation/agentes/estado_agente
|
|||
|
||||
echo '<table cellpadding="4" cellspacing="4" class="databox filters bolder mrgn_btn_10px" width="100%">';
|
||||
|
||||
echo '<tr><td class="nowrap mw180px padding-right-2-imp">';
|
||||
echo '<tr><td class="nowrap w100px padding-right-2-imp">';
|
||||
|
||||
echo __('Group').' ';
|
||||
echo __('Group').' '.' '.' ';
|
||||
|
||||
$groups = users_get_groups(false, $access);
|
||||
|
||||
html_print_select_groups(false, $access, true, 'group_id', $group_id, 'this.form.submit()', '', '', false, false, true, '', false);
|
||||
|
||||
echo '</td><td class="nowrap">';
|
||||
echo '</td><td class="nowrap">'.' '.' '.' '.' '.' ';
|
||||
|
||||
echo __('Recursion').' ';
|
||||
echo __('Recursion').' '.' '.' ';
|
||||
html_print_checkbox('recursion', 1, $recursion, false, false, 'this.form.submit()');
|
||||
|
||||
echo '</td><td class="nowrap">';
|
||||
|
||||
echo __('Search').' ';
|
||||
html_print_input_text('search', $search, '', 15);
|
||||
|
||||
echo '</td><td class="nowrap">';
|
||||
|
||||
$fields = [];
|
||||
$fields[AGENT_STATUS_NORMAL] = __('Normal');
|
||||
$fields[AGENT_STATUS_WARNING] = __('Warning');
|
||||
|
@ -277,12 +272,17 @@ $fields[AGENT_STATUS_UNKNOWN] = __('Unknown');
|
|||
$fields[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
|
||||
$fields[AGENT_STATUS_NOT_INIT] = __('Not init');
|
||||
|
||||
echo __('Status').' ';
|
||||
echo __('Status').' '.' '.' ';
|
||||
html_print_select($fields, 'status', $status, 'this.form.submit()', __('All'), AGENT_STATUS_ALL, false, false, true, '', false, 'width: 90px;');
|
||||
|
||||
echo '</td><td class="nowrap">';
|
||||
echo '</td><td class="nowrap w100px">';
|
||||
|
||||
echo __('Search in custom fields').' ';
|
||||
echo __('Search').' '.' '.' ';
|
||||
html_print_input_text('search', $search, '', 15);
|
||||
|
||||
echo '</td><td class="nowrap w100px">';
|
||||
|
||||
echo __('Search in custom fields').' '.' '.' ';
|
||||
html_print_input_text('search_custom', $search_custom, '', 15);
|
||||
|
||||
echo '</td><td class="nowrap">';
|
||||
|
|
|
@ -697,6 +697,15 @@ if (is_ajax()) {
|
|||
asort($result);
|
||||
} else {
|
||||
if ($idAgents[0] < 0) {
|
||||
// Get all user's groups.
|
||||
$id_group = array_keys(users_get_groups($config['id_user']));
|
||||
|
||||
if (is_array($id_group)) {
|
||||
$id_group = implode(',', $id_group);
|
||||
}
|
||||
|
||||
$where_tags .= ' AND tagente.id_grupo IN ('.$id_group.')';
|
||||
|
||||
if ($selection_mode == 'common') {
|
||||
$sql_agent_total = 'SELECT count(*) FROM tagente WHERE disabled=0';
|
||||
$agent_total = db_get_value_sql($sql_agent_total);
|
||||
|
@ -705,13 +714,13 @@ if (is_ajax()) {
|
|||
JOIN (SELECT COUNT(*) AS num_names, nombre FROM tagente_modulo
|
||||
WHERE disabled=0 AND delete_pending=0 GROUP BY nombre) AS tj
|
||||
ON tj.num_names = $agent_total AND tj.nombre = t1.nombre %s %s",
|
||||
$sql_tags_join,
|
||||
($sql_tags_join === '') ? 'INNER JOIN tagente ON tagente.id_agente = t1.id_agente' : '',
|
||||
(empty($where_tags)) ? '' : " WHERE 1=1 $where_tags"
|
||||
);
|
||||
} else {
|
||||
$sql = sprintf(
|
||||
'SELECT t1.nombre, t1.id_agente_modulo FROM tagente_modulo t1 %s %s',
|
||||
$sql_tags_join,
|
||||
($sql_tags_join === '') ? 'INNER JOIN tagente ON tagente.id_agente = t1.id_agente' : '',
|
||||
(empty($where_tags)) ? '' : " WHERE 1=1 $where_tags"
|
||||
);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.762
|
||||
%define release 220608
|
||||
%define release 220613
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.762
|
||||
%define release 220608
|
||||
%define release 220613
|
||||
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name httpd
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_console
|
||||
%define version 7.0NG.762
|
||||
%define release 220608
|
||||
%define release 220613
|
||||
%define httpd_name httpd
|
||||
# User and Group under which Apache is running
|
||||
%define httpd_name apache2
|
||||
|
|
|
@ -2077,7 +2077,8 @@ class Client
|
|||
'status' => $status,
|
||||
'message' => $msg,
|
||||
'extra' => $extra,
|
||||
]
|
||||
],
|
||||
JSON_UNESCAPED_UNICODE
|
||||
);
|
||||
|
||||
if ($field_exists === false) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-server
|
||||
Version: 7.0NG.762-220608
|
||||
Version: 7.0NG.762-220613
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.762-220608"
|
||||
pandora_version="7.0NG.762-220613"
|
||||
|
||||
package_cpan=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -46,7 +46,7 @@ our @EXPORT = qw(
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.762";
|
||||
my $pandora_build = "220608";
|
||||
my $pandora_build = "220613";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
# Setup hash
|
||||
|
|
|
@ -34,7 +34,7 @@ our @ISA = qw(Exporter);
|
|||
|
||||
# version: Defines actual version of Pandora Server for this module only
|
||||
my $pandora_version = "7.0NG.762";
|
||||
my $pandora_build = "220608";
|
||||
my $pandora_build = "220613";
|
||||
our $VERSION = $pandora_version." ".$pandora_build;
|
||||
|
||||
our %EXPORT_TAGS = ( 'all' => [ qw() ] );
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.762
|
||||
%define release 220608
|
||||
%define release 220613
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#
|
||||
%define name pandorafms_server
|
||||
%define version 7.0NG.762
|
||||
%define release 220608
|
||||
%define release 220613
|
||||
|
||||
Summary: Pandora FMS Server
|
||||
Name: %{name}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.762"
|
||||
PI_BUILD="220608"
|
||||
PI_BUILD="220613"
|
||||
|
||||
MODE=$1
|
||||
if [ $# -gt 1 ]; then
|
||||
|
|
|
@ -35,7 +35,7 @@ use PandoraFMS::Config;
|
|||
use PandoraFMS::DB;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.762 Build 220608";
|
||||
my $version = "7.0NG.762 Build 220613";
|
||||
|
||||
# Pandora server configuration
|
||||
my %conf;
|
||||
|
|
|
@ -36,7 +36,7 @@ use Encode::Locale;
|
|||
Encode::Locale::decode_argv;
|
||||
|
||||
# version: define current version
|
||||
my $version = "7.0NG.762 Build 220608";
|
||||
my $version = "7.0NG.762 Build 220613";
|
||||
|
||||
# save program name for logging
|
||||
my $progname = basename($0);
|
||||
|
|
Loading…
Reference in New Issue