Merge remote-tracking branch 'origin/develop' into ent-11471-integracion-pandora-integria

Conflicts:
	pandora_console/extras/mr/66.sql
	pandora_console/godmode/users/user_management.php
This commit is contained in:
daniel 2023-08-21 08:08:34 +02:00
commit a63824d802
59 changed files with 579 additions and 134 deletions

View File

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

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

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773
%define release 230818
%define release 230821
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux
%define version 7.0NG.773
%define release 230818
%define release 230821
Summary: Pandora FMS Linux agent, PERL version
Name: %{name}

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.773"
PI_BUILD="230818"
PI_BUILD="230821"
OS_NAME=`uname -s`
FORCE=0

View File

@ -186,7 +186,7 @@ UpgradeApplicationID
{}
Version
{230818}
{230821}
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.773 Build 230818")
#define PANDORA_VERSION ("7.0NG.773 Build 230821")
string pandora_path;
string pandora_dir;

View File

@ -11,7 +11,7 @@ BEGIN
VALUE "LegalCopyright", "Pandora FMS"
VALUE "OriginalFilename", "PandoraAgent.exe"
VALUE "ProductName", "Pandora FMS Windows Agent"
VALUE "ProductVersion", "(7.0NG.773(Build 230818))"
VALUE "ProductVersion", "(7.0NG.773(Build 230821))"
VALUE "FileVersion", "1.0.0.0"
END
END

View File

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

View File

@ -37,4 +37,13 @@ SET @event_response_display_command = 1;
UPDATE `tevent_response` SET `name` = @event_response_name, `description` = @event_response_description, `target` = @event_response_target, `display_command` = @event_response_display_command WHERE `name` = 'Create ticket in IntegriaIMS from event';
INSERT IGNORE INTO `tevent_response` (`name`, `description`, `target`,`type`,`id_group`,`modal_width`,`modal_height`,`new_window`,`params`,`server_to_exec`,`command_timeout`,`display_command`) VALUES (@event_response_name, @event_response_description, @event_response_target, @event_response_type, @event_response_id_group, @event_response_modal_width, @event_response_modal_height, @event_response_new_window, @event_response_params, @event_response_server_to_exec, @event_response_command_timeout, @event_response_display_command);
COMMIT;
UPDATE `twelcome_tip`
SET title = 'Scheduled downtimes',
url = 'https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#scheduled_downtimes'
WHERE title = 'planned stops';
UPDATE tagente_modulo SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
UPDATE tpolicy_modules SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
UPDATE tnetwork_component SET `tcp_send` = '2c' WHERE `tcp_send` = '2';
COMMIT;

View File

