oMerge branch 'develop' into ent-8224-Se-puede-crear/editar/borrar-un-grupo-desde-el-CLI-en-nodo-centralizado

This commit is contained in:
Daniel Maya 2021-11-24 17:36:48 +01:00
commit 3cc3cef7fa
28 changed files with 113 additions and 40 deletions

View File

@ -1,5 +1,5 @@
package: pandorafms-agent-unix package: pandorafms-agent-unix
Version: 7.0NG.758.1 Version: 7.0NG.758.1-211124
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.758.1" pandora_version="7.0NG.758.1-211124"
echo "Test if you has the tools for to make the packages." echo "Test if you has the tools for to make the packages."
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null

View File

@ -1015,7 +1015,7 @@ my $Sem = undef;
my $ThreadSem = undef; my $ThreadSem = undef;
use constant AGENT_VERSION => '7.0NG.758.1'; use constant AGENT_VERSION => '7.0NG.758.1';
use constant AGENT_BUILD => '211123'; use constant AGENT_BUILD => '211124';
# Agent log default file size maximum and instances # Agent log default file size maximum and instances
use constant DEFAULT_MAX_LOG_SIZE => 600000; use constant DEFAULT_MAX_LOG_SIZE => 600000;

View File

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

View File

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

View File

@ -10,7 +10,7 @@
# ********************************************************************** # **********************************************************************
PI_VERSION="7.0NG.758.1" PI_VERSION="7.0NG.758.1"
PI_BUILD="211123" PI_BUILD="211124"
OS_NAME=`uname -s` OS_NAME=`uname -s`
FORCE=0 FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{} {}
Version Version
{211123} {211124}
ViewReadme ViewReadme
{Yes} {Yes}
@ -2387,7 +2387,7 @@ Windows,BuildSeparateArchives
{No} {No}
Windows,Executable Windows,Executable
{<%AppName%>-Setup<%Ext%>} {<%AppName%>-<%Version%>-Setup<%Ext%>}
Windows,FileDescription Windows,FileDescription
{<%AppName%> <%Version%> Setup} {<%AppName%> <%Version%> Setup}

View File

@ -30,7 +30,7 @@ using namespace Pandora;
using namespace Pandora_Strutils; using namespace Pandora_Strutils;
#define PATH_SIZE _MAX_PATH+1 #define PATH_SIZE _MAX_PATH+1
#define PANDORA_VERSION ("7.0NG.758.1 Build 211123") #define PANDORA_VERSION ("7.0NG.758.1 Build 211124")
string pandora_path; string pandora_path;
string pandora_dir; string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Artica ST" VALUE "LegalCopyright", "Artica ST"
VALUE "OriginalFilename", "PandoraAgent.exe" VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent" VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.758.1(Build 211123))" VALUE "ProductVersion", "(7.0NG.758.1(Build 211124))"
VALUE "FileVersion", "1.0.0.0" VALUE "FileVersion", "1.0.0.0"
END END
END END

View File

@ -1,5 +1,5 @@
package: pandorafms-console package: pandorafms-console
Version: 7.0NG.758.1 Version: 7.0NG.758.1-211124
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.758.1" pandora_version="7.0NG.758.1-211124"
package_pear=0 package_pear=0
package_pandora=1 package_pandora=1

View File

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

View File

