Merge remote-tracking branch 'origin/develop' into ent-5527-cambio-discovery-sap-para-hacerlo-personalizable

This commit is contained in:
fbsanchez 2020-06-16 11:39:17 +02:00
commit c9457b2df3
30 changed files with 136 additions and 29 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.746-200615
Version: 7.0NG.746-200616
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.746-200615"
pandora_version="7.0NG.746-200616"
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

@ -55,7 +55,7 @@ my $Sem = undef;
my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.746';
use constant AGENT_BUILD => '200615';
use constant AGENT_BUILD => '200616';
# 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.746
%define release 200615
%define release 200616
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.746"
PI_BUILD="200615"
PI_BUILD="200616"
OS_NAME=`uname -s`
FORCE=0

View File

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

View File

@ -1,5 +1,5 @@
package: pandorafms-console
Version: 7.0NG.746-200615
Version: 7.0NG.746-200616
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.746-200615"
pandora_version="7.0NG.746-200616"
package_pear=0
package_pandora=1

View File

@ -261,6 +261,13 @@ if ($correctLogin) {
}
break;
case 'event':
// Preventive check for users if not available write events
if (! check_acl($config['id_user'], $event['id_grupo'], 'EW')) {
return false;
}
break;
default:
// Ignore.
break;

View File

@ -277,7 +277,8 @@ if (file_exists('languages/'.$user_language.'.mo') === true) {
$params['ttl'],
$params['sizeForTicks'],
$params['show'],
$params['date_to']
$params['date_to'],
$params['server_id']
);
break;

View File

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

View File

@ -2142,7 +2142,7 @@ function check_sql($sql)
{
// We remove "*" to avoid things like SELECT * FROM tusuario
// Check that it not delete_ as "delete_pending" (this is a common field in pandora tables).
if (preg_match('/\*|delete[^_]|drop|alter|modify|password|pass|insert|update/i', $sql)) {
if (preg_match('/([ ]*(delete|drop|alter|modify|password|pass|insert|update)\b[ \\]+)/i', $sql)) {
return '';
}

View File

@ -8796,6 +8796,11 @@ function otherParameter2Filter($other, $return_as_array=false, $use_agent_name=f
}
}
// Esto es extraño, hablar con Tati
/*
$filter['1'] = $filter['sql'];
unset($filter['sql']); */
if (isset($other['data'][4]) && $other['data'][4] != '') {
$idTemplate = db_get_value_filter('id', 'talert_templates', ['name' => $other['data'][4]]);
if ($idTemplate !== false) {
@ -10727,6 +10732,83 @@ function get_events_with_user($trash1, $trash2, $other, $returnType, $user_in_db
}
/**
* Update an event
*
* @param string $id_event Id of the event for change.
* @param string $unused1 Without use.
* @param array $params Dictionary with field,value format with the data for update.
* @param string $unused2 Without use.
* @param string $unused3 Without use.
*
* @return void
*/
function api_set_event($id_event, $unused1, $params, $unused2, $unused3)
{
// Get the event
$event = events_get_event($id_event, false, is_metaconsole());
// If event not exists, end the execution.
if ($event === false) {
returnError(
'event_not_exists',
'Event not exists'
);
return false;
}
$paramsSerialize = [];
// Serialize the data for update
if ($params['type'] === 'array') {
// Keys that is not available to change
$invalidKeys = [
'id_evento',
'id_agente',
'id_grupo',
'timestamp',
'utimestamp',
'id_agentmodule',
'ack_utimestamp',
'data',
];
foreach ($params['data'] as $key_value) {
list($key, $value) = explode(',', $key_value, 2);
if (in_array($key, $invalidKeys) == false) {
$paramsSerialize[$key] = $value;
}
}
}
// In meta or node.
if (is_metaconsole() === true) {
$table = 'tmetaconsole_event';
} else {
$table = 'tevento';
}
// TODO. Stablish security for prevent sql injection?
// Update the row
$result = db_process_sql_update(
$table,
$paramsSerialize,
[ 'id_evento' => $id_event ]
);
// If update results failed
if (empty($result) === true || $result === false) {
returnError(
'failed_event_update',
__('Failed event update')
);
return false;
} else {
returnData('string', ['data' => 'Event updated']);
}
return;
}
/**
*
* @param $trash1

View File

@ -699,6 +699,7 @@ function flot_slicesbar_graph(
'show' => $show,
'return_img_base_64' => true,
'date_to' => $date_to,
'server_id' => $server_id,
];
$graph = '<img src="data:image/jpg;base64,';
@ -738,7 +739,7 @@ function flot_slicesbar_graph(
$maxticks = (int) 20;
if ($sizeForTicks === false) {
$maxticks = (int) 20;
$maxticks = (int) 12;
} else if ($sizeForTicks < 300) {
$maxticks = (int) 3;
} else if ($sizeForTicks < 600) {
@ -808,7 +809,23 @@ function flot_slicesbar_graph(
// Javascript code.
$return .= "<script type='text/javascript'>";
$return .= "//<![CDATA[\n";
$return .= "pandoraFlotSlicebar('$graph_id','$values','$datacolor','$legend',$intervaltick,'$fontpath',$fontsize,'$separator','$separator2',$id_agent,'$full_legend_date',$not_interactive, '$show', $datelimit, $server_id)";
$return .= "pandoraFlotSlicebar(
'$graph_id',
'$values',
'$datacolor',
'$legend',
$intervaltick,
'$fontpath',
$fontsize,
'$separator',
'$separator2',
$id_agent,
'$full_legend_date',
$not_interactive,
'$show',
$datelimit,
'$server_id'
)";
$return .= "\n//]]>";
$return .= '</script>';

View File

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

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.746
%define release 200615
%define release 200616
# 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.746
%define release 200615
%define release 200616
# 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.746
%define release 200615
%define release 200616
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

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

View File

@ -33,7 +33,7 @@ our @ISA = qw(Exporter);
# version: Defines actual version of Pandora Server for this module only
my $pandora_version = "7.0NG.746";
my $pandora_build = "200615";
my $pandora_build = "200616";
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.746
%define release 200615
%define release 200616
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.746"
PI_BUILD="200615"
PI_BUILD="200616"
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.746 PS200615";
my $version = "7.0NG.746 PS200616";
# 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.746 PS200615";
my $version = "7.0NG.746 PS200616";
# save program name for logging
my $progname = basename($0);