Merge branch 'develop' into ent-11763-15982-regex-en-busqueda-de-eventos

This commit is contained in:
Jonathan 2023-11-08 14:16:09 +01:00
commit 1d065c2fbb
44 changed files with 534 additions and 369 deletions

View File

@ -22,13 +22,16 @@ else
fi
SPEC_FILES="$CODEHOME/pandora_console/pandora_console.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.el8.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.el9.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_server/pandora_server.spec \
$PANDHOME_ENT/pandora_console/enterprise/pandora_console_enterprise.spec \
$PANDHOME_ENT/pandora_server/PandoraFMS-Enterprise/pandora_server_enterprise.spec \
$CODEHOME/pandora_console/pandora_console.redhat.spec \
$CODEHOME/pandora_console/pandora_console.rhel7.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat.spec \
$CODEHOME/pandora_agents/unix/pandora_agent.redhat_bin.spec \
$CODEHOME/pandora_server/pandora_server.redhat.spec \
$PANDHOME_ENT/pandora_agents/pandora_agent.spec \
$PANDHOME_ENT/pandora_server/pandora_server_enterprise.redhat.spec \

View File

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

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

View File

@ -4,8 +4,8 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 230919
%define version 7.0NG.774
%define release 231108
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -4,8 +4,8 @@
%global __os_install_post %{nil}
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.773.3
%define release 230919
%define version 7.0NG.774
%define release 231108
%define debug_package %{nil}
Summary: Pandora FMS Linux agent, binary version

View File

@ -5,7 +5,7 @@
%define name pandorafms_agent_linux_bin
%define source_name pandorafms_agent_linux
%define version 7.0NG.774
%define release 231106
%define release 231108
Summary: Pandora FMS Linux agent, binary version
Name: %{name}

View File

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

View File

@ -10,7 +10,7 @@
# **********************************************************************
PI_VERSION="7.0NG.774"
PI_BUILD="231106"
PI_BUILD="231108"
OS_NAME=`uname -s`
FORCE=0

View File

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

View File

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

View File

@ -1718,3 +1718,5 @@ operation/incidents/list_integriaims_incidents.php
include/functions_incidents.php
include/functions_integriaims.php
include/ajax/integria_incidents.ajax.php
enterprise/operation/log/log_source.php
enterprise/include/class/LogSource.class.php

View File

