Merge remote-tracking branch 'origin/develop' into ent-5575-wizard-de-modulos-y-recon-by-steps

This commit is contained in:
fbsanchez 2020-04-06 11:05:18 +02:00
commit 2d4b977d26
38 changed files with 92 additions and 64 deletions

View File

@ -29,6 +29,7 @@ $CODEHOME/pandora_console/pandora_console.redhat.spec \
$CODEHOME/pandora_console/pandora_console.rhel7.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_server/pandora_server.redhat.spec \
$PANDHOME_ENT/pandora_agents/pandora_agent.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.redhat.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.rhel7.spec \
$PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.redhat.spec"

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix
Version: 7.0NG.744-200331
Version: 7.0NG.744-200406
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.744-200331"
pandora_version="7.0NG.744-200406"
echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
@ -79,7 +79,7 @@ cp Linux/pandora_agent.conf temp_package/etc/pandora/
cp -aRf man/man1/* temp_package/usr/share/man/man1/
# Relocate plugins to the final dir and delete
mv temp_package/usr/share/pandora_agent/plugins/* temp_package/etc/pandora/plugins
cp temp_package/usr/share/pandora_agent/plugins/* temp_package/etc/pandora/plugins
echo "Official plugins are placed on /etc/pandora/plugins" > temp_package/usr/share/pandora_agent/plugins/README

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.744"
PI_BUILD="200331"
PI_BUILD="200406"
OS_NAME=`uname -s`
FORCE=0

View File

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

View File

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

View File

@ -830,14 +830,7 @@ foreach ($modules as $module) {
$data[4] .= ui_print_help_tip(__('The policy modules of data type will only update their intervals when policy is applied.'), true);
}
if ($module['id_modulo'] == MODULE_DATA && $module['id_policy_module'] != 0) {
$module_description = utf8_decode($module['descripcion']);
} else {
$module_description = $module['descripcion'];
}
$data[5] = ui_print_truncate_text($module_description, 'description', false);
$data[5] = ui_print_truncate_text($module['descripcion'], 'description', false);
$data[6] = ui_print_status_image($status, htmlspecialchars($title), true);

View File

@ -696,7 +696,7 @@ foreach ($simple_alerts as $alert) {
$data[3] .= __('Agent');
$data[3] .= '</td>';
$data[3] .= '<td class="datos">';
$data[3] .= ui_print_truncate_text($agent_name, 'agent_small', false, true, true, '[&hellip;]');
$data[3] .= ui_print_truncate_text($alias, 'agent_small', false, true, true, '[&hellip;]');
$data[3] .= '</td>';
$data[3] .= '</tr>';
}

View File

@ -468,12 +468,12 @@ foreach ($info as $user_id => $user_info) {
$data[0] = '<a href="index.php?sec='.$sec.'&amp;sec2=godmode/users/configure_user&pure='.$pure.'&amp;id='.$user_id.'">'.$user_id.'</a>';
$data[1] = '<ul style="margin-top: 0 !important; margin-left: auto !important; padding-left: 10px !important; list-style-type: none !important;">';
$data[1] .= '<li><b>'.__('Name').':</b> '.$user_info['fullname'].'</li>';
$data[1] .= '<li>'.$user_info['fullname'].'</li>';
/*
$data[1] .= '<li><b>' . __('First name') . ':</b> ' . $user_info["firstname"] . '</li>';
$data[1] .= '<li><b>' . __('Last name') . ':</b> ' . $user_info["lastname"] . '</li>';*/
$data[1] .= '<li><b>'.__('Phone').':</b> '.$user_info['phone'].'</li>';
$data[1] .= '<li><b>'.__('E-mail').':</b> '.$user_info['email'].'</li>';
$data[1] .= '<li>'.$user_info['phone'].'</li>';
$data[1] .= '<li>'.$user_info['email'].'</li>';
$data[1] .= '</ul>';
$data[2] = ui_print_timestamp($user_info['last_connect'], true);

View File

@ -1004,14 +1004,8 @@ if (check_login()) {
$data[3] .= ' <a class="relations_details" href="ajax.php?page=operation/agentes/estado_monitores&get_relations_tooltip=1&id_agente_modulo='.$module['id_agente_modulo'].'">'.html_print_image('images/link2.png', true, ['id' => 'relations-details-'.$module['id_agente_modulo'], 'class' => 'img_help']).'</a> ';
}
$module_description = '';
if ($module['id_modulo'] == MODULE_DATA && $module['id_policy_module'] != 0) {
$module_description = utf8_decode($module['descripcion']);
} else {
$module_description = $module['descripcion'];
}
$data[4] = ui_print_string_substr($module_description, 60, true, 8);
$data[4] = ui_print_string_substr($module['descripcion'], 60, true, 8);
if ($module['datos'] != strip_tags($module['datos'])) {

View File

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

View File

@ -13541,6 +13541,9 @@ function api_get_module_graph($id_module, $thrash2, $other, $thrash4)
// 1 hour by default.
$graph_threshold = (!empty($other) && isset($other['data'][2]) && $other['data'][2]) ? $other['data'][2] : 0;
// Graph height when send email by alert
$height = (!empty($other) && isset($other['data'][3]) && $other['data'][3]) ? $other['data'][3] : null;
if (is_nan($graph_seconds) || $graph_seconds <= 0) {
// returnError('error_module_graph', __(''));
return;

View File

@ -3356,9 +3356,11 @@ function html_print_switch($attributes=[])
$attributes['style'] = '';
}
$disabled_class .= (bool) ($attributes['disabled']) ? ' p-slider-disabled' : '';
return "<label class='p-switch' style='".$attributes['style']."'>
<input type='checkbox' ".$html_expand.">
<span class='p-slider'></span>
<span class='p-slider".$disabled_class."'></span>
</label>";
}

View File

@ -916,7 +916,7 @@ function notifications_print_two_ways_select($info_selec, $users, $source_id)
function notifications_print_user_switch($source, $user, $label)
{
$status = notifications_get_user_label_status($source, $user, $label);
return html_print_switch(
$switch = html_print_switch(
[
'name' => $label,
'value' => $status['status'],
@ -925,6 +925,13 @@ function notifications_print_user_switch($source, $user, $label)
'id' => 'notifications-user-'.$source['id'].'-label-'.$label,
]
);
$data = [
'disabled' => !$status['enabled'],
'switch' => $switch,
];
return $data;
}

View File

@ -124,16 +124,16 @@ function treeview_printModuleTable($id_module, $server_data=false, $no_head=fals
$table->data['module_group'] = $row;
// Description
$module_description = '';
if ($module['id_modulo'] == MODULE_DATA && $module['id_policy_module'] != 0) {
$module_description = utf8_decode($module['descripcion']);
} else {
$module_description = $module['descripcion'];
}
$row = [];
$row['title'] = __('Description');
$row['data'] = ui_print_truncate_text($module_description, 'description', true, true, true, '[&hellip;]');
$row['data'] = ui_print_truncate_text(
$module['descripcion'];,
'description',
true,
true,
true,
'[&hellip;]'
);
$table->data['description'] = $row;
// Tags

View File

@ -458,10 +458,19 @@ function pandoraFlotHBars(
// v, axis;
function xFormatter(v) {
var label = parseFloat(v);
const unit_prefixes = ["K", "M", "G"];
var unit_prefix = "";
var i = 0;
while (label >= 1000 && i < 3) {
label = label / 1000;
unit_prefix = unit_prefixes[i];
i++;
}
var text = label.toLocaleString();
if (label >= 1000000) text = text.substring(0, 4) + "M";
else if (label >= 100000) text = text.substring(0, 3) + "K";
else if (label >= 1000) text = text.substring(0, 2) + "K";
text = text + unit_prefix;
return (
'<div style="font-size:' +

View File

@ -4656,6 +4656,10 @@ div#dialog_messages table th:last-child {
border-radius: 34px;
}
.p-slider-disabled {
background-color: #dfdfdf !important;
}
.p-slider:before {
position: absolute;
content: "";

View File

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

View File

@ -64,7 +64,10 @@ echo '<div id="user-notifications-wrapper" class="white_box table_div table_thre
<div class="table_th">'.__('Also receive an email').'</div>
</div>';
$sources = notifications_get_all_sources();
$sources = notifications_get_all_sources();
$disabled_flag = false;
foreach ($sources as $source) {
echo '<div class="table_tbody">';
$table_content = [
@ -72,12 +75,24 @@ foreach ($sources as $source) {
notifications_print_user_switch($source, $id, 'enabled'),
notifications_print_user_switch($source, $id, 'also_mail'),
];
$notifications_enabled = notifications_print_user_switch($source, $id, 'enabled');
$notifications_also_mail = notifications_print_user_switch($source, $id, 'also_mail');
if ($notifications_enabled['disabled'] == 1 || $notifications_also_mail['disabled'] == 1) {
$disabled_flag = true;
}
echo '<div class="table_td">'.$source['description'].'</div>';
echo '<div class="table_td">'.notifications_print_user_switch($source, $id, 'enabled').'</div>';
echo '<div class="table_td">'.notifications_print_user_switch($source, $id, 'also_mail').'</div>';
echo '<div class="table_td">'.$notifications_enabled['switch'].'</div>';
echo '<div class="table_td">'.$notifications_also_mail['switch'].'</div>';
echo '</div>';
}
if ($disabled_flag) {
echo '<span style="font-weight: bold; color: #ff0000;">Disabled controls have been set by the system administrator</span>';
}
echo '</div>';
// Print id user to handle it on js.

View File

@ -3,7 +3,7 @@
#
%define name pandorafms_console
%define version 7.0NG.744
%define release 200331
%define release 200406
# 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.744
%define release 200331
%define release 200406
# 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.744
%define release 200331
%define release 200406
%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.744-200331
Version: 7.0NG.744-200406
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.744-200331"
pandora_version="7.0NG.744-200406"
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.744";
my $pandora_build = "200331";
my $pandora_build = "200406";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash

View File

@ -1271,11 +1271,11 @@ sub pandora_execute_action ($$$$$$$$$;$) {
my $threshold = shift;
my $period = $hours * 3600; # Hours to seconds
if($threshold == 0){
$params->{"other"} = $period . '%7C0%7C0';
$params->{"other"} = $period . '%7C0%7C0%7C225';
$cid = 'module_graph_' . $hours . 'h';
}
else{
$params->{"other"} = $period . '%7C0%7C1';
$params->{"other"} = $period . '%7C0%7C1%7C225';
$cid = 'module_graphth_' . $hours . 'h';
}
@ -3917,7 +3917,7 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
'direccion' => $trap_agent,
'comentarios' => '',
'id_agente' => 0,
'id_grupo' => 0
'id_grupo' => $alert->{'id_group'}
);
}

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.744";
my $pandora_build = "200331";
my $pandora_build = "200406";
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.744
%define release 200331
%define release 200406
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.744"
PI_BUILD="200331"
PI_BUILD="200406"
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.744 PS200331";
my $version = "7.0NG.744 PS200406";
# 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.744 PS200331";
my $version = "7.0NG.744 PS200406";
# save program name for logging
my $progname = basename($0);