@ -0,0 +1,81 @@
<?php
/**
* Static page to lock access to console
*
* @category Wizard
* @package Pandora FMS
* @subpackage Applications.VMware
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
ui_require_css_file('maintenance');
?>
<html>
<body>
<div class="responsive center padding-6">
<p>
<?php
if (is_metaconsole() === true) {
echo __('You cannot use this metaconsole until merging process is finished');
} else {
echo __('You cannot use this console until merging process is finished');
}
?>
</p>
<br>
<br>
<?php
html_print_image(
'images/pandora_tinylogo.png',
false,
['class' => 'responsive flex margn']
);
html_print_image(
'images/maintenance.png',
false,
[
'class' => 'responsive',
'width' => 800,
]
);
?>
<br>
<br>
<p><?php echo __('You will be automatically redirected when all tasks finish'); ?></p>
</div>
</body>
<script type="text/javascript">
$(document).ready(function() {
setTimeout(
function() {
location.reload();
},
10000
);
})
</script>
</html>

View File

@ -30,7 +30,7 @@ require_once __DIR__.'/../include/functions_html.php';
echo '<style>
:root {';
if ($config['style'] === 'pandora') {
echo '--login-background-color: rgba(255, 255, 255, 0.4);';
echo '--login-background-color: rgba(255, 255, 255, 0.50);';
echo '--login-label-color: #545454;';
echo '--login-text-color: #000;';
$style_theme = 'white-theme';
@ -237,16 +237,18 @@ if (is_metaconsole() === true) {
);
}
} else if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
$theme_logo = ($config['style'] === 'pandora') ? 'images/custom_logo_login/Pandora FMS alt black.png' : 'enterprise/images/custom_logo_login/'.$config['custom_logo_login'];
if (!isset($config['custom_logo_login'])) {
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else {
html_print_image(ui_get_full_url('enterprise/images/custom_logo_login/'.$config['custom_logo_login']), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
}
} else {
$theme_logo = ($config['style'] === 'pandora') ? 'images/custom_logo_login/Pandora FMS alt black.png' : 'images/custom_logo_login/'.$config['custom_logo_login'];
if (empty($config['custom_logo_login']) === true) {
html_print_image(ui_get_full_url('images/custom_logo_login/Pandora-FMS-1.png'), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
} else {
html_print_image(ui_get_full_url('images/custom_logo_login/').$config['custom_logo_login'], false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
html_print_image(ui_get_full_url($theme_logo), false, ['class' => 'login_logo', 'alt' => 'logo', 'border' => 0, 'title' => $logo_title], false, true);
}
}

View File

@ -259,6 +259,8 @@ if (!empty($news)) {
$output_news .= '</div></div>';
} else {
$text = str_replace('<script', '&lt;script', $text);
$text = str_replace('</script', '&lt;/script', $text);
$output_news .= nl2br($text);
}

View File

@ -233,7 +233,6 @@ if ($adopt === false) {
}
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3';

View File

@ -103,6 +103,7 @@ if ($create_profiles) {
$groups_id = get_parameter('groups_id', -1);
$users_id = get_parameter('users_id', -1);
$n_added = 0;
$msg_error = __('Profiles cannot be added');
if ($profiles_id == -1 || $groups_id == -1 || $users_id == -1) {
$result = false;
@ -155,6 +156,8 @@ if ($create_profiles) {
if ($return !== false) {
$n_added++;
}
} else {
$msg_error = __('The profile already exist on the user');
}
}
}
@ -182,7 +185,7 @@ if ($create_profiles) {
ui_print_result_message(
$n_added > 0,
__('Profiles added successfully').'('.$n_added.')',
__('Profiles cannot be added')
$msg_error
);
}

View File

@ -965,7 +965,6 @@ $table->data[19][0] = html_print_label_input_block(
);
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3';

View File

@ -45,7 +45,6 @@ if (!$id && !isset($snmp_community)) {
}
$snmp_versions['1'] = 'v. 1';
$snmp_versions['2'] = 'v. 2';
$snmp_versions['2c'] = 'v. 2c';
$snmp_versions['3'] = 'v. 3';

View File

@ -1280,8 +1280,7 @@ switch ($action) {
$discovery_tasklist = new DiscoveryTaskList();
$report_task_data = $discovery_tasklist->showListConsoleTask(true);
if (is_array($report_task_data) === true || strpos($report_task_data, 'class="nf"') === false) {
if (is_array($report_task_data) === true || (strpos($report_task_data, 'class="nf"') === false && $report_task_data !== -1)) {
$task_table = '<div class="mrgn_top_15px white_box">';
$task_table .= '<span class="white_table_graph_header">'.__('Report tasks');
$task_table .= ui_print_help_tip(__('To schedule a report, do it from the editing view of each report.'), true);
@ -1290,6 +1289,10 @@ switch ($action) {
$task_table .= '</div></div>';
echo $task_table;
} else {
if ($report_task_data === -1) {
$report_task_data = '';
}
ui_print_info_message($report_task_data.__('To schedule a report, do it from the editing view of each report.'));
}

View File

@ -189,7 +189,8 @@ $table->data[1][1] = html_print_label_input_block(
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
)
// .' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[2][0] = html_print_label_input_block(
@ -202,7 +203,8 @@ $table->data[2][0] = html_print_label_input_block(
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
)
// .' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[2][1] = html_print_label_input_block(
@ -215,7 +217,8 @@ $table->data[2][1] = html_print_label_input_block(
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
)
// .' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[3][0] = html_print_label_input_block(
@ -228,7 +231,8 @@ $table->data[3][0] = html_print_label_input_block(
255,
true,
true
).' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
)
// .' '.($license['limit_mode'] == 0 ? __('agents') : __('modules'))
);
$table->data[3][1] = html_print_label_input_block(
@ -325,6 +329,18 @@ if (enterprise_installed() || defined('DESTDIR')) {
],
true
);
$buttons .= html_print_button(
__('Show agent usage details'),
'agents_details',
false,
'show_agents_details_dialog()',
[
'fixed_id' => 'button-agents_details',
'icon' => 'next',
'mode' => 'secondary',
],
true
);
html_print_action_buttons(
$buttons
@ -369,3 +385,80 @@ if (enterprise_hook('print_activate_licence_dialog') == ENTERPRISE_NOT_HOOK) {
echo '</ul>';
echo '</div>';
}
$table = new stdClass();
$table->width = '100%';
$table->class = 'databox filter-table-adv';
$table->size = [];
$table->size[0] = '50%';
$table->size[1] = '50%';
$table->data = [];
$table->colspan = [];
$table->data[0][0] = html_print_label_input_block(
__('Total Agents'),
html_print_input_text(
'total_agents',
$total_agents,
'',
30,
255,
true,
true
)
);
$table->data[0][1] = html_print_label_input_block(
__('Network & other devices'),
html_print_input_text(
'type_network',
$network_others,
'',
30,
255,
true,
true
)
);
$table->data[1][0] = html_print_label_input_block(
__('Workstations'),
html_print_input_text(
'type_workstation',
$workstations,
'',
30,
255,
true,
true
)
);
$table->data[1][1] = html_print_label_input_block(
__('Servers'),
html_print_input_text(
'type_server',
$servers,
'',
30,
255,
true,
true
)
);
$table->data[2][0] = html_print_label_input_block(
__('Show disabled agents'),
html_print_checkbox_switch(
'show_disabled_agents',
1,
1,
true,
false,
'show_disabled_agents()'
)
);
echo '<div id="agents_details_dialog" class="invisible left" title="'.__('Agents usage details').'">';
html_print_table($table);
echo '</div>';

View File

@ -592,6 +592,9 @@ $userManagementTable->data['line2_looknfeel'][0] = html_print_select_from_sql(
true
);
// Hidden hint to change theme.
$hin_change_theme = ui_print_help_tip(__('When changing the theme, the login screen logo will be restricted to the default for that color scheme, if you have a custom logo, adjust it after changing the theme.'), true, '', '', 'display: none;');
if (is_metaconsole() === true) {
if (users_is_admin() === true) {
$userManagementTable->data['line1_looknfeel'][1] = $outputMetaAccess[0];
@ -599,7 +602,7 @@ if (is_metaconsole() === true) {
}
} else {
if (function_exists('skins_print_select')) {
$userManagementTable->data['line1_looknfeel'][1] = __('User color scheme');
$userManagementTable->data['line1_looknfeel'][1] = __('User color scheme').$hin_change_theme;
$userManagementTable->data['line2_looknfeel'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true);
}
}
@ -881,5 +884,10 @@ $(document).ready(function () {
var host = '<?php echo $ITSM_host; ?>';
testConectionApi(pass, host);
});
//Hint to change theme.
$('#skin1').on("change", () => {
$('#advanced-line1_looknfeel-1 > a').css('display', 'block');
})
});
</script>

View File

@ -575,7 +575,7 @@ class DiscoveryTaskList extends HTML
$recon_tasks = db_get_all_rows_sql(
sprintf(
'SELECT tasks.*, apps.section AS section, apps.short_name AS short_name
FROM trecon_task
FROM trecon_task tasks
LEFT JOIN tdiscovery_apps apps ON tasks.id_app = apps.id_app
WHERE id_group IN (%s) AND
(type IN (%s) OR section = "%s")',

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -809,7 +809,6 @@ class AgentWizard extends HTML
// Fill with SNMP versions allowed.
$fieldsVersions = [
'1' => '1',
'2' => '2',
'2c' => '2c',
'3' => '3',
];

View File

@ -1112,7 +1112,6 @@ class CredentialStore extends Wizard
'script' => 'showVersion()',
'fields' => [
'1' => __('1'),
'2' => __('2'),
'2c' => __('2c'),
'3' => __('3'),
],

View File

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

View File

@ -1744,8 +1744,8 @@ function html_print_select_multiple_modules_filtered(array $data):string
[
'label' => __('Agents'),
'label_class' => 'font-title-font',
'type' => 'select',
'fields' => $agents,
'type' => 'select_from_sql',
'sql' => 'SELECT `id_agente`,`nombre` FROM tagente',
'name' => 'filtered-module-agents-'.$uniqId,
'selected' => explode(',', $data['mAgents']),
'return' => true,
@ -1925,8 +1925,7 @@ function html_print_extended_select_for_unit(
$select_style=false,
$unique_name=true,
$disabled=false,
$no_change=0,
$class='w100p'
$no_change=0
) {
global $config;
@ -1958,7 +1957,7 @@ function html_print_extended_select_for_unit(
ob_start();
echo '<div id="'.$uniq_name.'_default" class="'.$class.' inline_line">';
echo '<div id="'.$uniq_name.'_default" class="w100p inline_line">';
html_print_select(
$fields,
$uniq_name.'_select',
@ -3964,14 +3963,6 @@ function html_print_table(&$table, $return=false)
}
}
if (isset($table->tdid)) {
foreach ($table->tdid as $keyrow => $tid) {
foreach ($tid as $key => $id) {
$tdid[$keyrow][$key] = $id;
}
}
}
if (isset($table->cellstyle)) {
foreach ($table->cellstyle as $keyrow => $cstyle) {
foreach ($cstyle as $key => $cst) {
@ -4155,10 +4146,6 @@ function html_print_table(&$table, $return=false)
$colspan[$keyrow][$key] = '';
}
if (!isset($tdid[$keyrow][$key])) {
$tdid[$keyrow][$key] = '';
}
if (!isset($rowspan[$keyrow][$key])) {
$rowspan[$keyrow][$key] = '';
}
@ -4179,16 +4166,10 @@ function html_print_table(&$table, $return=false)
$style[$key] = '';
}
if ($tdid[$keyrow][$key] !== '') {
$tid = $tdid[$keyrow][$key];
} else {
$tid = $tableid.'-'.$keyrow.'-'.$key;
}
if ($class === 'datos5' && $key === 1) {
$output .= '<td id="'.$tid.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
$output .= '<td id="'.$tableid.'-'.$keyrow.'-'.$key.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
} else {
$output .= '<td id="'.$tid.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].'" '.$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
$output .= '<td id="'.$tableid.'-'.$keyrow.'-'.$key.'" style="'.$cellstyle[$keyrow][$key].$style[$key].$valign[$key].$align[$key].$size[$key].$wrap[$key].'" '.$colspan[$keyrow][$key].' '.$rowspan[$keyrow][$key].' class="'.$class.' '.$cellclass[$keyrow][$key].'">'.$item.'</td>'."\n";
}
}

View File

@ -793,7 +793,7 @@ function modules_create_agent_module(
// Encrypt passwords.
if (isset($values['plugin_pass']) === true) {
// Avoid two times encryption.
$plugin_pass = io_safe_output($values['plugin_pass']);
$plugin_pass = io_output_password($values['plugin_pass']);
$values['plugin_pass'] = io_input_password($plugin_pass);
}

View File

@ -782,7 +782,6 @@ function snmp_browser_print_container(
html_print_select(
[
'1' => 'v. 1',
'2' => 'v. 2',
'2c' => 'v. 2c',
'3' => 'v. 3',
],

View File

@ -691,6 +691,17 @@ function get_build_setup_charts($type, $options, $data)
}
$chart->options()->setMaintainAspectRatio($maintainAspectRatio);
if (isset($options['elements']) === true) {
if (isset($options['elements']['center']) === true) {
if (isset($options['elements']['center']['text']) === true) {
$chart->options()->getElements()->center()->setText($options['elements']['center']['text']);
}
if (isset($options['elements']['center']['color']) === true) {
$chart->options()->getElements()->center()->setColor($options['elements']['center']['color']);
}
}
}
// Set Responsive for responsive charts.
$responsive = true;

View File

@ -86,8 +86,8 @@ function showConnectionMessage(conn = true, msg = "") {
.closest(".ui-dialog-content")
.dialog("close");
} else {
data.title = "Connection with server has been lost";
data.text = "Connection status: " + msg;
data.title = get_php_value("title_conexion_interval");
data.text = get_php_value("status_conexion_interval") + msg;
infoMessage(data, "message_dialog_connection");
}

View File

@ -226,6 +226,10 @@ class TopNEventByGroupWidget extends Widget
$values['legendPosition'] = $decoder['legendPosition'];
}
if (isset($decoder['show_total_data']) === true) {
$values['show_total_data'] = $decoder['show_total_data'];
}
return $values;
}
@ -329,6 +333,16 @@ class TopNEventByGroupWidget extends Widget
],
];
$inputs[] = [
'label' => __('Show total data'),
'arguments' => [
'type' => 'switch',
'name' => 'show_total_data',
'value' => $values['show_total_data'],
'return' => true,
],
];
return $inputs;
}
@ -347,6 +361,7 @@ class TopNEventByGroupWidget extends Widget
$values['maxHours'] = \get_parameter('maxHours', 0);
$values['groupId'] = \get_parameter('groupId', []);
$values['legendPosition'] = \get_parameter('legendPosition', 0);
$values['show_total_data'] = \get_parameter_switch('show_total_data', 0);
return $values;
}
@ -364,7 +379,7 @@ class TopNEventByGroupWidget extends Widget
$output = '';
$size = parent::getSize();
$show_total_data = (bool) $this->values['show_total_data'];
$this->values['groupId'] = explode(',', $this->values['groupId'][0]);
if (empty($this->values['groupId']) === true) {
@ -473,6 +488,7 @@ class TopNEventByGroupWidget extends Widget
} else {
$data_pie = [];
$labels = [];
$sum = 0;
foreach ($result as $row) {
if ($row['id_agente'] == 0) {
$name = __('System');
@ -494,7 +510,7 @@ class TopNEventByGroupWidget extends Widget
}
$name .= ' ('.$row['count'].')';
$sum += $row['count'];
$labels[] = io_safe_output($name);
$data_pie[] = $row['count'];
}
@ -524,17 +540,37 @@ class TopNEventByGroupWidget extends Widget
break;
}
$output .= pie_graph(
$data_pie,
[
'legend' => [
'display' => true,
'position' => 'right',
'align' => 'center',
],
'labels' => $labels,
]
);
if ($show_total_data === true) {
$output .= ring_graph(
$data_pie,
[
'legend' => [
'display' => true,
'position' => 'right',
'align' => 'center',
],
'elements' => [
'center' => [
'text' => $sum,
'color' => '#2c3e50',
],
],
'labels' => $labels,
]
);
} else {
$output .= pie_graph(
$data_pie,
[
'legend' => [
'display' => true,
'position' => 'right',
'align' => 'center',
],
'labels' => $labels,
]
);
}
}
return $output;

View File

@ -9412,7 +9412,8 @@ div.stat-win-spinner img {
.select2-selection--multiple
.select2-selection__rendered {
padding: 5px 10px 10px !important;
max-height: 120px;
min-height: 100px;
max-height: 250px;
overflow: auto !important;
}
@ -10792,10 +10793,6 @@ button.ui-button.ui-widget.submit-cancel:active {
border-color: #96a2bf;
}
.cursor-default {
cursor: default;
}
.hasColorPicker {
z-index: 10;
}
@ -12288,14 +12285,6 @@ div.parent_graph > p.legend_background > table > tbody > tr {
margin: 0px !important;
}
form.max_floating_element_size > ul#ul_tree_azure {
background-color: #fff;
border-spacing: 0px;
border-radius: 6px;
margin-bottom: 20px;
border: 1px solid #e2e2e2;
}
#grid_img {
position: absolute;
margin-top: -2px;
@ -12331,6 +12320,10 @@ tr[id^="network_component-plugin-snmp-fields-dynamicMacroRow-"] input {
width: 100% !important;
}
.label_agent_service > label {
margin-top: 15px;
}
.animation-blink {
-webkit-animation: glowing 1500ms infinite;
-moz-animation: glowing 1500ms infinite;

View File

@ -1042,6 +1042,33 @@ if (isset($config['id_user']) === false) {
}
}
if ((bool) ($config['maintenance_mode'] ?? false) === true
&& is_user_admin($config['id_user']) === false
) {
// Show maintenance web-page. For non-admin users only.
include $config['homedir'].'/general/maintenance.php';
while (ob_get_length() > 0) {
ob_end_flush();
}
exit('</html>');
}
if ((bool) ($config['maintenance_mode'] ?? false) === true
&& $page !== 'advanced/command_center'
&& is_user_admin($config['id_user']) === true
) {
// Prevent access to metaconsole if not merged.
include 'general/admin_maintenance_mode.php';
while (ob_get_length() > 0) {
ob_end_flush();
}
exit('</html>');
}
// Enterprise support.
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
include_once ENTERPRISE_DIR.'/load_enterprise.php';
@ -1489,10 +1516,12 @@ echo html_print_div(
// Connection lost alert.
set_js_value('check_conexion_interval', $config['check_conexion_interval']);
set_js_value('title_conexion_interval', __('Connection with console has been lost'));
set_js_value('status_conexion_interval', __('Connection status: '));
ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
$conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
if ($config['pure'] == 0) {

View File

@ -131,7 +131,7 @@
<div style='padding-bottom: 50px'>
<?php
$version = '7.0NG.773';
$build = '230818';
$build = '230821';
$banner = "v$version Build $build";
error_reporting(0);

View File

@ -223,6 +223,14 @@ if ($loaded_filter['id_filter'] > 0) {
if (is_array($policies) === false) {
$policies = json_decode(io_safe_output($policies), true);
}
// Fav menu.
$fav_menu = [
'id_element' => $loaded_filter['id_filter'],
'url' => 'operation/agentes/estado_agente&pure=&load_filter=1&filter_id='.$loaded_filter['id_filter'],
'label' => $loaded_filter['id_name'],
'section' => 'Agente',
];
}
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
@ -267,7 +275,8 @@ ui_print_standard_header(
'link' => '',
'label' => __('Views'),
],
]
],
(empty($fav_menu) === true) ? [] : $fav_menu
);
if ((bool) $strict_user === false) {

View File

@ -89,8 +89,8 @@ $label = db_get_value(
ui_require_css_file('register', 'include/styles/', true);
// Connection lost alert.
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
$conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
ui_print_message_dialog(

View File

@ -250,6 +250,17 @@ try {
echo csv_format_delimiter(io_safe_output($custom_data));
break;
case 'timestamp':
$target_timezone = date_default_timezone_get();
$utimestamp = $row['utimestamp'];
$datetime = new DateTime("@{$utimestamp}");
$new_datetime_zone = new DateTimeZone($target_timezone);
$datetime->setTimezone($new_datetime_zone);
$formatted_date = $datetime->format('Y-m-d H:i:s');
echo csv_format_delimiter($formatted_date);
break;
default:
echo csv_format_delimiter(io_safe_output($row[$key]));
break;

View File

@ -274,8 +274,8 @@ if ($layers != false) {
// Connection lost alert.
ui_require_css_file('register', 'include/styles/', true);
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
$conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_require_javascript_file('connection_check');
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');

View File

@ -54,8 +54,8 @@ echo '<link rel="stylesheet" href="'.$url_css_modal.'?v='.$config['current_packa
// Connection lost alert.
ui_require_javascript_file('connection_check', 'include/javascript/', true);
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
$conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
require_once 'include/functions_visual_map.php';

View File

@ -35,8 +35,8 @@ ui_require_css_file('register', 'include/styles/', true);
// Connection lost alert.
ui_require_javascript_file('connection_check', 'include/javascript/', true);
set_js_value('absolute_homeurl', ui_get_full_url(false, false, false, false));
$conn_title = __('Connection with server has been lost');
$conn_text = __('Connection to the server has been lost. Please check your internet connection or contact with administrator.');
$conn_title = __('Connection with console has been lost');
$conn_text = __('Connection to the console has been lost. Please check your internet connection.');
ui_print_message_dialog($conn_title, $conn_text, 'connection', '/images/fail@svg.svg');
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'."\n";

View File

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

View File

@ -2615,7 +2615,7 @@ INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Monitor&#x20;routes&#x20;from&#x20;one&#x20;IP&#x20;to&#x20;another','There&#x20;is&#x20;a&#x20;special&#x20;plugin&#x20;that&#x20;is&#x20;used&#x20;to&#x20;visually&#x20;monitor&#x20;the&#x20;routes&#x20;from&#x20;one&#x20;IP&#x20;to&#x20;another&#x20;in&#x20;a&#x20;visual&#x20;and&#x20;dynamic&#x20;way,&#x20;as&#x20;it&#x20;changes&#x20;over&#x20;time.','https://pandorafms.com/manual/en/documentation/03_monitoring/03_remote_monitoring#monitorizacion_de_rutas',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'monitorizar_desde_ip.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'planned&#x20;stops','It&#x20;is&#x20;possible&#x20;to&#x20;define,&#x20;at&#x20;the&#x20;agent&#x20;level&#x20;and&#x20;at&#x20;the&#x20;module&#x20;level,&#x20;periods&#x20;in&#x20;which&#x20;the&#x20;alerts&#x20;and/or&#x20;the&#x20;collected&#x20;data&#x20;are&#x20;ignored.&#x20;It&#x20;is&#x20;perfect&#x20;for&#x20;planning&#x20;service&#x20;stops&#x20;or&#x20;disconnection&#x20;of&#x20;monitored&#x20;systems.&#x20;It&#x20;also&#x20;affects&#x20;SLA&#x20;reporting,&#x20;preventing&#x20;those&#x20;time&#x20;intervals&#x20;from&#x20;being&#x20;taken&#x20;into&#x20;account.','https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#paradas_de_servicio_planificadas',1);
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Scheduled&#x20;downtimes','It&#x20;is&#x20;possible&#x20;to&#x20;define,&#x20;at&#x20;the&#x20;agent&#x20;level&#x20;and&#x20;at&#x20;the&#x20;module&#x20;level,&#x20;periods&#x20;in&#x20;which&#x20;the&#x20;alerts&#x20;and/or&#x20;the&#x20;collected&#x20;data&#x20;are&#x20;ignored.&#x20;It&#x20;is&#x20;perfect&#x20;for&#x20;planning&#x20;service&#x20;stops&#x20;or&#x20;disconnection&#x20;of&#x20;monitored&#x20;systems.&#x20;It&#x20;also&#x20;affects&#x20;SLA&#x20;reporting,&#x20;preventing&#x20;those&#x20;time&#x20;intervals&#x20;from&#x20;being&#x20;taken&#x20;into&#x20;account.','https://pandorafms.com/manual/en/documentation/04_using/11_managing_and_administration#scheduled_downtimes',1);
SELECT @last_id := LAST_INSERT_ID();
INSERT INTO `twelcome_tip_file` (`twelcome_tip_file`,`filename`,`path`) VALUES (@last_id,'paradas_planificadas.png','images/tips/');
INSERT INTO `twelcome_tip` (`id_lang`,`id_profile`,`title`,`text`,`url`,`enable`) VALUES ('en_GB',0,'Customize&#x20;alert&#x20;emails','Did&#x20;you&#x20;know&#x20;that&#x20;Pandora&#x20;alert&#x20;emails&#x20;can&#x20;be&#x20;customized?&#x20;You&#x20;only&#x20;have&#x20;to&#x20;edit&#x20;the&#x20;default&#x20;HTML&#x20;code&#x20;of&#x20;the&#x20;email&#x20;type&#x20;alert&#x20;actions.','https://pandorafms.com/manual/en/documentation/04_using/01_alerts#editing_an_action',1);

View File

@ -8,6 +8,7 @@ use Artica\PHPChartJS\Options\Elements\Arc;
use Artica\PHPChartJS\Options\Elements\Line;
use Artica\PHPChartJS\Options\Elements\Point;
use Artica\PHPChartJS\Options\Elements\Rectangle;
use Artica\PHPChartJS\Options\Elements\Center;
use JsonSerializable;
/**
@ -39,6 +40,11 @@ class Elements implements ArraySerializableInterface, JsonSerializable
*/
private $arc;
/**
* @var Center
*/
private $center;
/**
* @return Rectangle
*/
@ -119,6 +125,26 @@ class Elements implements ArraySerializableInterface, JsonSerializable
return $this->arc;
}
/**
* @return Center
*/
public function center()
{
if (is_null($this->center)) {
$this->center = new Center();
}
return $this->center;
}
/**
* @return Center
*/
public function getCenter()
{
return $this->center;
}
/**
* @return array
*/

