Merge remote-tracking branch 'origin/develop' into ent-4559-desajuste-en-custom-fields

This commit is contained in:
Luis Calvo 2019-08-28 15:43:05 +02:00
commit 5973c0b350
33 changed files with 942 additions and 859 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.738-190827 Version: 7.0NG.738-190828
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.738-190827" pandora_version="7.0NG.738-190828"
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.738'; use constant AGENT_VERSION => '7.0NG.738';
use constant AGENT_BUILD => '190827'; use constant AGENT_BUILD => '190828';
# 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.738 %define version 7.0NG.738
%define release 190827 %define release 190828
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.738 %define version 7.0NG.738
%define release 190827 %define release 190828
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.738" PI_VERSION="7.0NG.738"
PI_BUILD="190827" PI_BUILD="190828"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{190827} {190828}
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.738(Build 190827)") #define PANDORA_VERSION ("7.0NG.738(Build 190828)")
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.738(Build 190827))" VALUE "ProductVersion", "(7.0NG.738(Build 190828))"
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.738-190827 Version: 7.0NG.738-190828
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.738-190827" pandora_version="7.0NG.738-190828"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

@ -1243,7 +1243,7 @@ ALTER TABLE titem MODIFY `source_data` int(10) unsigned;
INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('big_operation_step_datos_purge', '100');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('small_operation_step_datos_purge', '1000');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('days_autodisable_deletion', '30');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 30); INSERT INTO `tconfig` (`token`, `value`) VALUES ('MR', 31);
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_docs_logo', 'default_docs.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_support_logo', 'default_support.png');
INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png'); INSERT INTO `tconfig` (`token`, `value`) VALUES ('custom_logo_white_bg_preview', 'pandora_logo_head_white_bg.png');

View File

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

View File

