#8898 conflict resolved

This commit is contained in:
Daniel Maya 2022-08-29 14:06:15 +02:00
commit d3612439fb
87 changed files with 147874 additions and 99536 deletions

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, AIX version
# Version 7.0NG.764, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, FreeBSD Version
# Version 7.0NG.764, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, HP-UX Version
# Version 7.0NG.764, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, GNU/Linux
# Version 7.0NG.764, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, GNU/Linux
# Version 7.0NG.764, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, Solaris Version
# Version 7.0NG.764, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.763
# Version 7.0NG.764
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.763, AIX version
# Version 7.0NG.764, AIX version
# General Parameters
# ==================

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.763
# Version 7.0NG.764
# FreeBSD/IPSO version
# Licenced under GPL licence, 2003-2007 Sancho Lerena

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.763, HPUX Version
# Version 7.0NG.764, HPUX Version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763
# Version 7.0NG.764
# Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763
# Version 7.0NG.764
# Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas
# please visit http://pandora.sourceforge.net

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763
# Version 7.0NG.764
# Licensed under GPL license v2,
# please visit http://pandora.sourceforge.net

View File

@ -1,6 +1,6 @@
# Fichero de configuracion base de agentes de Pandora
# Base config file for Pandora agents
# Version 7.0NG.763, Solaris version
# Version 7.0NG.764, Solaris version
# General Parameters
# ==================

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, AIX version
# Version 7.0NG.764, AIX version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.763-220810
Version: 7.0NG.764-220829
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.763-220810"
pandora_version="7.0NG.764-220829"
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

@ -31,7 +31,7 @@ fi
if [ "$#" -ge 2 ]; then
VERSION="$2"
else
VERSION="7.0NG.763"
VERSION="7.0NG.764"
fi
# Path for the generated DMG file

View File