View File

@ -0,0 +1,85 @@
<?php
namespace Artica\PHPChartJS\Options\Elements;
use Artica\PHPChartJS\ArraySerializableInterface;
use Artica\PHPChartJS\Delegate\ArraySerializable;
use JsonSerializable;
/**
* Class Center
* @package Artica\PHPChartJS\Options\Elements
*/
class Center implements ArraySerializableInterface, JsonSerializable
{
use ArraySerializable;
/**
* Text center graph.
* @var string
*/
private $text;
/**
* Color text.
* @default '#000'
* @var string
*/
private $color;
/**
* Get text center graph.
*
* @return string
*/
public function getText()
{
return $this->text;
}
/**
* Set text center graph.
*
* @param string $text Text center graph.
*
* @return self
*/
public function setText(string $text)
{
$this->text = $text;
return $this;
}
/**
* Get color text.
*
* @return string
*/
public function getColor()
{
return $this->color;
}
/**
* Set color text.
*
* @param string $color Color text.
*
* @return self
*/
public function setColor(string $color)
{
$this->color = $color;
return $this;
}
/**
* @return array
*/
public function jsonSerialize()
{
return $this->getArrayCopy();
}
}

View File

@ -32,6 +32,49 @@ class JavaScript extends Renderer
if (empty($this->chart->defaults()->getWatermark()) === false) {
$script[] = 'const chart_watermark_'.$this->chart->getId().' = {
id: "chart_watermark_'.$this->chart->getId().'",
beforeDraw: (chart) => {
if (Object.prototype.hasOwnProperty.call(chart, "config") &&
Object.prototype.hasOwnProperty.call(chart.config.options, "elements") &&
Object.prototype.hasOwnProperty.call(chart.config.options.elements, "center"))
{
var ctx = chart.ctx;
ctx.save();
var centerConfig = chart.config.options.elements.center;
var txt = centerConfig.text;
var color = centerConfig.color || "#000";
ctx.textAlign = "center";
ctx.textBaseline = "middle";
var centerX = (chart.chartArea.left + chart.chartArea.right) / 2;
var centerY = (chart.chartArea.top + chart.chartArea.bottom) / 2;
var outerRadius = Math.min(ctx.canvas.width, ctx.canvas.height) / 2;
var padding = 20;
var innerRadius = outerRadius - padding;
ctx.font = "30px ";
var sidePaddingCalculated = (93/100) * (innerRadius * 2)
var stringWidth = ctx.measureText(txt).width;
var elementWidth = (innerRadius * 2) - sidePaddingCalculated;
var widthRatio = elementWidth / stringWidth;
var newFontSize = Math.floor(30 * widthRatio);
var elementHeight = (innerRadius * 2);
var fontSizeToUse = Math.min(newFontSize, elementHeight);
ctx.font = fontSizeToUse + "px Lato, sans-serif";
ctx.fillStyle = color;
ctx.fillText(txt, centerX, centerY);
ctx.restore();
}
},
afterDraw: (chart) => {
const image = new Image();
image.src = "'.$this->chart->defaults()->getWatermark()->getSrc().'";

View File

@ -1,5 +1,5 @@
package: pandorafms-server
Version: 7.0NG.773-230818
Version: 7.0NG.773-230821
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.773-230818"
pandora_version="7.0NG.773-230821"
package_cpan=0
package_pandora=1

View File

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

View File

@ -1230,7 +1230,7 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
$field19 = defined($alert->{'field19'}) && $alert->{'field19'} ne "" ? $alert->{'field19'} : $action->{'field19'};
$field20 = defined($alert->{'field20'}) && $alert->{'field20'} ne "" ? $alert->{'field20'} : $action->{'field20'};
}
# Recovery fields, thanks to Kato Atsushi
if ($alert_mode == RECOVERED_ALERT) {
# Field 1 is a special case where [RECOVER] prefix is not added even when it is defined
@ -1398,6 +1398,7 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
_timestamp_ => (defined($timestamp)) ? $timestamp : strftime ("%Y-%m-%d %H:%M:%S", localtime()),
_timezone_ => strftime ("%Z", localtime()),
_data_ => $data,
_dataunit_ => (defined ($module)) ? $module->{'unit'} : '',
_prevdata_ => undef,
_homeurl_ => $pa_config->{'public_url'},
_alert_name_ => $alert->{'name'},
@ -1586,11 +1587,11 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
my $period = $hours * 3600; # Hours to seconds
if($threshold == 0){
$params->{"other"} = $period . '%7C1%7C0%7C225%7C%7C14';
$cid = 'module_graph_' . $hours . 'h';
$cid = 'module_graph_' . (defined($module) && $module ne '' ? ($module . '_') : '') . $hours . 'h';
}
else{
$params->{"other"} = $period . '%7C1%7C1%7C225%7C%7C14';
$cid = 'module_graphth_' . $hours . 'h';
$cid = 'module_graphth_' . (defined($module) && $module ne '' ? ($module . '_') : '') . $hours . 'h';
}
if (defined($module)) {
@ -1688,7 +1689,7 @@ sub pandora_execute_action ($$$$$$$$$;$$) {
. "Content-Location: " . $dataname . "\n\n"
. $base64_data . "\n";
}
if ($pa_config->{"mail_in_separate"} != 0){
foreach my $address (split (',', $field1)) {
# Remove blanks
@ -5041,6 +5042,9 @@ sub on_demand_macro($$$$$$;$) {
my $field_number = $1;
my $field_value = get_db_value($dbh, 'SELECT description FROM tagent_custom_data WHERE id_field=? AND id_agent=?', $field_number, $agent_id);
return (defined($field_value)) ? $field_value : '';
} elsif ($macro eq '_dataunit_'){
return '' unless defined ($module);
my $field_value = get_db_value($dbh, 'SELECT unit FROM tagente_modulo where id_agente_modulo = ? limit 1', $module->{'id_agente_modulo'});
} elsif ($macro eq '_prevdata_') {
return '' unless defined ($module);
if ($module->{'id_tipo_modulo'} eq 3){

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.773";
my $pandora_build = "230818";
my $pandora_build = "230821";
our $VERSION = $pandora_version." ".$pandora_build;
our %EXPORT_TAGS = ( 'all' => [ qw() ] );

View File

@ -4,7 +4,7 @@
%global __os_install_post %{nil}
%define name pandorafms_server
%define version 7.0NG.773
%define release 230818
%define release 230821
Summary: Pandora FMS Server
Name: %{name}

View File

@ -9,7 +9,7 @@
# **********************************************************************
PI_VERSION="7.0NG.773"
PI_BUILD="230818"
PI_BUILD="230821"
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.773 Build 230818";
my $version = "7.0NG.773 Build 230821";
# Pandora server configuration
my %conf;
@ -146,7 +146,10 @@ sub pandora_purgedb ($$$) {
}
# Delete old data
if ($conf->{'_days_purge'} > 0) {
if (!defined($conf->{'_days_purge'})){
log_message ('PURGE', 'days_purge is not defined. Old data will not be deleted.');
}
elsif ($conf->{'_days_purge'} > 0) {
# Delete old numeric data
pandora_delete_old_module_data ($dbh, 'tagente_datos', $ulimit_access_timestamp, $ulimit_timestamp);
@ -164,9 +167,7 @@ sub pandora_purgedb ($$$) {
pandora_delete_old_tplanned_downtime(\%conf, $dbh, $h_conf);
# String data deletion
if (!defined($conf->{'_string_purge'})){
$conf->{'_string_purge'} = 7;
}
$conf->{'_string_purge'} //= 7;
if ($conf->{'_string_purge'} > 0) {
$ulimit_access_timestamp = time() - 86400;
@ -178,9 +179,8 @@ sub pandora_purgedb ($$$) {
}
# Delete event data
if (!defined($conf->{'_event_purge'})){
$conf->{'_event_purge'}= 10;
}
$conf->{'_event_purge'} //= 10;
if ($conf->{'_event_purge'} > 0) {
my $event_limit = time() - 86400 * $conf->{'_event_purge'};
@ -205,7 +205,7 @@ sub pandora_purgedb ($$$) {
}
# Delete audit data
$conf->{'_audit_purge'}= 7 if (!defined($conf->{'_audit_purge'}));
$conf->{'_audit_purge'} //= 7;
if ($conf->{'_audit_purge'} > 0) {
log_message ('PURGE', "Deleting old audit data (More than " . $conf->{'_audit_purge'} . " days).");
my $audit_limit = time() - 86400 * $conf->{'_audit_purge'};
@ -216,7 +216,8 @@ sub pandora_purgedb ($$$) {
}
# Delete SNMP trap data
$conf->{'_trap_purge'}= 7 if (!defined($conf->{'_trap_purge'}));
$conf->{'_trap_purge'} //= 7;
if ($conf->{'_trap_purge'} > 0) {
log_message ('PURGE', "Deleting old SNMP traps (More than " . $conf->{'_trap_purge'} . " days).");
@ -237,7 +238,8 @@ sub pandora_purgedb ($$$) {
enterprise_hook("pandora_purge_service_elements", [$dbh, $conf]);
# Delete GIS data
$conf->{'_gis_purge'}= 15 if (!defined($conf->{'_gis_purge'}));
$conf->{'_gis_purge'} //= 15;
if ($conf->{'_gis_purge'} > 0) {
log_message ('PURGE', "Deleting old GIS data (More than " . $conf->{'_gis_purge'} . " days).");
my $gis_limit = strftime ("%Y-%m-%d %H:%M:%S", localtime(time() - 86400 * $conf->{'_gis_purge'}));
@ -293,8 +295,6 @@ sub pandora_purgedb ($$$) {
log_message ('PURGE', "No agent access data.");
}
# Purge the reports
if (defined($conf->{'_enterprise_installed'}) && $conf->{'_enterprise_installed'} eq '1' &&
defined($conf->{'_metaconsole'}) && $conf->{'_metaconsole'} eq '1'){
@ -347,7 +347,10 @@ sub pandora_purgedb ($$$) {
# Delete old netflow data
if ($conf->{'_netflow_max_lifetime'} > 0) {
if (!defined($conf->{'_netflow_max_lifetime'})){
log_message ('PURGE', 'netflow_max_lifetime is not defined. Old netflow data will not be deleted.');
}
elsif ($conf->{'_netflow_max_lifetime'} > 0) {
log_message ('PURGE', "Deleting old netflow data.");
if (! defined ($conf->{'_netflow_path'}) || ! -d $conf->{'_netflow_path'}) {
log_message ('!', "Netflow data directory does not exist, skipping.");
@ -364,7 +367,10 @@ sub pandora_purgedb ($$$) {
}
# Delete old sflow data
if ($conf->{'_sflow_max_lifetime'} > 0) {
if (!defined($conf->{'_sflow_max_lifetime'})){
log_message ('PURGE', 'sflow_max_lifetime is not defined. Old sflow data will not be deleted.');
}
elsif ($conf->{'_sflow_max_lifetime'} > 0) {
log_message ('PURGE', "Deleting old sflow data.");
if (! defined ($conf->{'_sflow_path'}) || ! -d $conf->{'_sflow_path'}) {
log_message ('!', "sflow data directory does not exist, skipping.");
@ -384,7 +390,7 @@ sub pandora_purgedb ($$$) {
log_message ('PURGE', "Deleting old log data.");
if (defined($conf->{'_days_purge_old_information'}) && $conf->{'_days_purge_old_information'} > 0) {
log_message ('PURGE', 'Deleting log data older than ' . $conf->{'_days_purge_old_information'} . ' days.');
enterprise_hook ('pandora_purge_logs', [$dbh, $conf]);
enterprise_hook ('pandora_purge_logs', [$dbh, $conf]);
}
else {
log_message ('PURGE', 'days_purge_old_data is set to 0. Old log data will not be deleted.');
@ -401,7 +407,7 @@ sub pandora_purgedb ($$$) {
# Delete old special days
log_message ('PURGE', "Deleting old special days.");
if ($conf->{'_num_past_special_days'} > 0) {
if (defined($conf->{'_num_past_special_days'}) && $conf->{'_num_past_special_days'} > 0) {
log_message ('PURGE', 'Deleting special days older than ' . $conf->{'_num_past_special_days'} . ' days.');
if (${RDBMS} eq 'oracle') {
db_do ($dbh, "DELETE FROM talert_special_days
@ -419,7 +425,7 @@ sub pandora_purgedb ($$$) {
# Delete old messages
log_message ('PURGE', "Deleting old messages.");
if ($conf->{'_delete_old_messages'} > 0) {
if (defined($conf->{'_delete_old_messages'}) && $conf->{'_delete_old_messages'} > 0) {
my $message_limit = time() - 86400 * $conf->{'_delete_old_messages'};
db_do ($dbh, "DELETE FROM tmensajes WHERE timestamp < ?", $message_limit);
}

View File

@ -36,7 +36,7 @@ use Encode::Locale;
Encode::Locale::decode_argv;
# version: define current version
my $version = "7.0NG.773 Build 230818";
my $version = "7.0NG.773 Build 230821";
# save program name for logging
my $progname = basename($0);
@ -5411,7 +5411,7 @@ sub cli_create_synthetic() {
my @module_data;
if (@ARGV[$#ARGV] == "use_alias") {
if (@ARGV[$#ARGV] eq "use_alias") {
@module_data = @ARGV[5..$#ARGV-1];
} else {
@module_data = @ARGV[5..$#ARGV];
@ -5531,7 +5531,7 @@ sub cli_create_synthetic() {
}
} else {
my $id_agent = int(get_agent_id($dbh,$agent_name));
if ($id_agent > 0) {
foreach my $i (0 .. $#module_data) {
my @split_data = split(',',$module_data[$i]);