@ -484,6 +484,7 @@ echo '</form>';
ui_require_javascript_file('pandora_alerts');
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
ui_require_javascript_file('alert');
?>
<script type="text/javascript">
@ -500,194 +501,6 @@ $(document).ready (function () {
render_command_description(command_description);
}
function ajax_get_integria_custom_fields(ticket_type_id, values, recovery_values) {
var values = values || [];
var recovery_values = recovery_values || [];
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
if (ticket_type_id === null || ticket_type_id === '' || (Array.isArray(values) && values.length === 0 && Array.isArray(recovery_values) && recovery_values.length === 0)) {
for (var i=8; i <= max_macro_fields; i++) {
$('[name=field'+i+'_value\\[\\]').val('');
$('[name=field'+i+'_recovery_value\\[\\]').val('');
}
}
// On ticket type change, hide all table rows and inputs corresponding to custom fields, regardless of what its type is.
for (var i=8; i <= max_macro_fields; i++) {
$('[name=field'+i+'_value\\[\\]').hide();
$('[name=field'+i+'_recovery_value\\[\\]').hide();
$('#table_macros-field'+i).hide();
$('[name=field'+i+'_value_container').hide();
$('[name=field'+i+'_recovery_value_container').hide();
}
jQuery.post(
"ajax.php",
{
page: "godmode/alerts/configure_alert_action",
get_integria_ticket_custom_types: 1,
ticket_type_id: ticket_type_id
},
function(data) {
var max_macro_fields = <?php echo $config['max_macro_fields']; ?>;
data.forEach(function(custom_field, key) {
var custom_field_key = key+8; // Custom fields start from field 8.
if (custom_field_key > max_macro_fields) {
return;
}
// Display field row for current input.
var custom_field_row = $('#table_macros-field'+custom_field_key);
custom_field_row.show();
// Replace label text of field row for current input.
var label_html = $('#table_macros-field'+custom_field_key+' td').first().html();
var label_name = label_html.split('<br>')[0];
var new_html_content = custom_field_row.html().replace(label_name, custom_field.label);
custom_field_row.html(new_html_content);
switch (custom_field.type) {
case 'CHECKBOX':
var checkbox_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]');
var checkbox_recovery_selector = $('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]');
checkbox_selector.on('change', function() {
if (checkbox_selector.prop('checked')) {
checkbox_selector.attr('value', "1");
} else {
checkbox_selector.attr('value', "0");
}
});
checkbox_recovery_selector.on('change', function() {
if (checkbox_recovery_selector.prop('checked')) {
checkbox_recovery_selector.attr('value', "1");
} else {
checkbox_recovery_selector.attr('value', "0");
}
});
if (typeof values[key] !== "undefined") {
if (values[key] == 1) {
checkbox_selector.prop('checked', true);
checkbox_selector.attr('value', "1");
} else {
checkbox_selector.prop('checked', false);
checkbox_selector.attr('value', "0");
}
}
if (typeof recovery_values[key] !== "undefined") {
if (recovery_values[key] == 1) {
checkbox_recovery_selector.prop('checked', true);
checkbox_recovery_selector.attr('value', "1");
} else {
checkbox_recovery_selector.prop('checked', false);
checkbox_recovery_selector.attr('value', "0");
}
}
$('[name=field'+custom_field_key+'_value_container]').show();
$('[name=field'+custom_field_key+'_recovery_value_container]').show();
$('input[type="checkbox"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input[type="checkbox"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'COMBO':
var combo_input = $('select[name=field'+custom_field_key+'_value\\[\\]]');
var combo_input_recovery = $('select[name=field'+custom_field_key+'_recovery_value\\[\\]]');
combo_input.find('option').remove();
combo_input_recovery.find('option').remove();
var combo_values_array = custom_field.comboValue.split(',');
combo_values_array.forEach(function(value) {
combo_input.append($('<option>', {
value: value,
text: value
}));
combo_input_recovery.append($('<option>', {
value: value,
text: value
}));
});
if (typeof values[key] !== "undefined") {
combo_input.val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
combo_input_recovery.val(recovery_values[key]);
}
combo_input.show();
combo_input_recovery.show();
break;
case 'DATE':
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').removeClass("hasDatepicker");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').removeClass("hasDatepicker");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker("destroy");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker("destroy");
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').datepicker({dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>"});
$.datepicker.setDefaults($.datepicker.regional[ "<?php echo get_user_language(); ?>"]);
if (typeof values[key] !== "undefined") {
$('input.datepicker[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input.datepicker[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
break;
case 'NUMERIC':
if (typeof values[key] !== "undefined") {
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('input[type="number"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input[type="number"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'TEXT':
if (typeof values[key] !== "undefined") {
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('input.normal[type="text"][name=field'+custom_field_key+'_value\\[\\]]').show();
$('input.normal[type="text"][name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
case 'TEXTAREA':
default:
if (typeof values[key] !== "undefined") {
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').val(recovery_values[key]);
}
$('textarea[name=field'+custom_field_key+'_value\\[\\]]').show();
$('textarea[name=field'+custom_field_key+'_recovery_value\\[\\]]').show();
break;
}
});
},
"json"
);
}
$("#id_command").change (function () {
values = Array ();
// No se envia el valor del commando.
@ -914,12 +727,22 @@ $(document).ready (function () {
}
if ($('#field5_value').val() !== '') {
ajax_get_integria_custom_fields($('#field5_value').val(), integria_custom_fields_values, integria_custom_fields_rvalues);
ajax_get_integria_custom_fields(
$('#field5_value').val(),
integria_custom_fields_values,
integria_custom_fields_rvalues,
max_macro_fields
);
$('#field5_value').trigger('change');
}
$('#field5_value').on('change', function() {
ajax_get_integria_custom_fields($(this).val());
ajax_get_integria_custom_fields(
$(this).val(),
[],
[],
max_macro_fields
);
});
}

View File

@ -571,6 +571,7 @@ if (!$maps && is_metaconsole() === false) {
}
if ($maps || is_metaconsole() === true) {
$buttons = '';
if ($vconsoles_write || $vconsoles_manage) {
if (is_metaconsole() === false) {
$actionUrl = 'index.php?sec=network&amp;sec2=godmode/reporting/visual_console_builder';
@ -578,20 +579,22 @@ if ($maps || is_metaconsole() === true) {
$actionUrl = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&action2=new&operation=new_visualmap&tab=data&pure='.$pure;
}
echo '<form action="'.$actionUrl.'" method="post">';
html_print_input_hidden('edit_layout', 1);
$buttons .= '<form action="'.$actionUrl.'" method="post">';
$buttons .= html_print_input_hidden('edit_layout', 1, true);
html_print_action_buttons(
html_print_submit_button(
__('Create'),
'',
false,
[ 'icon' => 'next'],
true
),
[ 'right_content' => $tablePagination ]
$buttons .= html_print_submit_button(
__('Create'),
'',
false,
[ 'icon' => 'next'],
true
);
echo '</form>';
$buttons .= '</form>';
}
html_print_action_buttons(
$buttons,
[ 'right_content' => $tablePagination ]
);
}

View File

@ -2063,7 +2063,7 @@ if ($create_alert || $update_alert) {
}
// DIALOG ADD MORE ACTIONS.
echo '<div id="add_action_snmp-div" class="invisible left">';
echo '<div id="add_action_snmp-div" class="invisible">';
echo '<form id="add_action_form" method="post">';
echo '<table class="w100p">';
@ -2212,6 +2212,7 @@ if ($create_alert || $update_alert) {
ui_require_javascript_file('pandora', 'include/javascript/', true);
ui_require_javascript_file('tinymce', 'vendor/tinymce/tinymce/');
ui_require_javascript_file('alert');
?>
<script language="javascript" type="text/javascript">
@ -2287,6 +2288,7 @@ $(document).ready (function () {
name: "content_type",
value: "<?php echo $al_field4; ?>"
})
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
values,
function (data, status) {
@ -2317,6 +2319,26 @@ $(document).ready (function () {
}
$('#table_macros-field').show();
}
if($("#alert_type option:selected").text() === "Create Pandora ITSM ticket") {
// At start hide all rows and inputs corresponding to custom fields, regardless of what its type is.
if (i>=8) {
$('[name=field'+i+'_value\\[\\]').hide();
$('[name=field'+i+'_recovery_value\\[\\]').hide();
$('#table_macros-field'+i).hide();
$('[name=field'+i+'_value_container').hide();
$('[name=field'+i+'_recovery_value_container').hide();
}
if ($('#field5_value').val() !== '') {
ajax_get_integria_custom_fields($('#field5_value').val(), [], [], max_fields);
$('#field5_value').trigger('change');
}
$('#field5_value').on('change', function() {
ajax_get_integria_custom_fields($(this).val(), [], [], max_fields);
});
}
}
},
"json"
@ -2341,7 +2363,8 @@ $(document).ready (function () {
});
function show_add_action_snmp(id_alert_snmp) {
$("#add_action_snmp-div").hide()
$("#add_action_snmp-div")
.hide()
.dialog ({
resizable: true,
draggable: true,

View File

@ -33,8 +33,6 @@ check_login();
require_once $config['homedir'].'/vendor/autoload.php';
use PandoraFMS\Dashboard\Manager;
require_once $config['homedir'].'/include/functions_profile.php';
require_once $config['homedir'].'/include/functions_users.php';
require_once $config['homedir'].'/include/functions_groups.php';
@ -1376,72 +1374,6 @@ if (is_metaconsole() === true) {
);
}
$values = [
-1 => __('Use global conf'),
1 => __('Yes'),
0 => __('No'),
];
$home_screen = '<div class="label_select"><p class="edit_user_labels">'.__('Home screen').ui_print_help_tip(
__('User can customize the home page. By default, will display \'Agent Detail\'. Example: Select \'Other\' and type index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=1 to show agent detail view'),
true
).'</p>';
$dashboards = Manager::getDashboards(
-1,
-1,
false,
false,
$id_usr
);
$dashboards_aux = [];
if ($dashboards === false) {
$dashboards = ['None' => 'None'];
} else {
foreach ($dashboards as $key => $dashboard) {
$dashboards_aux[$dashboard['id']] = $dashboard['name'];
}
}
$home_screen .= '<div id="show_db" style="display: none; width: 100%;">';
$home_screen .= html_print_select($dashboards_aux, 'dashboard', $user_info['data_section'], '', '', '', true);
$home_screen .= '</div>';
$layouts = visual_map_get_user_layouts($config['id_user'], true);
$layouts_aux = [];
if ($layouts === false) {
$layouts_aux = ['None' => 'None'];
} else {
foreach ($layouts as $layout) {
$layouts_aux[$layout] = $layout;
}
}
$home_screen .= '<div id="show_vc" style="display: none; width: 100%;">';
$home_screen .= html_print_select(
$layouts_aux,
'visual_console',
$user_info['data_section'],
'',
'',
'',
true
);
$home_screen .= '</div>';
$home_screen .= html_print_input_text(
'data_section',
$user_info['data_section'],
'',
60,
255,
true,
false
);
$home_screen = '';
$size_pagination = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Block size for pagination').'</p>';
$size_pagination .= html_print_input_text(
'block_size',
@ -2078,17 +2010,20 @@ if (is_metaconsole() === false) {
}
function show_data_section() {
var $section = $("#section").val();
var $allElements = $('div[id^="custom_home_screen_"]');
var $elementSelected = $('div[id="custom_home_screen_' + $section + '"]');
var section = $("#section").val();
if(section === 'other'){
section = 'external_link';
}
var allElements = $('div[id^="custom_home_screen_"]');
var elementSelected = $('div[id="custom_home_screen_' + section + '"]');
// Hide all elements.
$allElements.each(function() {
allElements.each(function() {
$(this).addClass('invisible');
$(this).children().addClass('invisible');
})
// Show only the selected.
$elementSelected.removeClass('invisible');
$elementSelected.children().removeClass('invisible');
elementSelected.removeClass('invisible');
elementSelected.children().removeClass('invisible');
}
function switch_ehorus_conf() {

View File

@ -26,6 +26,8 @@
* ============================================================================
*/
use PandoraFMS\Dashboard\Manager;
// Load global vars.
global $config;
@ -45,16 +47,75 @@ $homeScreenValues = [
HOME_SCREEN_DASHBOARD => __('Dashboard'),
];
$dashboards = Manager::getDashboards(
-1,
-1,
false,
false,
$id_usr
);
$dashboards_aux = [];
if ($dashboards === false) {
$dashboards = ['None' => 'None'];
} else {
foreach ($dashboards as $key => $dashboard) {
$dashboards_aux[$dashboard['id']] = $dashboard['name'];
}
}
// Custom Home Screen controls.
$customHomeScreenAddition = [];
// Home screen. Dashboard.
$customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select($dashboards_aux, 'dashboard', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%');
// Home screen. Visual consoles.
$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select($layouts_aux, 'visual_console', $user_info['data_section'], '', '', '', true, false, true, 'w100p', false, 'width: 100%');
// Home screen. External link and Other.
$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true);
$customHomeScreenAddition[HOME_SCREEN_OTHER] = html_print_input_text('data_section', $user_info['data_section'], '', 60, 255, true);
$customHomeScreenAddition[HOME_SCREEN_DASHBOARD] = html_print_select(
$dashboards_aux,
'dashboard',
$user_info['data_section'],
'',
'',
'',
true,
false,
true,
'w100p',
false,
'width: 100%'
);
$layouts = visual_map_get_user_layouts($config['id_user'], true);
$layouts_aux = [];
if ($layouts === false) {
$layouts_aux = ['None' => 'None'];
} else {
foreach ($layouts as $layout) {
$layouts_aux[$layout] = $layout;
}
}
// Home screen. Visual consoles.
$customHomeScreenAddition[HOME_SCREEN_VISUAL_CONSOLE] = html_print_select(
$layouts_aux,
'visual_console',
$user_info['data_section'],
'',
'',
'',
true,
false,
true,
'w100p',
false,
'width: 100%'
);
// Home screen. External link and Other.
$customHomeScreenAddition[HOME_SCREEN_EXTERNAL_LINK] = html_print_input_text(
'data_section',
$user_info['data_section'],
'',
60,
255,
true
);
$customHomeScreenDataField = '';
foreach ($customHomeScreenAddition as $key => $customField) {
$customHomeScreenDataField .= html_print_div(
@ -576,7 +637,7 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh
true
);
// eHorus conf
// EHorus conf.
if (isset($config['ehorus_user_level_conf']) === true && (bool) $config['ehorus_user_level_conf'] === true) {
$userManagementTable->data['captions_ehorus_user_level_enabled'][1] = __('Pandora RC user access enabled');
$userManagementTable->data['fields_ehorus_user_level_enabled'][1] = html_print_checkbox_switch(
@ -791,7 +852,7 @@ $userManagementTable->data['fields_addSettings'][0] = html_print_textarea(
5,
65,
$user_info['comments'],
($view_mode ? 'readonly="readonly"' : ''),
($view_mode) ? 'readonly="readonly"' : '',
true,
''
);
@ -945,15 +1006,7 @@ $(document).ready(function () {
$('#advanced-line1_looknfeel-1 > a').css('display', 'block');
})
var ehorus_user_level_enabled =
<?php
if (isset($user_info['ehorus_user_level_enabled']) === true) {
echo $user_info['ehorus_user_level_enabled'];
} else {
echo 0;
}
?>
;
var ehorus_user_level_enabled = '<?php echo (isset($user_info['ehorus_user_level_enabled']) === true) ? $user_info['ehorus_user_level_enabled'] : 0; ?>';
var chk_ehorus_user_level_enabled = ehorus_user_level_enabled;
if (ehorus_user_level_enabled == 0) {

View File

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

View File

@ -1,5 +1,5 @@
/* eslint-disable no-unused-vars */
/* global $, load_modal, generalShowMsg, confirmDialog */
/* global $, load_modal, generalShowMsg, confirmDialog, jQuery */
function allowDrop(ev) {
ev.preventDefault();
@ -172,3 +172,317 @@ function disabled_alert(settings) {
}
});
}
function ajax_get_integria_custom_fields(
ticket_type_id,
values,
recovery_values,
max_macro_fields
) {
values = values || [];
recovery_values = recovery_values || [];
if (
ticket_type_id === null ||
ticket_type_id === "" ||
(Array.isArray(values) &&
values.length === 0 &&
Array.isArray(recovery_values) &&
recovery_values.length === 0)
) {
for (let i = 8; i <= max_macro_fields; i++) {
$("[name=field" + i + "_value\\[\\]").val("");
$("[name=field" + i + "_recovery_value\\[\\]").val("");
}
}
// On ticket type change, hide all table rows and inputs corresponding to custom fields, regardless of what its type is.
for (let i = 8; i <= max_macro_fields; i++) {
$("[name=field" + i + "_value\\[\\]").hide();
$("[name=field" + i + "_recovery_value\\[\\]").hide();
$("#table_macros-field" + i).hide();
$("[name=field" + i + "_value_container").hide();
$("[name=field" + i + "_recovery_value_container").hide();
}
jQuery.post(
"ajax.php",
{
page: "godmode/alerts/configure_alert_action",
get_integria_ticket_custom_types: 1,
ticket_type_id: ticket_type_id
},
function(data) {
data.forEach(function(custom_field, key) {
var custom_field_key = key + 8; // Custom fields start from field 8.
if (custom_field_key > max_macro_fields) {
return;
}
// Display field row for current input.
var custom_field_row = $("#table_macros-field" + custom_field_key);
custom_field_row.show();
// Replace label text of field row for current input.
var label_html = $("#table_macros-field" + custom_field_key + " td")
.first()
.html();
var label_name = label_html.split("<br>")[0];
var new_html_content = custom_field_row
.html()
.replace(label_name, custom_field.label);
custom_field_row.html(new_html_content);
switch (custom_field.type) {
case "CHECKBOX":
var checkbox_selector = $(
'input[type="checkbox"][name=field' +
custom_field_key +
"_value\\[\\]]"
);
var checkbox_recovery_selector = $(
'input[type="checkbox"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
);
checkbox_selector.on("change", function() {
if (checkbox_selector.prop("checked")) {
checkbox_selector.attr("value", "1");
} else {
checkbox_selector.attr("value", "0");
}
});
checkbox_recovery_selector.on("change", function() {
if (checkbox_recovery_selector.prop("checked")) {
checkbox_recovery_selector.attr("value", "1");
} else {
checkbox_recovery_selector.attr("value", "0");
}
});
if (typeof values[key] !== "undefined") {
if (values[key] == 1) {
checkbox_selector.prop("checked", true);
checkbox_selector.attr("value", "1");
} else {
checkbox_selector.prop("checked", false);
checkbox_selector.attr("value", "0");
}
}
if (typeof recovery_values[key] !== "undefined") {
if (recovery_values[key] == 1) {
checkbox_recovery_selector.prop("checked", true);
checkbox_recovery_selector.attr("value", "1");
} else {
checkbox_recovery_selector.prop("checked", false);
checkbox_recovery_selector.attr("value", "0");
}
}
$("[name=field" + custom_field_key + "_value_container]").show();
$(
"[name=field" + custom_field_key + "_recovery_value_container]"
).show();
$(
'input[type="checkbox"][name=field' +
custom_field_key +
"_value\\[\\]]"
).show();
$(
'input[type="checkbox"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).show();
break;
case "COMBO":
var combo_input = $(
"select[name=field" + custom_field_key + "_value\\[\\]]"
);
var combo_input_recovery = $(
"select[name=field" + custom_field_key + "_recovery_value\\[\\]]"
);
combo_input.find("option").remove();
combo_input_recovery.find("option").remove();
var combo_values_array = custom_field.comboValue.split(",");
combo_values_array.forEach(function(value) {
combo_input.append(
$("<option>", {
value: value,
text: value
})
);
combo_input_recovery.append(
$("<option>", {
value: value,
text: value
})
);
});
if (typeof values[key] !== "undefined") {
combo_input.val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
combo_input_recovery.val(recovery_values[key]);
}
combo_input.show();
combo_input_recovery.show();
break;
case "DATE":
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).removeClass("hasDatepicker");
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).removeClass("hasDatepicker");
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).datepicker("destroy");
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).datepicker("destroy");
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).show();
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).show();
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).datepicker({ dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>" });
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).datepicker({ dateFormat: "<?php echo 'yy-mm-dd 00:00:00'; ?>" });
$.datepicker.setDefaults(
$.datepicker.regional["<?php echo get_user_language(); ?>"]
);
if (typeof values[key] !== "undefined") {
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$(
'input.datepicker[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).val(recovery_values[key]);
}
break;
case "NUMERIC":
if (typeof values[key] !== "undefined") {
$(
'input[type="number"][name=field' +
custom_field_key +
"_value\\[\\]]"
).val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$(
'input[type="number"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).val(recovery_values[key]);
}
$(
'input[type="number"][name=field' +
custom_field_key +
"_value\\[\\]]"
).show();
$(
'input[type="number"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).show();
break;
case "TEXT":
if (typeof values[key] !== "undefined") {
$(
'input.normal[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).val(values[key]);
}
if (typeof recovery_values[key] !== "undefined") {
$(
'input.normal[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).val(recovery_values[key]);
}
$(
'input.normal[type="text"][name=field' +
custom_field_key +
"_value\\[\\]]"
).show();
$(
'input.normal[type="text"][name=field' +
custom_field_key +
"_recovery_value\\[\\]]"
).show();
break;
case "TEXTAREA":
default:
if (typeof values[key] !== "undefined") {
$("textarea[name=field" + custom_field_key + "_value\\[\\]]").val(
values[key]
);
}
if (typeof recovery_values[key] !== "undefined") {
$(
"textarea[name=field" +
custom_field_key +
"_recovery_value\\[\\]]"
).val(recovery_values[key]);
}
$(
"textarea[name=field" + custom_field_key + "_value\\[\\]]"
).show();
$(
"textarea[name=field" +
custom_field_key +
"_recovery_value\\[\\]]"
).show();
break;
}
});
},
"json"
);
}

View File

@ -79,11 +79,17 @@ class Element
public function __construct(
$ajax_controller='include/ajax/general_tactical_view.ajax'
) {
global $config;
$this->interval = 0;
$this->title = __('Default element');
$this->ajaxController = $ajax_controller;
// Without ACL.
$agent = db_get_row('tagente', 'nombre', 'pandora.internals', '*');
$agent_name = $config['self_monitoring_agent_name'];
if (empty($agent_name) === true) {
$agent_name = 'pandora.internals';
}
$agent = db_get_row('tagente', 'nombre', $agent_name, '*');
if (is_array($agent) === true) {
$this->monitoringAgent = $agent;
}

View File

@ -12741,12 +12741,6 @@ div.agents_custom_fields #datatables_wrapper div.bottom {
justify-content: flex-start !important;
}
.dt-buttons {
width: auto;
position: absolute;
margin-left: 90px;
}
.title_tactical {
padding: 10px 0px 10px 0px;
text-align: center;

View File

@ -369,8 +369,6 @@ a.pandora_pagination.current:hover {
font-size: 20px;
height: 38px;
width: 80px;
margin-left: 90px;
display: flex;
justify-content: space-between;
flex-direction: row;

View File

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

View File

@ -16,6 +16,8 @@ global $config;
// Login check.
check_login();
enterprise_include('include/functions_elasticsearch.php');
?>
<script type="text/javascript">
@ -62,30 +64,26 @@ $table->style['source'] = 'width: 80%;';
$table->data = [];
$sources = get_sources_by_agent($agent_id);
$row = [];
// Get most recent sources for active agent.
$sql = "select source, MAX(utimestamp) AS last_contact from tagent_module_log where id_agent=$agent_id GROUP BY source";
$logs = mysql_db_get_all_rows_sql($sql);
foreach ($logs as $log) {
$row['source'] = $log['source'];
$row['review'] = '<a href="javascript:void(0)">'.html_print_image('images/zoom.png', true, ['title' => __('Review in log viewer'), 'alt' => '', 'onclick' => "send_form('".$log['source'].'-'.$agent_id."')"]).'</a>';
$row['last_contact'] = html_print_image(
'images/spinner.gif',
true,
[
'id' => 'img-'.$log['source'],
'border' => '0',
'width' => '20px',
'heigth' => '20px',
'onload' => "get_last_contact('".$log['source']."', '".$agent_id."')",
]
);
$table->data[$log['source']] = $row;
if (empty($sources) === false) {
foreach ($sources as $key => $source) {
$row['source'] = $source;
$row['review'] = '<a href="javascript:void(0)">'.html_print_image('images/zoom.png', true, ['title' => __('Review in log viewer'), 'alt' => '', 'onclick' => "send_form('".$source."')"]).'</a>';
$row['last_contact'] = html_print_image(
'images/spinner.gif',
true,
[
'id' => 'img-'.$source,
'border' => '0',
'width' => '20px',
'heigth' => '20px',
'onload' => "get_last_contact('".$source."', '".$agent_id."')",
]
);
$table->data[$source] = $row;
}
}
ob_start();

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.774
%define release 231106
%define release 231108
# User and Group under which Apache is running
%define httpd_name httpd

View File

@ -6,7 +6,7 @@
%define debug_package %{nil}
%define name pandorafms_console
%define version 7.0NG.774
%define release 231106
%define release 231108
# 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.774
%define release 231106
%define release 231108
%define httpd_name httpd
# User and Group under which Apache is running
%define httpd_name apache2

View File

@ -120,6 +120,7 @@ try {
echo $e->getMessage();
}
$buttons = [];
if (check_acl($config['id_user'], 0, 'AW')) {
$buttons[] = html_print_submit_button(
__('New cluster'),
@ -131,10 +132,11 @@ if (check_acl($config['id_user'], 0, 'AW')) {
],
true
);
echo '<form action="'.ui_get_full_url($model->url.'&op=new').'" method="POST">';
html_print_action_buttons(
implode('', $buttons),
['type' => 'form_action']
);
echo '</form>';
}
echo '<form action="'.ui_get_full_url($model->url.'&op=new').'" method="POST">';
html_print_action_buttons(
implode('', $buttons),
['type' => 'form_action']
);
echo '</form>';

View File

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

View File

@ -818,6 +818,8 @@ sub main() {
&& $Config{"self_monitoring"} == 1
&& !is_metaconsole(\%Config)
&& time() - $thr_time_ref > $Config{'self_monitoring_interval'}) {
# Update agent name token.
pandora_set_tconfig_token($DBH, 'self_monitoring_agent_name', $Config{'self_monitoring_agent_name'});
$thr_time_ref = time();
pandora_thread_monitoring (\%Config, $DBH, \@Servers);
}

View File

@ -422,6 +422,9 @@ self_monitoring 1
# Self monitoring interval (in seconds).
self_monitoring_interval 300
# Self monitoring agent name.
self_monitoring_agent_name pandora.internals
# Update parent from the agent xml
update_parent 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.774";
my $pandora_build = "231106";
my $pandora_build = "231108";
our $VERSION = $pandora_version." ".$pandora_build;
# Setup hash
@ -416,6 +416,9 @@ sub pandora_load_config {
# Self monitoring interval
$pa_config->{'self_monitoring_interval'} = 300; # 5.1SP1
# Self monitoring agent name.
$pa_config->{'self_monitoring_agent_name'} = 'pandora.internals'; # 7.774
# Process XML data files as a stack
$pa_config->{"dataserver_lifo"} = 0; # 5.0
@ -1041,6 +1044,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^self_monitoring_interval\s+([0-9]*)/i) {
$pa_config->{'self_monitoring_interval'} = clean_blank($1);
}
elsif ($parametro =~ m/^self_monitoring_agent_name\s+(.*)/i) {
$pa_config->{'self_monitoring_agent_name'} = clean_blank($1);
}
elsif ($parametro =~ m/^update_parent\s+([0-1])/i) {
$pa_config->{'update_parent'} = clean_blank($1);
}

View File

@ -6315,7 +6315,7 @@ sub pandora_self_monitoring ($$) {
my $xml_output = "";
$xml_output = "<agent_data os_name='$OS' os_version='$OS_VERSION' version='" . $pa_config->{'version'} . "' description='" . $pa_config->{'rb_product_name'} . " Server version " . $pa_config->{'version'} . "' agent_name='pandora.internals' agent_alias='pandora.internals' interval='".$pa_config->{"self_monitoring_interval"}."' timestamp='".$timestamp."' >";
$xml_output = "<agent_data os_name='$OS' os_version='$OS_VERSION' version='" . $pa_config->{'version'} . "' description='" . $pa_config->{'rb_product_name'} . " Server version " . $pa_config->{'version'} . "' agent_name='" . $pa_config->{"self_monitoring_agent_name"} . "' agent_alias='" . $pa_config->{"self_monitoring_agent_name"} . "' interval='".$pa_config->{"self_monitoring_interval"}."' timestamp='".$timestamp."' >";
$xml_output .=" <module>";
$xml_output .=" <name>Status</name>";
$xml_output .=" <type>generic_proc</type>";
@ -6514,7 +6514,7 @@ sub pandora_self_monitoring ($$) {
$xml_output .= "</agent_data>";
my $filename = $pa_config->{"incomingdir"}."/pandora.internals.self".$utimestamp.".data";
my $filename = $pa_config->{"incomingdir"}."/".$pa_config->{"self_monitoring_agent_name"}.".self".$utimestamp.".data";
open (XMLFILE, ">", $filename) or die "[FATAL] Could not open internal monitoring XML file for deploying monitorization at '$filename'";
print XMLFILE $xml_output;
close (XMLFILE);
@ -6539,7 +6539,7 @@ sub pandora_thread_monitoring ($$$) {
# All trhead modules are "Status" module sons.
$module_parent = 'Status';
$xml_output = "<agent_data os_name='$OS' os_version='$OS_VERSION' version='" . $pa_config->{'version'} . "' description='" . $pa_config->{'rb_product_name'} . " Server version " . $pa_config->{'version'} . "' agent_name='pandora.internals' agent_alias='pandora.internals' interval='".$pa_config->{"self_monitoring_interval"}."' timestamp='".$timestamp."' >";
$xml_output = "<agent_data os_name='$OS' os_version='$OS_VERSION' version='" . $pa_config->{'version'} . "' description='" . $pa_config->{'rb_product_name'} . " Server version " . $pa_config->{'version'} . "' agent_name='" . $pa_config->{'self_monitoring_agent_name'} . "' agent_alias='pandora.internals' interval='".$pa_config->{"self_monitoring_interval"}."' timestamp='".$timestamp."' >";
foreach my $server (@{$servers}) {
my $producer_stats = $server->getProducerStats();
while (my ($tid, $stats) = each(%{$producer_stats})) {
@ -6605,7 +6605,7 @@ sub pandora_thread_monitoring ($$$) {
}
$xml_output .= "</agent_data>";
my $filename = $pa_config->{"incomingdir"}."/pandora.internals.threads.".$utimestamp.".data";
my $filename = $pa_config->{"incomingdir"}."/".$pa_config->{'self_monitoring_agent_name'}.".threads.".$utimestamp.".data";
open (XMLFILE, ">", $filename) or die "[FATAL] Could not write to the thread monitoring XML file '$filename'";
print XMLFILE $xml_output;
close (XMLFILE);

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

View File

@ -7,7 +7,7 @@
%define debug_package %{nil}
%define name pandorafms_server
%define version 7.0NG.774
%define release 231106
%define release 231108
Summary: Pandora FMS Server
Name: %{name}

View File

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

View File

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

View File

@ -38,7 +38,7 @@ use PandoraFMS::Config;
use PandoraFMS::DB;
# version: define current version
my $version = "7.0NG.774 Build 231106";
my $version = "7.0NG.774 Build 231108";
# 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.774 Build 231106";
my $version = "7.0NG.774 Build 231108";
# save program name for logging
my $progname = basename($0);