Merge branch 'develop' into ent-12322-errores-en-los-menus-de-paginacion-de-operating-systems-y-alert-details
This commit is contained in:
commit
9fae476d9e
|
@ -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&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 ]
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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>';
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue