Merge branch 'develop' into ent-7308-version-del-agente-satelite-y-servidor-en-linea-de-comando

This commit is contained in:
Ramon Novoa 2021-05-12 10:01:52 +02:00
commit 83822395f6
39 changed files with 152 additions and 59 deletions

View File

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

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

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.754"
PI_BUILD="210510"
PI_BUILD="210511"
OS_NAME=`uname -s`
FORCE=0
@ -152,8 +152,8 @@ uninstall () {
fi
# Stops the agent on uninstall
if [ -f $PANDORA_BASE/etc/init.d/pandora_agent_daemon ]; then
$PANDORA_BASE/etc/init.d/pandora_agent_daemon stop 12> /dev/null
if [ -f /etc/init.d/pandora_agent_daemon ]; then
/etc/init.d/pandora_agent_daemon stop 12> /dev/null
else
echo "$PANDORA_BASE/etc/init.d/pandora_agent_daemon not found to stop agent"
fi

View File

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

View File

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

View File

@ -641,8 +641,8 @@ echo '<legend>'.__('Mail configuration').'</legend>';
$table_mail_test->width = '100%';
$table_mail_test->class = 'databox filters';
$table_mail_test->data = [];
$table_mail_test->style[0] = 'font-weight: bold';
$table_mail_test->colspan[1][0] = 2;
$table_mail_test->style[0] = 'font-weight: bold;';
$table_mail_test->style[1] = 'font-weight: bold;display: flex;height: 54px;align-items: center;';
$table_mail_test->data[0][0] = __('Address');
$table_mail_test->data[0][1] = html_print_input_text(
@ -661,7 +661,9 @@ echo '<legend>'.__('Mail configuration').'</legend>';
'',
'class="sub next"',
true
).'&nbsp&nbsp<span id="email_test_sent_message" class="invisible">Email sent</span><span id="email_test_failure_message" class=invisible">Email could not be sent</span>';
);
$table_mail_test->data[1][1] = '&nbsp&nbsp<span id="email_test_sent_message" class="invisible"><b>Email sent</b></span><span id="email_test_failure_message" class=invisible"><b>Email could not be sent</b></span>';
echo '<div id="email_test_'.$id.'" title="'.__('Check mail configuration').'" class="invisible">'.html_print_table($table_mail_test, true).'</div>';
}
@ -703,6 +705,9 @@ function show_email_test(id) {
}
function perform_email_test () {
$('#email_test_sent_message').hide();
$('#email_test_failure_message').hide();
var test_address = $('#text-email_test_address').val();
$.ajax({
@ -713,12 +718,15 @@ function perform_email_test () {
success: function(data) {
if (parseInt(data) === 1) {
$('#email_test_sent_message').show();
$('#email_test_failure_message').hide();
} else {
$('#email_test_failure_message').show();
$('#email_test_sent_message').hide();
}
},
error: function() {
$('#email_test_failure_message').show();
$('#email_test_sent_message').hide();
},
});
}

View File

@ -282,7 +282,7 @@ $table_remote->data['integria_pass'] = $row;
// Integria hostname.
$row = [];
$row['name'] = __('API Hostname');
$row['name'] = __('URL to Integria IMS setup').ui_print_help_tip(__('Full URL to your Integria IMS setup (e.g., http://192.168.1.20/integria, https://support.mycompany.com).'), true);
$row['control'] = html_print_input_text('integria_hostname', $config['integria_hostname'], '', 30, 100, true);
$table_remote->data['integria_hostname'] = $row;
@ -329,22 +329,20 @@ $row['control'] = html_print_input_text(
true,
false,
false
).ui_print_help_icon('alert_macros', true);
);
$table_alert_settings->data['custom_response_incident_title'] = $row;
// Alert incident description.
$row = [];
$row['name'] = __('Description');
$row['control'] = html_print_input_text(
$row['name'] = __('Ticket body');
$row['control'] = html_print_textarea(
'incident_content',
7,
25,
$config['incident_content'],
'',
50,
100,
true,
false,
false
).ui_print_help_icon('alert_macros', true);
true
);
$table_alert_settings->data['custom_response_incident_content'] = $row;
// Alert default group.
@ -452,22 +450,21 @@ $row['control'] = html_print_input_text(
true,
false,
false
).ui_print_help_icon('response_macros', true);
);
$table_cr_settings->data['custom_response_incident_title'] = $row;
// Custom response incident description.
$row = [];
$row['name'] = __('Description');
$row['control'] = html_print_input_text(
$row['name'] = __('Ticket body');
$row['control'] = html_print_textarea(
'cr_incident_content',
7,
25,
$config['cr_incident_content'],
'',
50,
100,
true,
false,
false
).ui_print_help_icon('response_macros', true);
true
);
$table_cr_settings->data['custom_response_incident_content'] = $row;
// Custom response default group.
@ -599,7 +596,7 @@ if ($has_connection != false) {
// Form alert default settings.
echo '<div id="form_alert_settings">';
echo '<fieldset>';
echo '<legend>'.__('Alert default values').'</legend>';
echo '<legend>'.__('Alert default values').'&nbsp'.ui_print_help_icon('alert_macros', true).'</legend>';
html_print_table($table_alert_settings);
@ -609,7 +606,7 @@ if ($has_connection != false) {
// Form custom response default settings.
echo '<div id="form_custom_response_settings">';
echo '<fieldset>';
echo '<legend>'.__('Event custom response default values').'</legend>';
echo '<legend>'.__('Event custom response default values').'&nbsp'.ui_print_help_icon('alert_macros', true).'</legend>';
html_print_table($table_cr_settings);

View File

@ -286,7 +286,11 @@ class Diagnostics extends Wizard
$return .= '</div>';
}
return false;
if ($this->pdf === true) {
return $return;
} else {
return false;
}
}
@ -1599,7 +1603,7 @@ class Diagnostics extends Wizard
}
}
return true;
return $result;
}

View File

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

View File

@ -3792,7 +3792,7 @@ function events_page_responses($event, $childrens_ids=[])
$('.params_rows').remove();
$('#responses_table')
.append('<tr class=\"params_rows\"><td>".__('Description')."</td><td class=\"left height_30px\" colspan=\"2\">'+description+'</td></tr>');
.append('<tr class=\"params_rows\"><td>".__('Description')."</td><td class=\"height_30px\" colspan=\"2\">'+description+'</td></tr>');
if (params.length == 1 && params[0] == '') {
return;

View File

@ -188,7 +188,7 @@ function integria_api_call($api_hostname, $user, $user_pass, $api_pass, $operati
}
// Build URL for API request.
$url = $api_hostname.'/integria/include/api.php';
$url = $api_hostname.'/include/api.php';
// ob_start();
// $out = fopen('php://output', 'w');

View File

@ -42,6 +42,7 @@ require_once $config['homedir'].'/include/functions_users.php';
enterprise_include_once('include/functions_reporting.php');
enterprise_include_once('include/functions_metaconsole.php');
enterprise_include_once('include/functions_inventory.php');
enterprise_include_once('include/functions_cron.php');
require_once $config['homedir'].'/include/functions_forecast.php';
require_once $config['homedir'].'/include/functions_ui.php';
require_once $config['homedir'].'/include/functions_netflow.php';
@ -13948,3 +13949,69 @@ function reporting_module_histogram_graph($report, $content, $pdf=0)
return reporting_check_structure_content($return);
}
/**
* Email template for sending reports.
*
* @param string $subjectEmail Subject of email.
* @param string $bodyEmail Body of email.
* @param string $scheduled Id of schedule report.
* @param string $reportName Report name.
* @param string $email Serialized list of destination emails.
* @param array $attachments Attachments.
*
* @return void
*/
function reporting_email_template(
string $subjectEmail='',
string $bodyEmail='',
string $scheduled='',
string $reportName='',
string $email='',
array $attachments=null
) {
// Subject.
$subject = (empty($subjectEmail) === true) ? '[Pandora] '.__('Reports') : $subjectEmail;
// Body.
if (empty($bodyEmail) === true) {
$body = __('Greetings').',';
$body .= '<p />';
$body .= __('Attached to this email there\'s a PDF file of the').' ';
$body .= $scheduled.' '.__('report');
$body .= ' <strong>"'.$reportName.'"</strong>';
$body .= '<p />';
$body .= __('Generated at').' '.date('Y/m/d H:i:s');
$body .= '<p />';
$body .= __('Thanks for your time.');
$body .= '<p />';
$body .= __('Best regards, Pandora FMS');
$body .= '<p />';
$body .= '<em>'.__('This is an automatically generated email from Pandora FMS, please do not reply.').'</em>';
} else {
$bodyEmail = str_replace(
[
"\r\n",
"\r",
'&#x0d;&#x0a;',
],
"\n",
$bodyEmail
);
$body = '<p>'.implode("</p>\n<p>", explode("\n", $bodyEmail)).'</p>';
}
// Extract list of emails.
$destinationEmails = explode(',', io_safe_output($email));
foreach ($destinationEmails as $destination) {
$destination = trim($destination);
// Skip the empty 'to'.
if (empty($destination) === false) {
send_email_attachment($destination, $body, $subject, $attachments);
} else {
db_pandora_audit('ERROR:', 'Cron jobs mail, empty destination email.');
}
}
}

View File

@ -48,6 +48,8 @@ function show_event_dialog(event, dialog_page, result) {
resizable: true,
draggable: true,
modal: true,
minWidth: 710,
minHeight: 600,
close: function() {
$("#refrcounter").countdown("resume");
$("div.vc-countdown").countdown("resume");

View File

@ -19,6 +19,7 @@
.dataTables_wrapper {
min-height: 150px;
margin-bottom: 20px;
}
.datatables-td-title {

View File

@ -8500,3 +8500,8 @@ div.stat-win-spinner img {
.font_11pt {
font-size: 11pt;
}
.checkbox-random-name {
width: 100px !important;
margin-left: 20px;
}

View File

@ -387,7 +387,6 @@ table#diagnostic_info tbody td div {
color: #fff;
}
.ui-widget-content.ui-autocomplete,
.ui-widget-content.ui-autocomplete a {
color: #333;
}

View File

@ -220,7 +220,8 @@ echo '<head>'."\n";
// This starts the page head. In the callback function,
// $page['head'] array content will be processed into the head.
ob_start('ui_process_page_head');
// Avoid clickjacking.
header('X-Frame-Options: SAMEORIGIN');
// Enterprise main.
enterprise_include_once('index.php');

View File

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

View File

@ -244,6 +244,10 @@ if ($ag_modulename != '') {
$sql_conditions .= " AND tagente_modulo.nombre LIKE '%".$ag_modulename."%'";
}
if ($id_module) {
$sql_conditions .= sprintf(' AND tagente_modulo.id_agente_modulo = \'%d\'', $id_module);
}
if ($module_option !== 0) {
if ($module_option == 1) {
// Only enabled

View File

@ -159,7 +159,9 @@ if ($upload_file && ($_FILES['userfile']['name'] != '')) {
$filecontent = base64_encode(file_get_contents($_FILES['userfile']['tmp_name']));
$result_api_call = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'attach_file', [$incident_id, $filename, $filesize, $filedescription, $filecontent], false, '', ';');
$filename = str_replace('&#x20;', '+', $filename);
$result_api_call = integria_api_call($config['integria_hostname'], $config['integria_user'], $config['integria_pass'], $config['integria_api_pass'], 'attach_file', [$incident_id, $filename, $filesize, $filedescription, $filecontent], false, '', '|;|');
// API method returns '0' string if success.
$file_added = ($result_api_call === '0') ? true : false;
@ -485,4 +487,4 @@ $(document).ready (function () {
});
});
</script>
</script>

View File

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

View File

@ -1339,6 +1339,9 @@ sub pandora_execute_action ($$$$$$$$$;$) {
my $cid_data = "CID_IMAGE";
my $dataname = "CID_IMAGE.png";
# Decode ampersand. Used for macros with encoded names.
$field3 =~ s/&amp;/&/g;
if (defined($data) && $data =~ /^data:image\/png;base64, /) {
# macro _data_ substitution in case is image.
$attach_data_as_image = 1;

View File

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

View File

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

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.754"
PI_BUILD="210510"
PI_BUILD="210511"
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.754 Build 210510";
my $version = "7.0NG.754 Build 210511";
# 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.754 PS210510";
my $version = "7.0NG.754 PS210511";
# save program name for logging
my $progname = basename($0);