@ -1220,7 +1220,7 @@ function events_get_all(
ON ts.id = te.server_id'; ON ts.id = te.server_id';
if (!empty($filter['server_id'])) { if (!empty($filter['server_id'])) {
$server_join = sprintf( $server_join = sprintf(
' LEFT JOIN tmetaconsole_setup ts ' INNER JOIN tmetaconsole_setup ts
ON ts.id = te.server_id AND ts.id= %d', ON ts.id = te.server_id AND ts.id= %d',
$filter['server_id'] $filter['server_id']
); );

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
/* global $ */ /* global $ */
/* exported pandoraFlotPie, pandoraFlotPieCustom */
function pandoraFlotPie( function pandoraFlotPie(
graph_id, graph_id,
@ -14,7 +15,7 @@ function pandoraFlotPie(
colors, colors,
hide_labels hide_labels
) { ) {
var labels = labels.split(separator); labels = labels.split(separator);
var data = values.split(separator); var data = values.split(separator);
if (colors != "") { if (colors != "") {
@ -92,7 +93,7 @@ function pandoraFlotPie(
function pieHover(event, pos, obj) { function pieHover(event, pos, obj) {
if (!obj) return; if (!obj) return;
index = obj.seriesIndex; var index = obj.seriesIndex;
legends.css("color", "#3F3F3D"); legends.css("color", "#3F3F3D");
legends.eq(index).css("color", ""); legends.eq(index).css("color", "");
} }
@ -144,21 +145,14 @@ function pandoraFlotPieCustom(
.pop() .pop()
.split(".") .split(".")
.shift(); .shift();
var labels = labels.split(separator); labels = labels.split(separator);
var legend = legend.split(separator); legend = legend.split(separator);
var data = values.split(separator); var data = values.split(separator);
var no_data = 0; var no_data = 0;
if (colors != "") { if (colors != "") {
colors = colors.split(separator); colors = colors.split(separator);
} }
var colors_data = [
"#e63c52",
"#FFA631",
"#f3b200",
"#5BB6E5",
"#F2919D",
"#82b92e"
];
var color = null; var color = null;
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
if (colors != "") { if (colors != "") {
@ -174,28 +168,31 @@ function pandoraFlotPieCustom(
if (width <= 450) { if (width <= 450) {
show_legend = false; show_legend = false;
label_conf = {
show: false
};
} else {
label_conf = { label_conf = {
show: true, show: true,
radius: 0.75, radius: 5 / 8,
formatter: function(label, series) { formatter: function(label, series) {
console.log(series);
return ( return (
'<div style="font-size:' + '<div style="font-size:' +
font_size + font_size +
"pt;" + "pt; font-weight:bolder;" +
'text-align:center;padding:2px;color:white;">' + "text-align:center;padding:2px;color:rgb(63, 63, 61)" +
series.percent.toFixed(2) + '">' +
"%</div>" label +
":<br>" +
series.data[0][1] +
"</div>"
); );
}, },
background: { background: {
opacity: 0.5, opacity: 0.5
color: ""
} }
}; };
} else {
label_conf = {
show: false
};
} }
var conf_pie = { var conf_pie = {
@ -203,8 +200,8 @@ function pandoraFlotPieCustom(
pie: { pie: {
show: true, show: true,
radius: 3 / 4, radius: 3 / 4,
innerRadius: 0.4 innerRadius: 0.4,
//label: label_conf label: label_conf
} }
}, },
legend: { legend: {
@ -234,7 +231,7 @@ function pandoraFlotPieCustom(
var legends = $("#" + graph_id + " .legendLabel"); var legends = $("#" + graph_id + " .legendLabel");
var j = 0; var j = 0;
legends.each(function() { legends.each(function() {
//$(this).css('width', $(this).width()); //$(this).css("width", $(this).width());
$(this).css("font-size", font_size + "pt"); $(this).css("font-size", font_size + "pt");
$(this).removeClass("legendLabel"); $(this).removeClass("legendLabel");
$(this).addClass(font); $(this).addClass(font);
@ -264,19 +261,6 @@ function pandoraFlotPieCustom(
return false; return false;
}); });
var pielegends = $("#" + graph_id + " .pieLabelBackground");
pielegends.each(function() {
$(this)
.css("transform", "rotate(-35deg)")
.css("color", "black");
});
var labelpielegends = $("#" + graph_id + " .pieLabel");
labelpielegends.each(function() {
$(this)
.css("transform", "rotate(-35deg)")
.css("color", "black");
});
// Events // Events
$("#" + graph_id).bind("plothover", pieHover); $("#" + graph_id).bind("plothover", pieHover);
$("#" + graph_id).bind("plotclick", Clickpie); $("#" + graph_id).bind("plotclick", Clickpie);
@ -287,16 +271,17 @@ function pandoraFlotPieCustom(
function pieHover(event, pos, obj) { function pieHover(event, pos, obj) {
if (!obj) return; if (!obj) return;
index = obj.seriesIndex; var index = obj.seriesIndex;
legends.css("color", "#3F3F3D"); legends.css("color", "#3F3F3D");
legends.eq(index).css("color", ""); legends.eq(index).css("color", "");
} }
function Clickpie(event, pos, obj) { function Clickpie(event, pos, obj) {
if (!obj) return; if (!obj) return;
percent = parseFloat(obj.series.percent).toFixed(2); var percent = parseFloat(obj.series.percent).toFixed(2);
valor = parseFloat(obj.series.data[0][1]); var valor = parseFloat(obj.series.data[0][1]);
var value = "";
if (valor > 1000000) { if (valor > 1000000) {
value = Math.round((valor / 1000000) * 100) / 100; value = Math.round((valor / 1000000) * 100) / 100;
value = value + "M"; value = value + "M";
@ -325,42 +310,6 @@ function pandoraFlotPieCustom(
$("#watermark_image_" + graph_id).attr("src") $("#watermark_image_" + graph_id).attr("src")
); );
} }
/*
window.onresize = function(event) {
$.plot($('#' + graph_id), data, conf_pie);
if (no_data == data.length) {
$('#'+graph_id+' .overlay').remove();
$('#'+graph_id+' .base').remove();
$('#'+graph_id).prepend("<img style='width:50%;' src='images/no_data_toshow.png' />");
}
var legends = $('#'+graph_id+' .legendLabel');
var j = 0;
legends.each(function () {
//$(this).css('width', $(this).width());
$(this).css('font-size', font_size+'pt');
$(this).removeClass("legendLabel");
$(this).addClass(font);
$(this).text(legend[j]);
j++;
});
if ($('input[name="custom_graph"]').val()) {
$('.legend>div').css('right',($('.legend>div').height()*-1));
$('.legend>table').css('right',($('.legend>div').height()*-1));
}
//$('.legend>table').css('border',"1px solid #E2E2E2");
$('.legend>table').css('background-color',"transparent");
var pielegends = $('#'+graph_id+' .pieLabelBackground');
pielegends.each(function () {
$(this).css('transform', "rotate(-35deg)").css('color', 'black');
});
var labelpielegends = $('#'+graph_id+' .pieLabel');
labelpielegends.each(function () {
$(this).css('transform', "rotate(-35deg)").css('color', 'black');
});
}
*/
} }
function pandoraFlotHBars( function pandoraFlotHBars(

View File

@ -159,7 +159,26 @@ function pandora_session_gc($max_lifetime=300)
global $config; global $config;
if (isset($config['session_timeout'])) { if (isset($config['session_timeout'])) {
$max_lifetime = $config['session_timeout']; $session_timeout = $config['session_timeout'];
} else {
// if $config doesn`t work ...
$session_timeout = db_get_value(
'value',
'tconfig',
'token',
'session_timeout'
);
}
if (!empty($session_timeout)) {
if ($session_timeout == -1) {
// The session expires in 10 years
$session_timeout = 315576000;
} else {
$session_timeout *= 60;
}
$max_lifetime = $session_timeout;
} }
$time_limit = (time() - $max_lifetime); $time_limit = (time() - $max_lifetime);
@ -171,6 +190,11 @@ function pandora_session_gc($max_lifetime=300)
] ]
); );
// Deleting cron and empty sessions.
$sql = "DELETE FROM tsessions_php WHERE
data IS NULL OR id_session REGEXP '^cron-'";
db_process_sql($sql);
return $retval; return $retval;
} }

View File

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

View File

@ -984,7 +984,7 @@ if (is_metaconsole()) {
'SELECT id, server_name FROM tmetaconsole_setup', 'SELECT id, server_name FROM tmetaconsole_setup',
'server_id', 'server_id',
$server_id, $server_id,
'script', '',
__('All'), __('All'),
'0', '0',
true true

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.738 %define version 7.0NG.738
%define release 190827 %define release 190828
# 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.738 %define version 7.0NG.738
%define release 190827 %define release 190828
# 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.738 %define version 7.0NG.738
%define release 190827 %define release 190828
%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

@ -109,7 +109,7 @@ INSERT INTO `tconfig` (`token`, `value`) VALUES
('custom_report_front_logo', 'images/pandora_logo_white.jpg'), ('custom_report_front_logo', 'images/pandora_logo_white.jpg'),
('custom_report_front_header', ''), ('custom_report_front_header', ''),
('custom_report_front_footer', ''), ('custom_report_front_footer', ''),
('MR', 30), ('MR', 31),
('identification_reminder', 1), ('identification_reminder', 1),
('identification_reminder_timestamp', 0), ('identification_reminder_timestamp', 0),
('current_package_enterprise', '738'), ('current_package_enterprise', '738'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.738-190827 Version: 7.0NG.738-190828
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.738-190827" pandora_version="7.0NG.738-190828"
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.738"; my $pandora_version = "7.0NG.738";
my $pandora_build = "190827"; my $pandora_build = "190828";
our $VERSION = $pandora_version." ".$pandora_build; our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash # Setup hash

View File

@ -58,7 +58,6 @@ my %Agents :shared;
my $Sem :shared; my $Sem :shared;
my $TaskSem :shared; my $TaskSem :shared;
my $AgentSem :shared; my $AgentSem :shared;
my $XMLinSem :shared;
######################################################################################## ########################################################################################
# Data Server class constructor. # Data Server class constructor.
@ -75,7 +74,6 @@ sub new ($$;$) {
$Sem = Thread::Semaphore->new; $Sem = Thread::Semaphore->new;
$TaskSem = Thread::Semaphore->new (0); $TaskSem = Thread::Semaphore->new (0);
$AgentSem = Thread::Semaphore->new (1); $AgentSem = Thread::Semaphore->new (1);
$XMLinSem = Thread::Semaphore->new (1);
# Call the constructor of the parent class # Call the constructor of the parent class
my $self = $class->SUPER::new($config, DATASERVER, \&PandoraFMS::DataServer::data_producer, \&PandoraFMS::DataServer::data_consumer, $dbh); my $self = $class->SUPER::new($config, DATASERVER, \&PandoraFMS::DataServer::data_producer, \&PandoraFMS::DataServer::data_consumer, $dbh);
@ -177,7 +175,6 @@ sub data_consumer ($$) {
my $agent_name = $1; my $agent_name = $1;
my $file_name = $pa_config->{'incomingdir'}; my $file_name = $pa_config->{'incomingdir'};
my $xml_err; my $xml_err;
my $error;
# Fix path # Fix path
$file_name .= "/" unless (substr ($file_name, -1, 1) eq '/'); $file_name .= "/" unless (substr ($file_name, -1, 1) eq '/');
@ -194,37 +191,18 @@ sub data_consumer ($$) {
for (0..1) { for (0..1) {
eval { eval {
local $SIG{__DIE__};
threads->yield; threads->yield;
# XML::SAX::ExpatXS is not thread safe.
if ($XML::Simple::PREFERRED_PARSER eq 'XML::SAX::ExpatXS') {
$XMLinSem->down();
}
$xml_data = XMLin ($file_name, forcearray => 'module'); $xml_data = XMLin ($file_name, forcearray => 'module');
if ($XML::Simple::PREFERRED_PARSER eq 'XML::SAX::ExpatXS') {
$XMLinSem->up();
}
}; };
# Invalid XML # Invalid XML
if ($@) { if ($@ || ref($xml_data) ne 'HASH') {
$error = 1;
if ($XML::Simple::PREFERRED_PARSER eq 'XML::SAX::ExpatXS') {
$XMLinSem->up();
}
}
if ($error || ref($xml_data) ne 'HASH') {
if ($@) { if ($@) {
$xml_err = $@; $xml_err = $@;
} else { } else {
$xml_err = "Invalid XML format."; $xml_err = "Invalid XML format.";
} }
logger($pa_config, "Failed to parse $file_name $xml_err", 3);
sleep (2); sleep (2);
next; next;
} }

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.738"; my $pandora_version = "7.0NG.738";
my $pandora_build = "190827"; my $pandora_build = "190828";
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.738 %define version 7.0NG.738
%define release 190827 %define release 190828
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.738 %define version 7.0NG.738
%define release 190827 %define release 190828
Summary: Pandora FMS Server Summary: Pandora FMS Server
Name: %{name} Name: %{name}

View File

@ -9,7 +9,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.738" PI_VERSION="7.0NG.738"
PI_BUILD="190827" PI_BUILD="190828"
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.738 PS190827"; my $version = "7.0NG.738 PS190828";
# 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.738 PS190827"; my $version = "7.0NG.738 PS190828";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);