@ -19,11 +19,11 @@
<choice id="com.pandorafms.pandorafms_src" visible="false">
<pkg-ref id="com.pandorafms.pandorafms_src"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.763" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_src" version="7.0NG.764" onConclusion="none">pandorafms_src.pdk</pkg-ref>
<choice id="com.pandorafms.pandorafms_uninstall" visible="true" customLocation="/Applications">
<pkg-ref id="com.pandorafms.pandorafms_uninstall"/>
</choice>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.763" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<pkg-ref id="com.pandorafms.pandorafms_uninstall" version="7.0NG.764" onConclusion="none">pandorafms_uninstall.pdk</pkg-ref>
<!-- <installation-check script="check()" />
<script>
<![CDATA[

View File

@ -5,9 +5,9 @@
<key>CFBundleIconFile</key> <string>pandorafms.icns</string>
<key>CFBundleIdentifier</key> <string>com.pandorafms.pandorafms_uninstall</string>
<key>CFBundleVersion</key> <string>7.0NG.763</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.763 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.763</string>
<key>CFBundleVersion</key> <string>7.0NG.764</string>
<key>CFBundleGetInfoString</key> <string>7.0NG.764 Pandora FMS Agent uninstaller for MacOS by Artica ST on Aug 2020</string>
<key>CFBundleShortVersionString</key> <string>7.0NG.764</string>
<key>NSPrincipalClass</key><string>NSApplication</string>
<key>NSMainNibFile</key><string>MainMenu</string>

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, GNU/Linux
# Version 7.0NG.764, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, FreeBSD Version
# Version 7.0NG.764, FreeBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, HP-UX Version
# Version 7.0NG.764, HP-UX Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, GNU/Linux
# Version 7.0NG.764, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, GNU/Linux
# Version 7.0NG.764, GNU/Linux
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, NetBSD Version
# Version 7.0NG.764, NetBSD Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1,5 +1,5 @@
# Base config file for Pandora FMS agents
# Version 7.0NG.763, Solaris Version
# Version 7.0NG.764, Solaris Version
# Licensed under GPL license v2,
# Copyright (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -1014,8 +1014,8 @@ my $Sem = undef;
# Semaphore used to control the number of threads
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.763';
use constant AGENT_BUILD => '220810';
use constant AGENT_VERSION => '7.0NG.764';
use constant AGENT_BUILD => '220829';
# Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.763
%define release 220810
%define version 7.0NG.764
%define release 220829
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -2,8 +2,8 @@
#Pandora FMS Linux Agent
#
%define name pandorafms_agent_unix
%define version 7.0NG.763
%define release 220810
%define version 7.0NG.764
%define release 220829
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -9,8 +9,8 @@
# Please see http://www.pandorafms.org. This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.763"
PI_BUILD="220810"
PI_VERSION="7.0NG.764"
PI_BUILD="220829"
OS_NAME=`uname -s`
FORCE=0

View File

@ -1,6 +1,6 @@
# Base config file for Pandora FMS Windows Agent
# (c) 2006-2021 Artica Soluciones Tecnologicas
# Version 7.0NG.763
# Version 7.0NG.764
# This program is Free Software, you can redistribute it and/or modify it
# under the terms of the GNU General Public Licence as published by the Free Software
# Foundation; either version 2 of the Licence or any later version

View File

@ -3,7 +3,7 @@ AllowLanguageSelection
{Yes}
AppName
{Pandora FMS Windows Agent v7.0NG.763}
{Pandora FMS Windows Agent v7.0NG.764}
ApplicationID
{17E3D2CF-CA02-406B-8A80-9D31C17BD08F}
@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{220810}
{220829}
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.763 Build 220810")
#define PANDORA_VERSION ("7.0NG.764 Build 220829")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.763(Build 220810))"
VALUE "ProductVersion", "(7.0NG.764(Build 220829))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

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

View File

@ -43,20 +43,11 @@ function dbmanager_query($sql, &$error, $dbconnection)
$error = mysqli_error($dbconnection);
return false;
}
} else {
$result = mysql_query($sql, $dbconnection);
if ($result === false) {
$backtrace = debug_backtrace();
$error = mysql_error();
return false;
}
}
if ($result === true) {
if ($config['mysqli']) {
return mysqli_affected_rows($dbconnection);
} else {
return mysql_affected_rows();
}
}
@ -64,23 +55,17 @@ function dbmanager_query($sql, &$error, $dbconnection)
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
array_push($retval, $row);
}
} else {
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
array_push($retval, $row);
}
}
if ($config['mysqli']) {
mysqli_free_result($result);
} else {
mysql_free_result($result);
}
if (! empty($retval)) {
return $retval;
}
// Return false, check with === or !==
// Return false, check with === or !== .
return 'Empty';
}
@ -171,20 +156,6 @@ function dbmgr_extension_main()
$data[1][0] = "Some samples of usage: <blockquote><em>SHOW STATUS;<br />DESCRIBE tagente<br />SELECT * FROM tserver<br />UPDATE tagente SET id_grupo = 15 WHERE nombre LIKE '%194.179%'</em></blockquote>";
\enterprise_include_once('include/functions_metaconsole.php');
$servers = \metaconsole_get_servers();
if (is_array($servers) === true) {
$servers = array_reduce(
$servers,
function ($carry, $item) {
$carry[$item['id']] = $item['server_name'];
return $carry;
}
);
} else {
$servers = [];
}
$data[2][0] = html_print_textarea(
'sql',
5,
@ -195,6 +166,21 @@ function dbmgr_extension_main()
);
if (is_metaconsole() === true) {
// Get the servers.
\enterprise_include_once('include/functions_metaconsole.php');
$servers = \metaconsole_get_servers();
if (is_array($servers) === true) {
$servers = array_reduce(
$servers,
function ($carry, $item) {
$carry[$item['id']] = $item['server_name'];
return $carry;
}
);
} else {
$servers = [];
}
$data[3][2] = html_print_input(
[
'name' => 'node_id',
@ -223,7 +209,7 @@ function dbmgr_extension_main()
html_print_table($table);
echo '</form>';
// Processing SQL Code
// Processing SQL Code.
if ($sql == '') {
return;
}
@ -271,7 +257,7 @@ function dbmgr_extension_main()
return;
}
if (! is_array($result)) {
if (is_array($result) === false) {
echo '<strong>Output: <strong>'.$result;
db_pandora_audit(
@ -315,11 +301,10 @@ if (is_metaconsole() === true) {
);
extensions_add_meta_function('dbmgr_extension_main');
} else {
}
// This adds a option in the operation menu
// This adds a option in the operation menu.
extensions_add_godmode_menu_option(__('DB interface'), 'PM', 'gextensions', 'dbmanager/icon.png', 'v1r1', 'gdbman');
// This sets the function to be called when the extension is selected in the operation menu
// This sets the function to be called when the extension is selected in the operation menu.
extensions_add_godmode_function('dbmgr_extension_main');

View File

@ -38,6 +38,8 @@ ALTER TABLE `tautoconfig` ADD COLUMN `executed` TINYINT UNSIGNED NOT NULL DEFAUL
ALTER TABLE `tusuario` DROP COLUMN `metaconsole_assigned_server`;
ALTER TABLE `tagente` ADD COLUMN `fixed_ip` TINYINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tmetaconsole_agent` ADD COLUMN `fixed_ip` TINYINT UNSIGNED NOT NULL DEFAULT 0;
ALTER TABLE `tipam_network` DROP FOREIGN KEY `tipam_network_ibfk_1`;
ALTER TABLE `tipam_network` MODIFY COLUMN `id_recon_task` INT UNSIGNED DEFAULT 0;
ALTER TABLE `tipam_network` ADD CONSTRAINT `tipam_network_ibfk_1` FOREIGN KEY (`id_recon_task`) REFERENCES trecon_task(`id_rt`) ON DELETE SET NULL ON UPDATE CASCADE;

View File

@ -2,4 +2,7 @@ START TRANSACTION;
ALTER TABLE `tmap` ADD COLUMN `refresh_time` INT UNSIGNED NOT NULL DEFAULT 0;
SET @id_config := (SELECT id_config FROM tconfig WHERE `token` = 'metaconsole_node_id' AND `value` IS NOT NULL ORDER BY id_config DESC LIMIT 1);
DELETE FROM tconfig WHERE `token` = 'metaconsole_node_id' AND (id_config < @id_config OR `value` IS NULL);
COMMIT;

View File

@ -302,6 +302,15 @@ $table_ip = '<div class="label_select"><p class="input_label">'.__('IP Address')
$table_ip .= '<div class="label_select_parent">';
$table_ip .= '<div class="label_select_child_left">'.html_print_input_text('direccion', $direccion_agente, '', 16, 100, true).'</div>';
$table_ip .= '<div class="label_select_child_right">'.html_print_checkbox_switch('unique_ip', 1, $config['unique_ip'], true).__('Unique IP').'</div>';
$table_ip .= '<div class="label_select_child_right">'.html_print_input(
[
'type' => 'switch',
'id' => 'fixed_ip',
'name' => 'fixed_ip',
'value' => $fixed_ip,
]
).__('Fix IP address').ui_print_help_tip(__('Avoid automatic IP address update when agent IP changes.'), true).'</div>';
$table_ip .= '</div></div>';
if ($id_agente) {
@ -1114,5 +1123,19 @@ ui_require_jquery_file('bgiframe');
}
$("#text-agente").prop('readonly', true);
// Disable fixed ip button if empty.
if($("#text-direccion").val() == '') {
$("#fixed_ip").prop('disabled',true);
}
$("#text-direccion").on('input',function(e){
if($("#text-direccion").val() == '') {
$("#fixed_ip").prop('disabled',true);
} else {
$("#fixed_ip").prop('disabled',false);
}
});
});
</script>

View File

@ -173,6 +173,7 @@ $url_description = '';
$quiet = 0;
$macros = '';
$cps = 0;
$fixed_ip = 0;
$create_agent = (bool) get_parameter('create_agent');
$module_macros = [];
@ -225,6 +226,7 @@ if ($create_agent) {
$url_description = (string) get_parameter('url_description');
$quiet = (int) get_parameter('quiet', 0);
$cps = (int) get_parameter_switch('cps', -1);
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
$secondary_groups = (string) get_parameter('secondary_hidden', '');
$fields = db_get_all_fields_in_table('tagent_custom_fields');
@ -282,6 +284,7 @@ if ($create_agent) {
'url_address' => $url_description,
'quiet' => $quiet,
'cps' => $cps,
'fixed_ip' => $fixed_ip,
]
);
enterprise_hook('update_agent', [$id_agente]);
@ -326,7 +329,7 @@ if ($create_agent) {
"Update GIS data":"'.$update_gis_data.'",
"Url description":"'.$url_description.'",
"Quiet":"'.(int) $quiet.'",
"Cps":"'.(int) $cps.'"}';
"Cps":"'.(int) $cps.'",}';
// Create the secondary groups.
enterprise_hook(
@ -987,6 +990,7 @@ if ($update_agent) {
$fields = db_get_all_fields_in_table('tagent_custom_fields');
$secondary_groups = (string) get_parameter('secondary_hidden', '');
$satellite_server = (int) get_parameter('satellite_server', 0);
$fixed_ip = (int) get_parameter_switch('fixed_ip', 0);
if ($fields === false) {
$fields = [];
@ -1095,6 +1099,7 @@ if ($update_agent) {
'cps' => $cps,
'safe_mode_module' => $safe_mode_module,
'satellite_server' => $satellite_server,
'fixed_ip' => $fixed_ip,
];
if ($config['metaconsole_agent_cache'] == 1) {
@ -1234,6 +1239,7 @@ if ($id_agente) {
$safe_mode_module = $agent['safe_mode_module'];
$safe_mode = ($safe_mode_module) ? 1 : 0;
$satellite_server = (int) $agent['satellite_server'];
$fixed_ip = (int) $agent['fixed_ip'];
}
$update_module = (bool) get_parameter('update_module');

View File

@ -797,13 +797,29 @@ $table = new StdClass();
$table->class = 'databox filters';
$table->width = '100%';
$table->data = [];
$table->size[0] = '25%';
$table->data[0][0] = __('Group filter');
$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][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').'&nbsp&nbsp'.html_print_checkbox('recursion', 1, $recursion, true, false, '');
$table->data[1][0] = __('Available agents');
$table->data[1][1] = html_print_select($agents, 'id_agents[]', -1, '', _('Any'), -2, true, true, true, '', false, 'width: 180px;');
$table->data[1][1] = html_print_select($agents, 'id_agents[]', -1, '', _('Any'), -2, true, true, true, '', false, 'min-width: 250px;width: 70%;');
if ($type_downtime != 'quiet') {
@ -855,7 +871,7 @@ $table->data[3][1] = html_print_select(
true,
'',
false,
'width: 180px;'
'min-width: 250px;width: 70%;'
);
echo '</div>';

View File

@ -169,154 +169,6 @@ if ($delete === true) {
}
}
$table = new stdClass;
$table->id = 'delete_table';
$table->class = 'databox filters';
$table->width = '100%';
$table->data = [];
$table->style = [];
$table->style[0] = 'font-weight: bold;';
$table->style[2] = 'font-weight: bold';
$table->size = [];
$table->size[0] = '15%';
$table->size[1] = '35%';
$table->size[2] = '15%';
$table->size[3] = '35%';
$table->data = [];
$table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups(
false,
'AW',
true,
'id_group',
$id_group,
false,
'',
'',
true
);
$table->data[0][2] = __('Group recursion');
$table->data[0][3] = html_print_checkbox(
'recursion',
1,
$recursion,
true,
false
);
$status_list = [];
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data[1][0] = __('Status');
$table->data[1][1] = html_print_select(
$status_list,
'status_agents',
'selected',
'',
__('All'),
AGENT_STATUS_ALL,
true
);
$table->data[1][2] = __('Show agents');
$table->data[1][3] = html_print_select(
[
0 => 'Only enabled',
1 => 'Only disabled',
],
'disabled',
2,
'',
__('All'),
2,
true,
false,
true,
'',
false,
'width:30%;'
);
if (is_metaconsole() === true) {
$servers = metaconsole_get_servers();
$server_fields = [];
foreach ($servers as $key => $server) {
$server_fields[$key] = $server['server_name'];
}
$table->data[2][2] = __('Node');
$table->data[2][3] = html_print_select(
$server_fields,
'nodes[]',
0,
false,
'',
'',
true,
true,
true,
'',
false,
'min-width: 500px; max-width: 500px; max-height: 100px',
false,
false,
false,
'',
false,
false,
false,
false,
true,
true,
true
);
}
$table->data[3][0] = __('Agents');
$table->data[3][0] .= '<span id="agent_loading" class="invisible">';
$table->data[3][0] .= html_print_image('images/spinner.png', true);
$table->data[3][0] .= '</span>';
$agents = [];
if (is_metaconsole() === false) {
$agents = agents_get_group_agents(
array_keys(users_get_groups($config['id_user'], 'AW', false)),
['disabled' => 2],
'none'
);
}
$table->data[3][1] = html_print_select(
$agents,
'id_agents[]',
0,
false,
'',
'',
true,
true,
true,
'',
false,
'min-width: 500px; max-width: 500px; max-height: 100px',
false,
false,
false,
'',
false,
false,
false,
false,
true,
true,
true
);
$url = 'index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_agents';
if (is_metaconsole() === true) {
@ -324,10 +176,15 @@ if (is_metaconsole() === true) {
}
echo '<form method="post" id="form_agent" action="'.$url.'">';
html_print_table($table);
$params = [
'id_group' => $id_group,
'recursion' => $recursion,
];
echo get_table_inputs_masive_agents($params);
if (is_metaconsole() === true || is_management_allowed() === true) {
attachActionButton('delete', 'delete', $table->width);
attachActionButton('delete', 'delete', '100%');
}
echo '</form>';
@ -342,54 +199,6 @@ ui_require_jquery_file('pandora.controls');
$(document).ready (function () {
// Check Metaconsole.
var metaconsole = '<?php echo (is_metaconsole() === true) ? 1 : 0; ?>';
// Listeners.
var recursion;
$("#checkbox-recursion").click(function () {
recursion = this.checked ? 1 : 0;
$("#id_group").trigger("change");
});
var disabled;
$("#disabled").change(function () {
disabled = this.value;
$("#id_group").trigger("change");
});
var nodes;
$("#nodes").change(function () {
nodes = $("#nodes").val();
$("#id_group").trigger("change");
});
$("#status_agents").change(function() {
$("#id_group").trigger("change");
});
// Build data.
var data = {
status_agents: function () {
return $("#status_agents").val();
},
agentSelect: "select#id_agents",
privilege: "AW",
recursion: function() {
return recursion;
},
disabled: function() {
return disabled;
},
}
if (metaconsole == 1) {
data.serialized = true;
data.serialized_separator = '|';
data.nodes = function() {
return nodes;
};
}
// Change agents.
$("#id_group").pandoraSelectGroupAgent(data);
form_controls_massive_operations_agents(metaconsole);
});
</script>

File diff suppressed because it is too large Load Diff

View File

@ -68,11 +68,6 @@ $options_agents = [
'edit_agents' => __('Bulk agent edit'),
'delete_agents' => __('Bulk agent delete'),
];
if (is_metaconsole() === true) {
$options_agents = [
'delete_agents' => __('Bulk agent delete'),
];
}
if (check_acl($config['id_user'], 0, 'UM')) {
$options_users = [

View File

@ -111,6 +111,9 @@ if ($access_console_node === true) {
$sub['godmode/groups/modu_group_list']['text'] = __('Module groups');
$sub['godmode/groups/modu_group_list']['id'] = 'Module groups';
$sub['godmode/setup/os']['text'] = __('Operating systems');
$sub['godmode/setup/os']['id'] = 'Edit OS';
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
@ -380,8 +383,6 @@ if ($access_console_node === true) {
}
$sub['general']['sub2'] = $sub2;
$sub['godmode/setup/os']['text'] = __('Edit OS');
$sub['godmode/setup/os']['id'] = 'Edit OS';
$sub['godmode/setup/license']['text'] = __('License');
$sub['godmode/setup/license']['id'] = 'License';

View File

@ -833,23 +833,21 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
var added_config = {
"selector": "#tinyMCE_editor",
"elements": "text-label",
"elements": "tinyMCE_editor",
"plugins": "noneditable",
"theme_advanced_buttons1":
"bold,italic,|,justifyleft,justifycenter,justifyright,|,undo,redo,|,image,link,|,fontselect,|,forecolor,fontsizeselect,|,code",
"theme_advanced_buttons1": "bold,italic,|,justifyleft,justifycenter,justifyright,|,undo,redo,|,image,link,|,fontselect,|,forecolor,fontsizeselect,|,code",
"valid_children": "+body[style]",
"theme_advanced_font_sizes": "true",
"content_css":
<?php echo '"'.ui_get_full_url('include/styles/pandora.css', false, false, false).'"'; ?>,
"content_css": <?php echo '"'.ui_get_full_url('include/styles/pandora.css', false, false, false).'"'; ?>,
"editor_deselector": "noselected",
"inline_styles": true,
"nowrap": true,
"width": "400",
"height": "200",
}
defineTinyMCE(added_config);
"body_class": "tinyMCEBody",
}
defineTinyMCE(added_config);
$("#dialog_label_editor").hide ()
.dialog ({
title: "<?php echo __('Edit label'); ?>",
@ -860,38 +858,33 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
opacity: 0.5,
background: "black"
},
width: 450,
width: 530,
height: 300,
autoOpen: false,
beforeClose: function() {
var id_layout_data = $("#active_id_layout_data").val();
var label = tinyMCE.activeEditor.getContent();
$("#hidden-label_" + id_layout_data).val(label);
}
});
});
var idText = $("#ip_text").html();
});
var idText = $("#ip_text").html();
function show_dialog_label_editor(id_layout_data) {
var label = $("#hidden-label_" + id_layout_data).val();
$("#active_id_layout_data").val(id_layout_data);
$("#tinyMCE_editor").val(label);
tinyMCE.activeEditor.setContent(label);
$("#dialog_label_editor").dialog("open");
}
function toggle_checkbox_multiple_delete() {
checked_head_multiple = $("input[name='head_multiple_delete']")
.is(":checked");
$("input[name='multiple_delete_items']")
.prop("checked", checked_head_multiple);
}
function submit_delete_multiple_items() {
delete_items = [];
jQuery.each($("input[name='multiple_delete_items']:checked"),
@ -899,8 +892,7 @@ ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
delete_items.push($(item).val());
}
);
$("input[name='id_item_json']").val(JSON.stringify(delete_items));
$("#form_multiple_delete").submit();
}

View File

@ -208,7 +208,7 @@ if ($is_management_allowed === true) {
$buttons[$tab]['active'] = true;
$headerTitle = ($tab === 'builder') ? __('Edit OS') : __('List of OS');
$headerTitle = ($tab === 'builder') ? __('Edit OS') : __('List of Operating Systems');
if (is_metaconsole() === false) {
// Header.

View File

@ -324,7 +324,7 @@ switch ($section) {
}
// Put header inside div for special sizing.(No right margin).
echo '<div id="header_configuration" style="width: calc(100% + 3em);">';
echo '<div id="header_configuration" style="width: calc(100%);">';
// Header.
ui_print_page_header(
__('Configuration').$subpage,

View File

@ -777,7 +777,7 @@ if ($save_filter_modal) {
$data[1] .= html_print_select(
$user_groups_array,
'id_group_filter',
'id_group_filter_dialog',
$id_group_filter,
'',
'',
@ -884,7 +884,7 @@ function save_new_filter() {
"page" : "include/ajax/events",
"save_event_filter" : 1,
"id_name" : $("#text-id_name").val(),
"id_group" : $("select#id_group").val(),
"id_group" : $("#id_group_filter").val(),
"event_type" : $("#event_type").val(),
"severity" : $("#severity").val(),
"status" : $("#status").val(),
@ -900,7 +900,7 @@ function save_new_filter() {
"tag_without": Base64.decode($("#hidden-tag_without").val()),
"filter_only_alert" : $("#filter_only_alert").val(),
"search_secondary_groups" : $("#checkbox-search_secondary_groups").val(),
"id_group_filter": $("#id_group_filter").val(),
"id_group_filter": $("#id_group_filter_dialog").val(),
"date_from": $("#text-date_from").val(),
"time_from": $("#text-time_from").val(),
"date_to": $("#text-date_to").val(),
@ -960,7 +960,7 @@ function save_update_filter() {
{"page" : "include/ajax/events",
"update_event_filter" : 1,
"id" : $("#overwrite_filter").val(),
"id_group" : $("select#id_group").val(),
"id_group" : $("#id_group_filter").val(),
"event_type" : $("#event_type").val(),
"severity" : $("#severity").val(),
"status" : $("#status").val(),
@ -976,7 +976,7 @@ function save_update_filter() {
"tag_without" : Base64.decode($("#hidden-tag_without").val()),
"filter_only_alert" : $("#filter_only_alert").val(),
"search_secondary_groups" : $("#checkbox-search_secondary_groups").val(),
"id_group_filter": $("#id_group_filter").val(),
"id_group_filter": $("#id_group_filter_dialog").val(),
"date_from": $("#text-date_from").val(),
"time_from": $("#text-time_from").val(),
"date_to": $("#text-date_to").val(),

View File

@ -20,8 +20,8 @@
/**
* Pandora build version and version
*/
$build_version = 'PC220810';
$pandora_version = 'v7.0NG.763';
$build_version = 'PC220829';
$pandora_version = 'v7.0NG.764';
// Do not overwrite default timezone set if defined.
$script_tz = @date_default_timezone_get();

View File

@ -1279,7 +1279,8 @@ function events_get_all(
// Table tag for id_grupo.
'te.',
// Alt table tag for id_grupo.
$user_admin_group_all
$user_admin_group_all,
(bool) $filter['search_secondary_groups']
);
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
} else if (check_acl($config['id_user'], 0, 'EW')) {
@ -1305,7 +1306,8 @@ function events_get_all(
// Table tag for id_grupo.
'te.',
// Alt table tag for id_grupo.
$user_admin_group_all
$user_admin_group_all,
(bool) $filter['search_secondary_groups']
);
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
} else if (check_acl($config['id_user'], 0, 'EM')) {
@ -1331,7 +1333,8 @@ function events_get_all(
// Table tag for id_grupo.
'te.',
// Alt table tag for id_grupo.
$user_admin_group_all
$user_admin_group_all,
(bool) $filter['search_secondary_groups']
);
// FORCE CHECK SQL "(TAG = tag1 AND id_grupo = 1)".
}

View File

@ -95,3 +95,168 @@ function attachActionButton(
$return
);
}
/**
* Get table inputs for massive operation agents edit and delete.
*
* @param array $params Params.
*
* @return string Output.
*/
function get_table_inputs_masive_agents($params)
{
global $config;
$table = new stdClass;
$table->id = 'delete_table';
$table->class = 'databox filters';
$table->width = '100%';
$table->data = [];
$table->style = [];
$table->style[0] = 'font-weight: bold;';
$table->style[2] = 'font-weight: bold';
$table->size = [];
$table->size[0] = '15%';
$table->size[1] = '35%';
$table->size[2] = '15%';
$table->size[3] = '35%';
$table->data = [];
$table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups(
false,
'AW',
true,
'id_group',
$params['id_group'],
false,
'',
'',
true
);
$table->data[0][2] = __('Group recursion');
$table->data[0][3] = html_print_checkbox(
'recursion',
1,
$params['recursion'],
true,
false
);
$status_list = [];
$status_list[AGENT_STATUS_NORMAL] = __('Normal');
$status_list[AGENT_STATUS_WARNING] = __('Warning');
$status_list[AGENT_STATUS_CRITICAL] = __('Critical');
$status_list[AGENT_STATUS_UNKNOWN] = __('Unknown');
$status_list[AGENT_STATUS_NOT_NORMAL] = __('Not normal');
$status_list[AGENT_STATUS_NOT_INIT] = __('Not init');
$table->data[1][0] = __('Status');
$table->data[1][1] = html_print_select(
$status_list,
'status_agents',
'selected',
'',
__('All'),
AGENT_STATUS_ALL,
true
);
$table->data[1][2] = __('Show agents');
$table->data[1][3] = html_print_select(
[
0 => 'Only enabled',
1 => 'Only disabled',
],
'disabled',
2,
'',
__('All'),
2,
true,
false,
true,
'',
false,
'width:30%;'
);
if (is_metaconsole() === true) {
$servers = metaconsole_get_servers();
$server_fields = [];
foreach ($servers as $key => $server) {
$server_fields[$key] = $server['server_name'];
}
$table->data[2][2] = __('Node');
$table->data[2][3] = html_print_select(
$server_fields,
'nodes[]',
0,
false,
'',
'',
true,
true,
true,
'',
false,
'min-width: 500px; max-width: 500px; max-height: 100px',
false,
false,
false,
'',
false,
false,
false,
false,
true,
true,
true
);
}
$table->data[3][0] = __('Agents');
$table->data[3][0] .= '<span id="agent_loading" class="invisible">';
$table->data[3][0] .= html_print_image('images/spinner.png', true);
$table->data[3][0] .= '</span>';
$agents = [];
if (is_metaconsole() === false) {
$agents = agents_get_group_agents(
array_keys(users_get_groups($config['id_user'], 'AW', false)),
['disabled' => 2],
'none'
);
}
$table->data[3][1] = html_print_select(
$agents,
'id_agents[]',
0,
false,
'',
'',
true,
true,
true,
'',
false,
'min-width: 500px; max-width: 500px; max-height: 100px',
false,
false,
false,
'',
false,
false,
false,
false,
true,
true,
true
);
$output = html_print_table($table, true);
return $output;
}

View File

@ -751,7 +751,8 @@ function tags_get_acl_tags(
$childrens_ids=[],
$force_group_and_tag=false,
$id_grupo_table_pretag='',
$alt_id_grupo_table_pretag=''
$alt_id_grupo_table_pretag='',
$search_secondary_group=true
) {
global $config;
@ -831,7 +832,8 @@ function tags_get_acl_tags(
$force_group_and_tag,
false,
$id_grupo_table_pretag,
$alt_id_grupo_table_pretag
$alt_id_grupo_table_pretag,
$search_secondary_group
);
if (!empty($condition)) {
@ -933,7 +935,8 @@ function tags_get_acl_tags_event_condition(
$force_group_and_tag=false,
$force_equal=false,
$id_grupo_table_pretag='',
$alt_id_grupo_table_pretag=''
$alt_id_grupo_table_pretag='',
$search_secondary_group=true
) {
global $config;
$condition = [];
@ -951,7 +954,13 @@ function tags_get_acl_tags_event_condition(
// Group condition (The module belongs to an agent of the group X)
// $group_condition = sprintf('id_grupo IN (%s)', implode(',', array_values(groups_get_children_ids($group_id, true))));.
$group_condition = '('.$id_grupo_table_pretag.'id_grupo = '.$group_id.' OR '.$alt_id_grupo_table_pretag.'id_group = '.$group_id.')';
$group_condition = '('.$id_grupo_table_pretag.'id_grupo = '.$group_id;
if ($search_secondary_group === true) {
$group_condition .= ' OR '.$alt_id_grupo_table_pretag.'id_group = '.$group_id;
}
$group_condition .= ')';
// Tags condition (The module has at least one of the restricted tags).
$tags_condition = '';
@ -987,7 +996,13 @@ function tags_get_acl_tags_event_condition(
}
$in_group = implode(',', $without_tags);
$condition .= sprintf('('.$id_grupo_table_pretag.'id_grupo IN (%s) OR '.$alt_id_grupo_table_pretag.'id_group IN (%s))', $in_group, $in_group);
$condition .= sprintf('('.$id_grupo_table_pretag.'id_grupo IN (%s)', $in_group);
if ($search_secondary_group === true) {
$condition .= sprintf(' OR '.$alt_id_grupo_table_pretag.'id_group IN (%s)', $in_group);
}
$condition .= ')';
}
$condition = !empty($condition) ? "($condition)" : '';

View File

@ -473,9 +473,9 @@ function treeview_printAlertsTable($id_module, $server_data=[], $no_head=false)
if ($user_access_node && check_acl($config['id_user'], $id_group, 'LW')) {
// Actions table
echo '<div class="w100p right mw300px right_align">';
echo '<div class="w100p right_align">';
echo '<a target=_blank href="'.$console_url.'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&search=1&module_name='.$module_name.'&id_agente='.$agent_id.$url_hash.'" target="_blank">';
html_print_submit_button(__('Go to alerts edition'), 'upd_button', false, 'class="sub search"');
html_print_submit_button(__('Go to alerts edition'), 'upd_button', false, 'class="sub search" style="margin-right: 20px"');
echo '</a>';
echo '</div>';
}

View File

@ -94,3 +94,55 @@ function showMassiveOperationMessage(message) {
});
}
*/
// eslint-disable-next-line no-unused-vars
function form_controls_massive_operations_agents(metaconsole) {
// Listeners.
var recursion;
$("#checkbox-recursion").click(function() {
recursion = this.checked ? 1 : 0;
$("#id_group").trigger("change");
});
var disabled;
$("#disabled").change(function() {
disabled = this.value;
$("#id_group").trigger("change");
});
var nodes;
$("#nodes").change(function() {
nodes = $("#nodes").val();
$("#id_group").trigger("change");
});
$("#status_agents").change(function() {
$("#id_group").trigger("change");
});
// Build data.
var data = {
status_agents: function() {
return $("#status_agents").val();
},
agentSelect: "select#id_agents",
privilege: "AW",
recursion: function() {
return recursion;
},
disabled: function() {
return disabled;
}
};
if (metaconsole == 1) {
data.serialized = true;
data.serialized_separator = "|";
data.nodes = function() {
return nodes;
};
}
// Change agents.
$("#id_group").pandoraSelectGroupAgent(data);
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -201,7 +201,7 @@ ol.steps li.visited a {
}
/* White text */
a,
a:not(.visual-console-item),
label,
#menu_tab_left li a,
#menu_tab_left li span,

50532
pandora_console/index.pot Normal file

File diff suppressed because it is too large Load Diff

View File

@ -128,8 +128,8 @@
</div>
<div style='height: 10px'>
<?php
$version = '7.0NG.763';
$build = '220810';
$version = '7.0NG.764';
$build = '220829';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -244,7 +244,7 @@ if ($free_search != '') {
[
'title' => 'Policy',
'text' => 'P.',
],
]
);
$columns = array_merge(
@ -261,12 +261,12 @@ if ($free_search != '') {
'title' => 'Validate',
'text' => html_print_checkbox('all_validate', 0, false, true, false),
'class' => 'dt-left',
],
]
);
$columns = array_merge(
['validate'],
$columns,
$columns
);
}
@ -276,7 +276,7 @@ if ($free_search != '') {
[
'title' => 'Force execution',
'text' => 'F.',
],
]
);
$columns = array_merge(
@ -289,12 +289,12 @@ if ($free_search != '') {
if ($print_agent === true) {
array_push(
$column_names,
['text' => 'Agent'],
['text' => 'Agent']
);
$columns = array_merge(
$columns,
['agent'],
['agent']
);
}
@ -304,7 +304,7 @@ if ($free_search != '') {
['text' => 'Template'],
['text' => 'Action'],
['text' => 'Last fired'],
['text' => 'Status'],
['text' => 'Status']
);
$columns = array_merge(
@ -313,7 +313,7 @@ if ($free_search != '') {
['template'],
['action'],
['lastFired'],
['status'],
['status']
);
@ -381,7 +381,7 @@ if ($free_search != '') {
],
'no_toggle' => true,
],
],
]
);
} else {
ui_print_datatable(
@ -419,7 +419,7 @@ if ($free_search != '') {
$strict_user
),
],
],
]
);
}

View File

@ -175,7 +175,7 @@ $search_secondary_groups = get_parameter(
);
$id_group_filter = get_parameter(
'filter[id_group_filter]',
($filter['id_group_filter'] ?? '')
($filter['id_group'] ?? '')
);
$date_from = get_parameter(
'filter[date_from]',
@ -1558,8 +1558,8 @@ if (enterprise_hook(
*/
// Group.
if ($id_group_filter === null) {
$id_group_filter = 0;
if ($id_group === null) {
$id_group = 0;
}
$data = html_print_input(
@ -1568,7 +1568,7 @@ $data = html_print_input(
'returnAllGroup' => true,
'privilege' => 'AR',
'type' => 'select_groups',
'selected' => $id_group_filter,
'selected' => $id_group,
'nothing' => false,
'return' => true,
'size' => '80%',

View File

@ -438,8 +438,7 @@ if ($access_console_node === true) {
)
);
$javascript = 'javascript: openSoundEventModal(\''.$data_sound.'\');';
$javascript = 'javascript: openSoundEventModal(`'.$data_sound.'`);';
$sub[$javascript]['text'] = __('Sound Events');
$sub[$javascript]['id'] = 'Sound Events Modal';
$sub[$javascript]['type'] = 'direct';

View File

@ -446,7 +446,7 @@ if (isset($double_authentication)) {
if (check_acl($config['id_user'], 0, 'ER')) {
$event_filter = '<div class="label_select"><p class="edit_user_labels">'.__('Event filter').'</p>';
$user_groups = implode(',', array_keys((users_get_groups($config['id_user'], 'AR', $display_all_group))));
$user_groups = implode(',', array_keys((users_get_groups($config['id_user'], 'AR', true))));
$event_filter .= html_print_select_from_sql(
'SELECT id_filter, id_name FROM tevent_filter WHERE id_group_filter IN ('.$user_groups.')',
'event_filter',

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.763
%define release 220810
%define version 7.0NG.764
%define release 220829
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.763
%define release 220810
%define version 7.0NG.764
%define release 220829
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -2,8 +2,8 @@
# Pandora FMS Console
#
%define name pandorafms_console
%define version 7.0NG.763
%define release 220810
%define version 7.0NG.764
%define release 220829
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -9,7 +9,7 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.763"
PI_VERSION="7.0NG.764"
FORCE=0
DESTDIR=""
LOG_TIMESTAMP=`date +"%Y/%m/%d %H:%M:%S"`

View File

@ -89,6 +89,7 @@ CREATE TABLE IF NOT EXISTS `tagente` (
`safe_mode_module` INT UNSIGNED NOT NULL DEFAULT 0,
`cps` INT NOT NULL DEFAULT 0,
`satellite_server` INT NOT NULL DEFAULT 0,
`fixed_ip` TINYINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id_agente`),
KEY `nombre` (`nombre`(255)),
KEY `direccion` (`direccion`),
@ -3379,6 +3380,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_agent` (
`safe_mode_module` INT UNSIGNED NOT NULL DEFAULT 0,
`cps` INT NOT NULL DEFAULT 0,
`satellite_server` INT NOT NULL DEFAULT 0,
`fixed_ip` TINYINT NOT NULL DEFAULT 0,
PRIMARY KEY (`id_agente`),
KEY `nombre` (`nombre`(255)),
KEY `direccion` (`direccion`),

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.763-220810
Version: 7.0NG.764-220829
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.763-220810"
pandora_version="7.0NG.764-220829"
package_cpan=0
package_pandora=1

View File

@ -1,7 +1,7 @@
#############################################################################
# Pandora FMS Server Parameters
# Pandora FMS, the Flexible Monitoring System.
# Version 7.0NG.763
# Version 7.0NG.764
# Licensed under GPL license v2,
# (c) 2003-2021 Artica Soluciones Tecnologicas
# http://www.pandorafms.com

View File

@ -45,8 +45,8 @@ our @EXPORT = qw(
);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.763";
my $pandora_build = "220810";
my $pandora_version = "7.0NG.764";
my $pandora_build = "220829";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -1543,14 +1543,20 @@ sub db_insert_get_values ($) {
########################################################################
## Try to obtain the given lock.
########################################################################
sub db_get_lock($$;$) {
my ($dbh, $lock_name, $lock_timeout) = @_;
sub db_get_lock($$;$$) {
my ($dbh, $lock_name, $lock_timeout, $do_not_wait_lock) = @_;
# Only supported in MySQL.
return 1 unless ($RDBMS eq 'mysql');
# Set a default lock timeout of 1 second
$lock_timeout = 1 if (! defined ($lock_timeout));
if ($do_not_wait_lock) {
if (!db_is_free_lock($dbh, $lock_name)) {
return 0;
}
}
# Attempt to get the lock!
my $sth = $dbh->prepare('SELECT GET_LOCK(?, ?)');
@ -1563,6 +1569,26 @@ sub db_get_lock($$;$) {
return $lock;
}
########################################################################
## Check is lock is free.
########################################################################
sub db_is_free_lock($$) {
my ($dbh, $lock_name) = @_;
# Only supported in MySQL.
return 1 unless ($RDBMS eq 'mysql');
# Attempt to get the lock!
my $sth = $dbh->prepare('SELECT IS_FREE_LOCK(?)');
$sth->execute($lock_name);
my ($lock) = $sth->fetchrow;
# Something went wrong
return 0 if (! defined ($lock));
return $lock;
}
########################################################################
## Release the given lock.
########################################################################

View File

@ -257,6 +257,8 @@ sub data_consumer ($$) {
process_xml_server ($self->getConfig (), $file_name, $xml_data, $self->getDBH ());
} elsif (defined($xml_data->{'connection_source'})) {
enterprise_hook('process_xml_connections', [$self->getConfig (), $file_name, $xml_data, $self->getDBH ()]);
} elsif (defined($xml_data->{'ipam_source'})) {
enterprise_hook('process_xml_ipam', [$self->getConfig (), $file_name, $xml_data, $self->getDBH ()]);
} elsif (defined($xml_data->{'network_matrix'})){
process_xml_matrix_network(
$self->getConfig(), $xml_data, $self->getDBH()
@ -485,7 +487,7 @@ sub process_xml_data ($$$$$) {
# Update the main address
if ($address ne '' && $address ne $agent->{'direccion'}) {
pandora_update_agent_address ($pa_config, $agent_id, $agent_name, $address, $dbh);
pandora_update_agent_address ($pa_config, $agent_id, $agent_name, $address, $dbh) unless $agent->{'fixed_ip'} == 1;
pandora_add_agent_address($pa_config, $agent_id, $agent_name, $address, $dbh);
}

View File

@ -254,8 +254,6 @@ sub g_http_task {
utf8::decode($match_string);
}
$match_string = quotemeta($match_string);
if ( $as_string =~ m/$match_string/i ){
$total_valid_requests++;
} else {

View File

@ -235,6 +235,8 @@ sub g_http_task {
if ($content =~ m/($temp)/) {
$task_get_content[$thread_id] = $1;
}
} else {
$task_get_content[$thread_id] = $resp;
}
# Resource bashing

View File

@ -33,8 +33,8 @@ use base 'Exporter';
our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.763";
my $pandora_build = "220810";
my $pandora_version = "7.0NG.764";
my $pandora_build = "220829";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -2,8 +2,8 @@
# Pandora FMS Server
#
%define name pandorafms_server
%define version 7.0NG.763
%define release 220810
%define version 7.0NG.764
%define release 220829
Summary: Pandora FMS Server
Name: %{name}

View File

@ -2,8 +2,8 @@
# Pandora FMS Server
#
%define name pandorafms_server
%define version 7.0NG.763
%define release 220810
%define version 7.0NG.764
%define release 220829
Summary: Pandora FMS Server
Name: %{name}

View File

@ -8,8 +8,8 @@
# This code is licensed under GPL 2.0 license.
# **********************************************************************
PI_VERSION="7.0NG.763"
PI_BUILD="220810"
PI_VERSION="7.0NG.764"
PI_BUILD="220829"
MODE=$1
if [ $# -gt 1 ]; then

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.763 Build 220810";
my $version = "7.0NG.764 Build 220829";
# Pandora server configuration
my %conf;
@ -1193,6 +1193,20 @@ if ($conf{'_force'} == 1) {
db_release_pandora_lock($dbh, $lock_name, $LOCK_TIMEOUT);
}
# Get a lock merging.
my $lock_merge = db_get_lock ($dbh, 'merge-working', $LOCK_TIMEOUT, 1);
if ($lock_merge == 0) {
log_message ('', " [*] Merge is running.\n\n");
exit 1;
}
# Get a lock on merging events.
my $lock_merge_events = db_get_lock ($dbh, 'merging-events', $LOCK_TIMEOUT, 1);
if ($lock_merge_events == 0) {
log_message ('', " [*] Merge events is running.\n\n");
exit 1;
}
# Get a lock on dbname.
my $lock = db_get_pandora_lock ($dbh, $lock_name, $LOCK_TIMEOUT);
if ($lock == 0) {

View File

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