Merge remote-tracking branch 'origin/develop' into ent-3287-Sincronización-plugin-de-servidor

Former-commit-id: 93fd236f1876132a18aae31f8ccbcd888a1613f0
This commit is contained in:
Daniel Maya 2019-02-25 15:43:33 +01:00
commit 5812a8bdaa
29 changed files with 881 additions and 561 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.731-190222 Version: 7.0NG.731-190225
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.731 %define version 7.0NG.731
%define release 190222 %define release 190225
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_agent_unix %define name pandorafms_agent_unix
%define version 7.0NG.731 %define version 7.0NG.731
%define release 190222 %define release 190225
Summary: Pandora FMS Linux agent, PERL version Summary: Pandora FMS Linux agent, PERL version
Name: %{name} Name: %{name}

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.731" PI_VERSION="7.0NG.731"
PI_BUILD="190222" PI_BUILD="190225"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{190222} {190225}
ViewReadme ViewReadme
{Yes} {Yes}

View File

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

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.731-190222 Version: 7.0NG.731-190225
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

@ -0,0 +1,5 @@
START TRANSACTION;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
COMMIT;

View File

@ -1206,6 +1206,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview',
UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager'; UPDATE tconfig SET value = 'https://licensing.artica.es/pandoraupdate7/server.php' WHERE token='url_update_manager';
DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise'; DELETE FROM `tconfig` WHERE `token` = 'current_package_enterprise';
INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '731'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('current_package_enterprise', '731');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp');
-- --------------------------------------------------------------------- -- ---------------------------------------------------------------------
-- Table `tconfig_os` -- Table `tconfig_os`

View File