@ -1574,7 +1574,9 @@ function graphic_combined_module(
$date_array['final_date'] = $params['date']; $date_array['final_date'] = $params['date'];
$date_array['start_date'] = ($params['date'] - $params['period']); $date_array['start_date'] = ($params['date'] - $params['period']);
$server_name = metaconsole_get_server_by_id($modules[0]['server']); if (is_metaconsole()) {
$server_name = metaconsole_get_server_by_id($modules[0]['server']);
}
if ($params_combined['projection']) { if ($params_combined['projection']) {
$output_projection = forecast_projection_graph( $output_projection = forecast_projection_graph(

View File

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

View File

@ -78,6 +78,10 @@ $integria_types_csv = integria_api_call(null, null, null, null, 'get_types');
get_array_from_csv_data_pair($integria_types_csv, $integria_types_values); get_array_from_csv_data_pair($integria_types_csv, $integria_types_values);
$integria_resolution_csv = integria_api_call(null, null, null, null, 'get_incidents_resolutions');
get_array_from_csv_data_pair($integria_resolution_csv, $integria_resolution_values);
$event_id = (int) get_parameter('from_event'); $event_id = (int) get_parameter('from_event');
$incident_id_edit = (int) get_parameter('incident_id'); $incident_id_edit = (int) get_parameter('incident_id');
$create_incident = (bool) get_parameter('create_incident', 0); $create_incident = (bool) get_parameter('create_incident', 0);
@ -88,6 +92,7 @@ $incident_owner = get_parameter('owner');
$incident_type = (int) get_parameter('type'); $incident_type = (int) get_parameter('type');
$incident_creator = get_parameter('creator'); $incident_creator = get_parameter('creator');
$incident_status = (int) get_parameter('status'); $incident_status = (int) get_parameter('status');
$incident_resolution = (int) get_parameter('resolution');
$incident_title = events_get_field_value_by_event_id($event_id, get_parameter('incident_title')); $incident_title = events_get_field_value_by_event_id($event_id, get_parameter('incident_title'));
$incident_content = events_get_field_value_by_event_id($event_id, get_parameter('incident_content')); $incident_content = events_get_field_value_by_event_id($event_id, get_parameter('incident_content'));
$file_description = get_parameter('file_description'); $file_description = get_parameter('file_description');
@ -98,8 +103,13 @@ $incident_content = str_replace(',', ':::', $incident_content);
// Perform action. // Perform action.
if ($create_incident === true) { if ($create_incident === true) {
// Disregard incident resolution unless status is 'closed'.
if ($incident_status !== 7) {
$incident_resolution = 0;
}
// Call Integria IMS API method to create an incident. // Call Integria IMS API method to create an incident.
$result_api_call = integria_api_call(null, null, null, null, 'create_incident', [$incident_title, $incident_group_id, $incident_criticity_id, $incident_content, '', $incident_type, '', $incident_owner, '0', $incident_status], false, '', ','); $result_api_call = integria_api_call(null, null, null, null, 'create_incident', [$incident_title, $incident_group_id, $incident_criticity_id, $incident_content, '', $incident_type, '', $incident_owner, '0', $incident_status, '', $incident_resolution], false, '', ',');
if ($userfile !== '' && $result_api_call !== false) { if ($userfile !== '' && $result_api_call !== false) {
integriaims_upload_file('userfile', $result_api_call, $file_description); integriaims_upload_file('userfile', $result_api_call, $file_description);
@ -114,8 +124,13 @@ if ($create_incident === true) {
__('Could not be created in Integria IMS') __('Could not be created in Integria IMS')
); );
} else if ($update_incident === true) { } else if ($update_incident === true) {
// Disregard incident resolution unless status is 'closed'.
if ($incident_status !== 7) {
$incident_resolution = 0;
}
// Call Integria IMS API method to update an incident. // Call Integria IMS API method to update an incident.
$result_api_call = integria_api_call(null, null, null, null, 'update_incident', [$incident_id_edit, $incident_title, $incident_content, '', $incident_group_id, $incident_criticity_id, 0, $incident_status, $incident_owner, 0, $incident_type], false, '', ','); $result_api_call = integria_api_call(null, null, null, null, 'update_incident', [$incident_id_edit, $incident_title, $incident_content, '', $incident_group_id, $incident_criticity_id, $incident_resolution, $incident_status, $incident_owner, 0, $incident_type], false, '', ',');
if ($userfile !== '') { if ($userfile !== '') {
integriaims_upload_file('userfile', $incident_id_edit, $file_description); integriaims_upload_file('userfile', $incident_id_edit, $file_description);
@ -161,8 +176,8 @@ $table->style[0] = 'width: 33%; padding-right: 50px; padding-left: 100px;';
$table->style[1] = 'width: 33%; padding-right: 50px; padding-left: 50px;'; $table->style[1] = 'width: 33%; padding-right: 50px; padding-left: 50px;';
$table->style[2] = 'width: 33%; padding-right: 100px; padding-left: 50px;'; $table->style[2] = 'width: 33%; padding-right: 100px; padding-left: 50px;';
$table->colspan[0][0] = 2; $table->colspan[0][0] = 2;
$table->colspan[3][0] = 3; $table->colspan[4][0] = 3;
$table->colspan[5][0] = 3; $table->colspan[6][0] = 3;
$help_macros = isset($_GET['from_event']) ? ui_print_help_icon('response_macros', true) : ''; $help_macros = isset($_GET['from_event']) ? ui_print_help_icon('response_macros', true) : '';
@ -174,6 +189,7 @@ if ($update) {
$input_value_criticity = $incident_details[7]; $input_value_criticity = $incident_details[7];
$input_value_owner = $incident_details[5]; $input_value_owner = $incident_details[5];
$input_value_content = $incident_details[4]; $input_value_content = $incident_details[4];
$input_value_resolution = $incident_details[12];
} else if (isset($_GET['from_event'])) { } else if (isset($_GET['from_event'])) {
$input_value_title = $config['cr_incident_title']; $input_value_title = $config['cr_incident_title'];
$input_value_type = $config['cr_incident_type']; $input_value_type = $config['cr_incident_type'];
@ -182,6 +198,7 @@ if ($update) {
$input_value_criticity = $config['cr_default_criticity']; $input_value_criticity = $config['cr_default_criticity'];
$input_value_owner = $config['cr_default_owner']; $input_value_owner = $config['cr_default_owner'];
$input_value_content = $config['cr_incident_content']; $input_value_content = $config['cr_incident_content'];
$input_value_resolution = 0;
} else { } else {
$input_value_title = ''; $input_value_title = '';
$input_value_type = ''; $input_value_type = '';
@ -190,6 +207,7 @@ if ($update) {
$input_value_criticity = ''; $input_value_criticity = '';
$input_value_owner = ''; $input_value_owner = '';
$input_value_content = ''; $input_value_content = '';
$input_value_resolution = 0;
} }
$table->data[0][0] = '<div class="label_select"><p class="input_label">'.__('Title').':&nbsp'.$help_macros.'</p>'; $table->data[0][0] = '<div class="label_select"><p class="input_label">'.__('Title').':&nbsp'.$help_macros.'</p>';
@ -303,8 +321,26 @@ $table->data[2][2] .= '<div class="label_select_parent">'.html_print_autocomplet
'w100p' 'w100p'
).'</div>'; ).'</div>';
$table->data[3][0] = '<div class="label_select"><p class="input_label">'.__('Description').':&nbsp'.$help_macros.'</p>';
$table->data[3][0] .= '<div class="label_select_parent">'.html_print_textarea( $table->data[3][0] = '<div class="label_select"><p class="input_label">'.__('Resolution').': </p>';
$table->data[3][0] .= '<div class="label_select_parent">'.html_print_select(
$integria_resolution_values,
'resolution',
$input_value_resolution,
'',
'',
1,
true,
false,
true,
'',
false,
'width: 100%;'
).'</div>';
$table->data[4][0] = '<div class="label_select"><p class="input_label">'.__('Description').':&nbsp'.$help_macros.'</p>';
$table->data[4][0] .= '<div class="label_select_parent">'.html_print_textarea(
'incident_content', 'incident_content',
3, 3,
20, 20,
@ -313,10 +349,10 @@ $table->data[3][0] .= '<div class="label_select_parent">'.html_print_textarea(
true true
).'</div>'; ).'</div>';
$table->data[4][0] = '<div class="label_select"><p class="input_label">'.__('File name').':</p>'; $table->data[5][0] = '<div class="label_select"><p class="input_label">'.__('File name').':</p>';
$table->data[4][0] .= html_print_input_file('userfile', true); $table->data[5][0] .= html_print_input_file('userfile', true);
$table->data[5][0] = '<div class="label_select"><p class="input_label">'.__('Attachment description').':</p>'; $table->data[6][0] = '<div class="label_select"><p class="input_label">'.__('Attachment description').':</p>';
$table->data[5][0] .= html_print_textarea( $table->data[6][0] .= html_print_textarea(
'file_description', 'file_description',
3, 3,
20, 20,
@ -345,3 +381,32 @@ if ($update) {
} }
echo '</div>'; echo '</div>';
?>
<script type="text/javascript">
$(document).ready(function () {
$('#add_alert_table-3').hide();
var input_value_status =
<?php
$status_value = ($input_value_status === '') ? 0 : $input_value_status;
echo $status_value;
?>
;
if (input_value_status === 7) {
$('#add_alert_table-3').show();
} else {
$('#add_alert_table-3').hide();
}
$('#status').on('change', function() {
if ($(this).val() === '7') {
$('#add_alert_table-3').show();
} else {
$('#add_alert_table-3').hide();
}
});
});
</script>

View File

@ -48,7 +48,7 @@ if ($id_graph !== 0) {
} }
} }
// Delete module SQL code // Delete module SQL code.
if ($delete_graph) { if ($delete_graph) {
if (check_acl($config['id_user'], 0, 'AW')) { if (check_acl($config['id_user'], 0, 'AW')) {
$res = db_process_sql_delete('tgraph_source', ['id_graph' => $id_graph]); $res = db_process_sql_delete('tgraph_source', ['id_graph' => $id_graph]);
@ -239,7 +239,7 @@ if ($view_graph) {
] ]
).'</a>'; ).'</a>';
// In full screen, the manage options are not available // In full screen, the manage options are not available.
$options = [ $options = [
'view' => $options['view'], 'view' => $options['view'],
'screen' => $options['screen'], 'screen' => $options['screen'],
@ -277,6 +277,12 @@ if ($view_graph) {
'fullscale' => $fullscale, 'fullscale' => $fullscale,
]; ];
if ($stacked === CUSTOM_GRAPH_AREA || $stacked === CUSTOM_GRAPH_STACKED_AREA) {
$params['type_graph'] = 'area';
} else if ($stacked === CUSTOM_GRAPH_LINE || $stacked === CUSTOM_GRAPH_STACKED_LINE) {
$params['type_graph'] = 'line';
}
$params_combined = [ $params_combined = [
'stacked' => $stacked, 'stacked' => $stacked,
'id_graph' => $id_graph, 'id_graph' => $id_graph,

View File

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

View File

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

View File

@ -3,7 +3,7 @@
# #
%define name pandorafms_console %define name pandorafms_console
%define version 7.0NG.758.1 %define version 7.0NG.758.1
%define release 1 %define release 211124
%define httpd_name httpd %define httpd_name httpd
# User and Group under which Apache is running # User and Group under which Apache is running
%define httpd_name apache2 %define httpd_name apache2

View File

@ -1,5 +1,5 @@
package: pandorafms-server package: pandorafms-server
Version: 7.0NG.758.1 Version: 7.0NG.758.1-211124
Architecture: all Architecture: all
Priority: optional Priority: optional
Section: admin Section: admin

View File

@ -14,7 +14,7 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
pandora_version="7.0NG.758.1" pandora_version="7.0NG.758.1-211124"
package_cpan=0 package_cpan=0
package_pandora=1 package_pandora=1

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,7 +35,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB; use PandoraFMS::DB;
# version: define current version # version: define current version
my $version = "7.0NG.758.1 Build 211123"; my $version = "7.0NG.758.1 Build 211124";
# Pandora server configuration # Pandora server configuration
my %conf; my %conf;

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv; Encode::Locale::decode_argv;
# version: define current version # version: define current version
my $version = "7.0NG.758.1 Build 211123"; my $version = "7.0NG.758.1 Build 211124";
# save program name for logging # save program name for logging
my $progname = basename($0); my $progname = basename($0);
@ -1005,7 +1005,7 @@ sub pandora_get_same_day_id ($$) {
my %weeks = ('monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6, 'sunday' => 7, 'holiday' => 8); my %weeks = ('monday' => 1, 'tuesday' => 2, 'wednesday' => 3, 'thursday' => 4, 'friday' => 5, 'saturday' => 6, 'sunday' => 7, 'holiday' => 8);
return defined ($weeks{$same_day}) ? $weeks{$same_day} : -1; return defined ($weeks->{$same_day}) ? $weeks->{$same_day} : -1;
} }
########################################################################## ##########################################################################