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
Version: 7.0NG.738-190827
Version: 7.0NG.738-190828
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.738-190827"
pandora_version="7.0NG.738-190828"
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

@ -42,7 +42,7 @@ my $Sem = undef;
my $ThreadSem = undef;
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
use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.738"
PI_BUILD="190827"
PI_BUILD="190828"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{190827}
{190828}
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.738(Build 190827)")
#define PANDORA_VERSION ("7.0NG.738(Build 190828)")
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.738(Build 190827))"
VALUE "ProductVersion", "(7.0NG.738(Build 190828))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.738-190827
Version: 7.0NG.738-190828
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.738-190827"
pandora_version="7.0NG.738-190828"
package_pear=0
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 ('small_operation_step_datos_purge', '1000');
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_support_logo', 'default_support.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
*/
$build_version = 'PC190827';
$build_version = 'PC190828';
$pandora_version = 'v7.0NG.738';
// Do not overwrite default timezone set if defined.

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,5 @@
/* global $ */
/* exported pandoraFlotPie, pandoraFlotPieCustom */
function pandoraFlotPie(
graph_id,
@ -14,7 +15,7 @@ function pandoraFlotPie(
colors,
hide_labels
) {
var labels = labels.split(separator);
labels = labels.split(separator);
var data = values.split(separator);
if (colors != "") {
@ -92,7 +93,7 @@ function pandoraFlotPie(
function pieHover(event, pos, obj) {
if (!obj) return;
index = obj.seriesIndex;
var index = obj.seriesIndex;
legends.css("color", "#3F3F3D");
legends.eq(index).css("color", "");
}
@ -144,21 +145,14 @@ function pandoraFlotPieCustom(
.pop()
.split(".")
.shift();
var labels = labels.split(separator);
var legend = legend.split(separator);
labels = labels.split(separator);
legend = legend.split(separator);
var data = values.split(separator);
var no_data = 0;
if (colors != "") {
colors = colors.split(separator);
}
var colors_data = [
"#e63c52",
"#FFA631",
"#f3b200",
"#5BB6E5",
"#F2919D",
"#82b92e"
];
var color = null;
for (var i = 0; i < data.length; i++) {
if (colors != "") {
@ -174,28 +168,31 @@ function pandoraFlotPieCustom(
if (width <= 450) {
show_legend = false;
label_conf = {
show: false
};
} else {
label_conf = {
show: true,
radius: 0.75,
radius: 5 / 8,
formatter: function(label, series) {
console.log(series);
return (
'<div style="font-size:' +
font_size +
"pt;" +
'text-align:center;padding:2px;color:white;">' +
series.percent.toFixed(2) +
"%</div>"
"pt; font-weight:bolder;" +
"text-align:center;padding:2px;color:rgb(63, 63, 61)" +
'">' +
label +
":<br>" +
series.data[0][1] +
"</div>"
);
},
background: {
opacity: 0.5,
color: ""
opacity: 0.5
}
};
} else {
label_conf = {
show: false
};
}
var conf_pie = {
@ -203,8 +200,8 @@ function pandoraFlotPieCustom(
pie: {
show: true,
radius: 3 / 4,
innerRadius: 0.4
//label: label_conf
innerRadius: 0.4,
label: label_conf
}
},
legend: {
@ -234,7 +231,7 @@ function pandoraFlotPieCustom(
var legends = $("#" + graph_id + " .legendLabel");
var j = 0;
legends.each(function() {
//$(this).css('width', $(this).width());
//$(this).css("width", $(this).width());
$(this).css("font-size", font_size + "pt");
$(this).removeClass("legendLabel");
$(this).addClass(font);
@ -264,19 +261,6 @@ function pandoraFlotPieCustom(
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
$("#" + graph_id).bind("plothover", pieHover);
$("#" + graph_id).bind("plotclick", Clickpie);
@ -287,16 +271,17 @@ function pandoraFlotPieCustom(
function pieHover(event, pos, obj) {
if (!obj) return;
index = obj.seriesIndex;
var index = obj.seriesIndex;
legends.css("color", "#3F3F3D");
legends.eq(index).css("color", "");
}
function Clickpie(event, pos, obj) {
if (!obj) return;
percent = parseFloat(obj.series.percent).toFixed(2);
valor = parseFloat(obj.series.data[0][1]);
var percent = parseFloat(obj.series.percent).toFixed(2);
var valor = parseFloat(obj.series.data[0][1]);
var value = "";
if (valor > 1000000) {
value = Math.round((valor / 1000000) * 100) / 100;
value = value + "M";
@ -325,42 +310,6 @@ function pandoraFlotPieCustom(
$("#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(

View File

@ -159,7 +159,26 @@ function pandora_session_gc($max_lifetime=300)
global $config;
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);
@ -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;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.738
%define release 190827
%define release 190828
%define httpd_name httpd
# User and Group under which Apache is running
%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_header', ''),
('custom_report_front_footer', ''),
('MR', 30),
('MR', 31),
('identification_reminder', 1),
('identification_reminder_timestamp', 0),
('current_package_enterprise', '738'),

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.738-190827
Version: 7.0NG.738-190828
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.738-190827"
pandora_version="7.0NG.738-190828"
package_cpan=0
package_pandora=1

View File

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

View File

@ -58,7 +58,6 @@ my %Agents :shared;
my $Sem :shared;
my $TaskSem :shared;
my $AgentSem :shared;
my $XMLinSem :shared;
########################################################################################
# Data Server class constructor.
@ -75,7 +74,6 @@ sub new ($$;$) {
$Sem = Thread::Semaphore->new;
$TaskSem = Thread::Semaphore->new (0);
$AgentSem = Thread::Semaphore->new (1);
$XMLinSem = Thread::Semaphore->new (1);
# Call the constructor of the parent class
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 $file_name = $pa_config->{'incomingdir'};
my $xml_err;
my $error;
# Fix path
$file_name .= "/" unless (substr ($file_name, -1, 1) eq '/');
@ -194,37 +191,18 @@ sub data_consumer ($$) {
for (0..1) {
eval {
local $SIG{__DIE__};
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');
if ($XML::Simple::PREFERRED_PARSER eq 'XML::SAX::ExpatXS') {
$XMLinSem->up();
}
};
# Invalid XML
if ($@) {
$error = 1;
if ($XML::Simple::PREFERRED_PARSER eq 'XML::SAX::ExpatXS') {
$XMLinSem->up();
}
}
if ($error || ref($xml_data) ne 'HASH') {
if ($@ || ref($xml_data) ne 'HASH') {
if ($@) {
$xml_err = $@;
} else {
$xml_err = "Invalid XML format.";
}
logger($pa_config, "Failed to parse $file_name $xml_err", 3);
sleep (2);
next;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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