Merge branch 'develop' into ent-5935-Logs-de-la-consola-refactorizacion

This commit is contained in:
alejandro-campos 2020-06-19 12:22:28 +02:00
commit d64ff918d6
33 changed files with 173 additions and 57 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.746-200617
Version: 7.0NG.746-200619
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-200617"
pandora_version="7.0NG.746-200619"
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 => '200617';
use constant AGENT_BUILD => '200619';
# 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 200617
%define release 200619
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 200617
%define release 200619
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

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

View File

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

View File

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

View File

@ -43,7 +43,47 @@ if (empty($update_module_id)) {
$data = [];
$data[0] = __('Target IP').' '.ui_print_help_icon('wmi_module_tab', true);
$data[1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true);
if ($page == 'enterprise/godmode/policies/policy_modules') {
if ($ip_target != 'auto' && $ip_target != '') {
$custom_ip_target = $ip_target;
$ip_target = 'custom';
} else if ($ip_target == '') {
$ip_target = 'force_pri';
$custom_ip_target = '';
} else {
$custom_ip_target = '';
}
$target_ip_values = [];
$target_ip_values['auto'] = __('Auto');
$target_ip_values['force_pri'] = __('Force primary key');
$target_ip_values['custom'] = __('Custom');
$data[1] = html_print_select(
$target_ip_values,
'ip_target',
$ip_target,
'',
'',
'',
true,
false,
false,
'',
false,
'width:200px;'
);
$data[1] .= html_print_input_text('custom_ip_target', $custom_ip_target, '', 15, 60, true);
} else {
if ($ip_target == 'auto') {
$ip_target = agents_get_address($id_agente);
}
$data[1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true);
}
$data[2] = __('Namespace').ui_print_help_tip(__('Optional. WMI namespace. If unsure leave blank.'), true);
$data[3] = html_print_input_text(
'tcp_send',
@ -136,3 +176,21 @@ $data[3] = html_print_input_text(
);
push_table_simple($data, 'key_field');
?>
<script type="text/javascript">
$(document).ready (function () {
var custom_ip_target = "<?php echo $custom_ip_target; ?>";
if(custom_ip_target == ''){
$("#text-custom_ip_target").hide();
}
$('#ip_target').change(function() {
if($(this).val() == 'custom') {
$("#text-custom_ip_target").show();
}
else{
$("#text-custom_ip_target").hide();
}
});
});
</script>

View File

@ -471,7 +471,7 @@ foreach ($items as $item) {
if ($is_inventory_item) {
$external_source = json_decode($item['external_source'], true);
$agents = $external_source['id_agents'];
$modules = $external_source['inventory_modules'];
$modules = io_safe_output($external_source['inventory_modules']);
$agent_name_db = [];
foreach ($agents as $a) {

View File

@ -629,6 +629,16 @@ class DiscoveryTaskList extends HTML
$data[6] .= __('Discovery.App.Oracle');
break;
case DISCOVERY_APP_DB2:
// Discovery Applications DB2.
$data[6] = html_print_image(
'images/network.png',
true,
['title' => __('Discovery Applications DB2')]
).'&nbsp;&nbsp;';
$data[6] .= __('Discovery.App.DB2');
break;
case DISCOVERY_DEPLOY_AGENTS:
// Internal deployment task.
$no_operations = true;
@ -722,6 +732,8 @@ class DiscoveryTaskList extends HTML
if ($task['disabled'] != 2 && $task['utimestamp'] > 0
&& $task['type'] != DISCOVERY_APP_MYSQL
&& $task['type'] != DISCOVERY_APP_ORACLE
&& $task['type'] != DISCOVERY_APP_DB2
&& $task['type'] != DISCOVERY_APP_SAP
&& $task['type'] != DISCOVERY_CLOUD_AWS_RDS
) {
if (check_acl($config['id_user'], 0, 'MR')) {
@ -879,6 +891,9 @@ class DiscoveryTaskList extends HTML
case DISCOVERY_APP_ORACLE:
return 'wiz=app&mode=oracle&page=0';
case DISCOVERY_APP_DB2:
return 'wiz=app&mode=DB2&page=0';
case DISCOVERY_CLOUD_AWS:
case DISCOVERY_CLOUD_AWS_EC2:
return 'wiz=cloud&mode=amazonws&ki='.$task['auth_strings'].'&page=1';

View File

@ -85,7 +85,7 @@ function process_user_login($login, $pass, $api=false)
return process_user_login_local($login, $pass, $api);
} else {
$login_remote = process_user_login_remote($login, io_safe_output($pass), $api);
if ($login_remote == false) {
if ($login_remote == false && $config['fallback_local_auth']) {
return process_user_login_local($login, $pass, $api);
} else {
return $login_remote;
@ -258,27 +258,32 @@ function process_user_login_remote($login, $pass, $api=false)
return false;
}
if (($config['auth'] === 'ad')
&& (isset($config['ad_advanced_config']) && $config['ad_advanced_config'])
) {
$return = enterprise_hook(
'prepare_permissions_groups_of_user_ad',
[
$login,
$pass,
false,
true,
defined('METACONSOLE'),
]
);
if (($config['auth'] === 'ad')) {
// Check if autocreate remote users is active.
if ($config['autocreate_remote_users'] == 1) {
change_local_user_pass_ldap($login, $pass);
}
if ($return === 'error_permissions') {
$config['auth_error'] = __('Problems with configuration permissions. Please contact with Administrator');
return false;
} else {
if ($return === 'permissions_changed') {
$config['auth_error'] = __('Your permissions have changed. Please, login again.');
if (isset($config['ad_advanced_config']) && $config['ad_advanced_config']) {
$return = enterprise_hook(
'prepare_permissions_groups_of_user_ad',
[
$login,
$pass,
false,
true,
defined('METACONSOLE'),
]
);
if ($return === 'error_permissions') {
$config['auth_error'] = __('Problems with configuration permissions. Please contact with Administrator');
return false;
} else {
if ($return === 'permissions_changed') {
$config['auth_error'] = __('Your permissions have changed. Please, login again.');
return false;
}
}
}
} else if ($config['auth'] === 'ldap') {

View File

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

View File

@ -601,6 +601,7 @@ define('DISCOVERY_CLOUD_AWS_RDS', 7);
define('DISCOVERY_CLOUD_AZURE_COMPUTE', 8);
define('DISCOVERY_DEPLOY_AGENTS', 9);
define('DISCOVERY_APP_SAP', 10);
define('DISCOVERY_APP_DB2', 11);
// Force task build tmp results.

View File

@ -160,7 +160,7 @@ function reporting_make_reporting_data(
$return = [];
if (!empty($report)) {
$contents = $report['contents'];
$contents = io_safe_output($report['contents']);
} else {
$report = io_safe_output(db_get_row('treport', 'id_report', $id_report));
$contents = io_safe_output(
@ -2236,7 +2236,7 @@ function reporting_inventory($report, $content, $type)
$es = json_decode($content['external_source'], true);
$id_agent = $es['id_agents'];
$module_name = $es['inventory_modules'];
$module_name = io_safe_input($es['inventory_modules']);
if (empty($module_name)) {
$module_name = [0 => 0];
}
@ -6147,7 +6147,13 @@ function reporting_advanced_sla(
$time_total += $time_interval;
if ($time_interval > 0) {
$total_checks++;
if (isset($current_data['type']) === false
|| ((int) $current_data['type'] === 0
&& $i !== 0)
) {
$total_checks++;
}
if ((isset($current_data['datos']))
&& ($current_data['datos'] !== false)
) {
@ -6159,7 +6165,7 @@ function reporting_advanced_sla(
$match = preg_match('/'.$max_value.'/', $current_data['datos']);
}
// Take notice of $inverse_interval value,
// Take notice of $inverse_interval value.
if ($inverse_interval == 0) {
$sla_check_value = $match;
} else {
@ -6176,19 +6182,41 @@ function reporting_advanced_sla(
// Not unknown nor not init values.
if ($sla_check_value) {
$ok_checks++;
if (isset($current_data['type']) === false
|| ((int) $current_data['type'] === 0
&& $i !== 0)
) {
$ok_checks++;
}
$time_in_ok += $time_interval;
} else {
$bad_checks++;
if (isset($current_data['type']) === false
|| ((int) $current_data['type'] === 0
&& $i !== 0)
) {
$bad_checks++;
}
$time_in_error += $time_interval;
}
} else {
if ($current_data['datos'] === null) {
$time_in_unknown += $time_interval;
$unknown_checks++;
if (isset($current_data['type']) === false
|| ((int) $current_data['type'] === 0
&& $i !== 0)
) {
$unknown_checks++;
}
} else if ($current_data['datos'] === false) {
$time_in_not_init += $time_interval;
$not_init_checks++;
if (isset($current_data['type']) === false
|| ((int) $current_data['type'] === 0
&& $i !== 0)
) {
$not_init_checks++;
}
}
}
}

View File

@ -159,7 +159,7 @@ function snmp_browser_get_html_tree(
$status = (!empty($checked) && isset($checked[$level]));
$output .= html_print_checkbox($checkbox_name, 0, $status, true, false, '').'&nbsp;<span>'.$level.'</span>';
if (isset($sub_level['__VALUE__'])) {
$output .= '<span class="value" style="display: none;">&nbsp;=&nbsp;'.$sub_level['__VALUE__'].'</span>';
$output .= '<span class="value" style="display: none;">&nbsp;=&nbsp;'.io_safe_input($sub_level['__VALUE__']).'</span>';
}
$output .= '</li>';

View File

@ -129,7 +129,7 @@
<div style='height: 10px'>
<?php
$version = '7.0NG.746';
$build = '200617';
$build = '200619';
$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 200617
%define release 200619
# 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 200617
%define release 200619
# 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 200617
%define release 200619
%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-200617
Version: 7.0NG.746-200619
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-200617"
pandora_version="7.0NG.746-200619"
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 = "200617";
my $pandora_build = "200619";
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 = "200617";
my $pandora_build = "200619";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -40,6 +40,7 @@ use constant {
DISCOVERY_CLOUD_AZURE_COMPUTE => 8,
DISCOVERY_DEPLOY_AGENTS => 9,
DISCOVERY_APP_SAP => 10,
DISCOVERY_APP_DB2 => 11,
DISCOVERY_REVIEW => 0,
DISCOVERY_STANDARD => 1,
DISCOVERY_RESULTS => 2,
@ -1661,6 +1662,9 @@ sub database_scan($$$) {
# Skip database scan in Oracle tasks
next if defined($self->{'type'}) && $self->{'type'} == DISCOVERY_APP_ORACLE;
# Skip database scan in DB2 tasks
next if defined($self->{'type'}) && $self->{'type'} == DISCOVERY_APP_DB2;
my $__data = $obj->scan_databases();
if (ref($__data) eq "ARRAY") {
@ -1705,6 +1709,8 @@ sub app_scan($) {
$type = 'MySQL';
} elsif ($self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE) {
$type = 'Oracle';
} elsif ($self->{'task_data'}->{'type'} == DISCOVERY_APP_DB2) {
$type = 'DB2';
} elsif ($self->{'task_data'}->{'type'} == DISCOVERY_APP_SAP) {
$type = 'SAP';
} else {
@ -1787,7 +1793,9 @@ sub app_scan($) {
# Scan connected obj.
if ( $self->{'task_data'}->{'type'} == DISCOVERY_APP_MYSQL
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE) {
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_DB2
) {
# Database.
$results = $self->database_scan($type, $obj, $global_percent, \@targets);
@ -1894,6 +1902,7 @@ sub scan($) {
if (defined($self->{'task_data'})) {
if ( $self->{'task_data'}->{'type'} == DISCOVERY_APP_MYSQL
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_ORACLE
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_DB2
|| $self->{'task_data'}->{'type'} == DISCOVERY_APP_SAP) {
# Application scan.
$self->call('message', "Scanning application ...", 6);

View File

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

View File

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

View File

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