diff --git a/pandora_console/operation/agentes/log_sources_status.php b/pandora_console/operation/agentes/log_sources_status.php new file mode 100644 index 0000000000..7d21974db1 --- /dev/null +++ b/pandora_console/operation/agentes/log_sources_status.php @@ -0,0 +1,101 @@ +width = '100%'; +$table->class = 'info_table'; +$table->cellpadding = '0'; +$table->cellspacing = '0'; +$table->head = []; +$table->align = []; + +$table->head[0] = "".__('Source').''; +$table->head[1] = "".__('Review').''; +$table->head[2] = "".__('Last contact').''; + +$table->style = []; +$table->style['source'] = 'width: 80%;'; + +$table->data = []; + +$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'] = ''.html_print_image('images/zoom.png', true, ['title' => __('Force remote checks'), 'alt' => '', 'onclick' => "send_form('".$log['source'].'-'.$agent_id."')"]).''; + $row['last_contact'] = human_time_comparation($log['last_contact']); + + $table->data[] = $row; +} + +ob_start(); + +if (!empty($table->data)) { + echo '
'; + html_print_table($table); + echo '
'; +} else { + ui_print_info_message(['no_close' => true, 'message' => __('No log sources found') ]); + $log_sources_defined = false; +} + +// Hidden form to perform post request to Log Viewer page when clicking on the Review field icon. +echo ''; + +$html_content = ob_get_clean(); + +// Create controlled toggle content. +ui_toggle( + $html_content, + __('Log sources status'), + 'log_sources_status', + !$log_sources_defined, + false, + '', + 'white_table_graph_content no-padding-imp' +); + +?> + + diff --git a/pandora_console/operation/agentes/ver_agente.php b/pandora_console/operation/agentes/ver_agente.php index acb31f5cdc..2ddf293d44 100644 --- a/pandora_console/operation/agentes/ver_agente.php +++ b/pandora_console/operation/agentes/ver_agente.php @@ -1576,6 +1576,8 @@ switch ($tab) { include 'estado_monitores.php'; echo ""; include 'alerts_status.php'; + echo ""; + include 'log_sources_status.php'; // Check permissions to read events if (check_acl($config['id_user'], 0, 'ER')) { echo "";