@ -0,0 +1,240 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2011 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
// as published by the Free Software Foundation; version 2
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
global $config;
check_login ();
if (! check_acl ($config['id_user'], 0, 'AR')
&& ! check_acl ($config['id_user'], 0, 'AW') &&
! check_acl ($config['id_user'], 0, 'AM')) {
db_pandora_audit('ACL Violation',
'Trying to access Agent Management');
require ('general/noaccess.php');
return;
}
$update = get_parameter('upd_button', '');
$default = (int) get_parameter('default', 0);
if ($default != 0) {
$fields_selected = explode (',', $config['status_monitor_fields']);
}
else if ($update != '') {
$fields_selected = (array)get_parameter('fields_selected');
if ($fields_selected[0] == '') {
$fields_selected = explode (',', $config['status_monitor_fields']);
}
else {
$status_monitor_fields = implode (',', $fields_selected);
}
$values = array(
'token' => 'status_monitor_fields',
'value' => $status_monitor_fields
);
//update 'status_monitor_fields' in tconfig table to keep the value at update.
$result = db_process_sql_update('tconfig', $values,
array ('token' => 'status_monitor_fields'));
ui_print_result_message ($result, __('Successfully updated'), __('Could not be updated'));
$config['status_monitor_fields'] = $status_monitor_fields;
}
$fields_selected = array();
$status_monitor_fields = '';
$fields_selected = explode (',', $config['status_monitor_fields']);
$result_selected = array();
//show list of fields selected.
if ($fields_selected[0]!='') {
foreach ($fields_selected as $field_selected) {
switch ($field_selected) {
case 'policy':
$result = __('Policy');
break;
case 'agent':
$result = __('Agent');
break;
case 'data_type':
$result = __('Data type');
break;
case 'module_name':
$result = __('Module name');
break;
case 'server_type':
$result = __('Server type');
break;
case 'interval':
$result = __('Interval');
break;
case 'status':
$result = __('Status');
break;
case 'graph':
$result = __('Graph');
break;
case 'warn':
$result = __('Warn');
break;
case 'data':
$result = __('Data');
break;
case 'timestamp':
$result = __('Timestamp');
break;
case 'to_critical':
$result = __('Last status change');
break;
}
$result_selected[$field_selected] = $result;
}
}
echo '<h3>'.__('Show monitor detail fields').'</h3>';
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filters';
$table->size = array();
//~ $table->size[0] = '20%';
$table->size[1] = '10px';
//~ $table->size[2] = '20%';
$table->style[0] = 'text-align:center;';
$table->style[2] = 'text-align:center;';
$table->data = array();
$fields_available = array();
$fields_available['policy'] = __('Policy');
$fields_available['agent'] = __('Agent');
$fields_available['data_type'] = __('Data type');
$fields_available['module_name'] = __('Module name');
$fields_available['server_type'] = __('Server type');
$fields_available['interval'] = __('Interval');
$fields_available['status'] = __('Status');
$fields_available['graph'] = __('Graph');
$fields_available['warn'] = __('Warn');
$fields_available['data'] = __('Data');
$fields_available['timestamp'] = __('Timestamp');
$fields_available['to_critical'] = __('Last status change');
//remove fields already selected
foreach ($fields_available as $key=>$available) {
foreach ($result_selected as $selected) {
if ($selected == $available) {
unset($fields_available[$key]);
}
}
}
$table->data[0][0] = '<b>' . __('Fields available').'</b>';
$table->data[1][0] = html_print_select ($fields_available, 'fields_available[]', true, '', '', 0, true, true, false, '', false, 'width: 300px');
$table->data[1][1] = '<a href="javascript:">' .
html_print_image('images/darrowright.png', true,
array('id' => 'right', 'title' => __('Add fields to select'))) .
'</a>';
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">' .
html_print_image('images/darrowleft.png', true,
array('id' => 'left', 'title' => __('Delete fields to select'))) .
'</a>';
$table->data[0][1] = '';
$table->data[0][2] = '<b>' . __('Fields selected') . '</b>';
$table->data[1][2] = html_print_select($result_selected,
'fields_selected[]', true, '', '', 0, true, true, false, '', false, 'width: 300px');
echo '<form id="custom_status_monitor" method="post" action="index.php?sec=view&sec2=operation/agentes/status_monitor&section=fields&amp;pure='.$config['pure'].'">';
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button (__('Update'), 'upd_button', false, 'class="sub upd"');
echo '</form>';
echo '</div>';
?>
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready (function () {
$("#right").click (function () {
jQuery.each($("select[name='fields_available[]'] option:selected"), function (key, value) {
field_name = $(value).html();
if (field_name != <?php echo "'".__('None')."'"; ?>) {
id_field = $(value).attr('value');
$("select[name='fields_selected[]']").append($("<option></option>").html(field_name).attr("value", id_field));
$("#fields_available").find("option[value='" + id_field + "']").remove();
$("#fields_selected").find("option[value='0']").remove();
}
});
});
$("#left").click (function () {
var current_fields_size = ($('#fields_selected option').length);
var selected_fields = [];
var selected_fields_total = '';
jQuery.each($("select[name='fields_selected[]'] option:selected"), function (key, value) {
field_name = $(value).html();
selected_fields.push(field_name);
selected_fields_total = selected_fields.length;
});
if(selected_fields_total === current_fields_size){
display_confirm_dialog(
"<?php echo '<span style=text-transform:none;font-size:9.5pt;>'.__('There must be at least one custom field. Timestamp will be set by default').'</span>'; ?>",
"<?php echo __('Confirm'); ?>",
"<?php echo __('Cancel'); ?>",
function () {
move_left();
$("#fields_available").find("option[value='timestamp']").remove();
$("select[name='fields_selected[]']").append($("<option></option>").val('timestamp').html('<i>' + 'Timestamp' + '</i>'));
}
);
}
else{
move_left();
}
});
$("#submit-upd_button").click(function () {
$("#fields_selected").find("option[value='0']").remove();
$('#fields_selected option').map(function() {
$(this).prop('selected', true);
});
});
});
function move_left(){
jQuery.each($("select[name='fields_selected[]'] option:selected"), function (key, value) {
field_name = $(value).html();
if (field_name != <?php echo "'".__('None')."'"; ?>) {
id_field = $(value).attr('value');
$("select[name='fields_available[]']").append($("<option></option>").val(id_field).html('<i>' + field_name + '</i>'));
$("#fields_selected").find("option[value='" + id_field + "']").remove();
$("#fields_available").find("option[value='0']").remove();
}
});
}
</script>

View File

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

View File

@ -129,7 +129,7 @@
<div style='height: 10px'> <div style='height: 10px'>
<?php <?php
$version = '7.0NG.731'; $version = '7.0NG.731';
$build = '190222'; $build = '190225';
$banner = "v$version Build $build"; $banner = "v$version Build $build";
error_reporting(0); error_reporting(0);

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.731 %define version 7.0NG.731
%define release 190222 %define release 190225
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name httpd %define httpd_name httpd

View File

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

View File

@ -85,6 +85,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('netflow_nfdump', '/usr/bin/nfdump'), ('netflow_nfdump', '/usr/bin/nfdump'),
('netflow_max_resolution', '50'), ('netflow_max_resolution', '50'),
('event_fields', 'evento,id_agente,estado,timestamp'), ('event_fields', 'evento,id_agente,estado,timestamp'),
('status_monitor_fields', 'policy,agent,data_type,module_name,server_type,interval,status,graph,warn,data,timestamp'),
('list_ACL_IPs_for_API', '127.0.0.1'), ('list_ACL_IPs_for_API', '127.0.0.1'),
('enable_pass_policy', 0), ('enable_pass_policy', 0),
('pass_size', 4), ('pass_size', 4),

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.731-190222 Version: 7.0NG.731-190225
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.731 %define version 7.0NG.731
%define release 190222 %define release 190225
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_server %define name pandorafms_server
%define version 7.0NG.731 %define version 7.0NG.731
%define release 190222 %define release 190225
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

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

View File

@ -34,7 +34,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.731 PS190222"; my $version = "7.0NG.731 PS190225";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

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