2012-04-02 Dario Rodriguez <dario.rodriguez@artica.es>
*operation/visual_console/render_view.php,
operation/visual_console/index.php,
operation/agentes/networkmap.php,
operation/servers/view_server.php,
operation/servers/recon_view.php,
operation/servers/view_server_detail.php,
operation/menu.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
general/header.php,
godmode/servers/modificar_server.php,
godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/graph_builder.main.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/graph_builder.php,
godmode/reporting/graph_builder.graph_editor.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/map_builder.php,
godmode/reporting/graphs.php: Merged changes in menu structure
from 4.0.2 to trunk version
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-04-02 09:53:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2009 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.
|
|
|
|
// Load global vars
|
|
|
|
global $config;
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
check_login();
|
2012-04-02 Dario Rodriguez <dario.rodriguez@artica.es>
*operation/visual_console/render_view.php,
operation/visual_console/index.php,
operation/agentes/networkmap.php,
operation/servers/view_server.php,
operation/servers/recon_view.php,
operation/servers/view_server_detail.php,
operation/menu.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
general/header.php,
godmode/servers/modificar_server.php,
godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/graph_builder.main.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/graph_builder.php,
godmode/reporting/graph_builder.graph_editor.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/map_builder.php,
godmode/reporting/graphs.php: Merged changes in menu structure
from 4.0.2 to trunk version
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-04-02 09:53:24 +02:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (! check_acl($config['id_user'], 0, 'PM')) {
|
|
|
|
db_pandora_audit(
|
|
|
|
'ACL Violation',
|
|
|
|
'Trying to access recon task viewer'
|
|
|
|
);
|
|
|
|
include 'general/noaccess.php';
|
|
|
|
return;
|
2012-04-02 Dario Rodriguez <dario.rodriguez@artica.es>
*operation/visual_console/render_view.php,
operation/visual_console/index.php,
operation/agentes/networkmap.php,
operation/servers/view_server.php,
operation/servers/recon_view.php,
operation/servers/view_server_detail.php,
operation/menu.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
general/header.php,
godmode/servers/modificar_server.php,
godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/graph_builder.main.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/graph_builder.php,
godmode/reporting/graph_builder.graph_editor.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/map_builder.php,
godmode/reporting/graphs.php: Merged changes in menu structure
from 4.0.2 to trunk version
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-04-02 09:53:24 +02:00
|
|
|
}
|
2018-02-21 12:23:52 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
// Get all recon servers
|
2012-04-02 Dario Rodriguez <dario.rodriguez@artica.es>
*operation/visual_console/render_view.php,
operation/visual_console/index.php,
operation/agentes/networkmap.php,
operation/servers/view_server.php,
operation/servers/recon_view.php,
operation/servers/view_server_detail.php,
operation/menu.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
general/header.php,
godmode/servers/modificar_server.php,
godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/graph_builder.main.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/graph_builder.php,
godmode/reporting/graph_builder.graph_editor.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/map_builder.php,
godmode/reporting/graphs.php: Merged changes in menu structure
from 4.0.2 to trunk version
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-04-02 09:53:24 +02:00
|
|
|
$servers = db_get_all_rows_sql('SELECT * FROM tserver WHERE server_type = 3');
|
|
|
|
if ($servers === false) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$servers = [];
|
|
|
|
ui_print_page_header(__('Recon View'), 'images/op_recon.png', false, '', false);
|
2019-02-13 14:56:10 +01:00
|
|
|
ui_print_error_message(__('Discovery Server is disabled'));
|
2019-01-30 16:18:44 +01:00
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
$recon_task = db_get_all_rows_sql('SELECT * FROM trecon_task');
|
|
|
|
if ($recon_task === false) {
|
|
|
|
ui_print_page_header(__('Recon View'), 'images/op_recon.png', false, '', false);
|
2019-11-21 18:21:46 +01:00
|
|
|
include_once $config['homedir'].'/general/first_task/recon_view.php';
|
2019-01-30 16:18:44 +01:00
|
|
|
return;
|
|
|
|
} else {
|
|
|
|
include_once $config['homedir'].'/include/functions_graph.php';
|
|
|
|
include_once $config['homedir'].'/include/functions_servers.php';
|
|
|
|
include_once $config['homedir'].'/include/functions_network_profiles.php';
|
|
|
|
|
|
|
|
if (check_acl($config['id_user'], 0, 'AW')) {
|
|
|
|
$options['manage']['text'] = "<a href='index.php?sec=estado&sec2=godmode/servers/manage_recontask'>".html_print_image('images/setup.png', true, ['title' => __('Manage')]).'</a>';
|
|
|
|
}
|
|
|
|
|
|
|
|
$options[]['text'] = "<a href='index.php?sec=estado&sec2=operation/servers/recon_view'>".html_print_image('images/refresh_mc.png', true, ['title' => __('Refresh')]).'</a>';
|
|
|
|
|
|
|
|
ui_print_page_header(__('Recon View'), 'images/op_recon.png', false, '', false, $options);
|
|
|
|
|
|
|
|
$modules_server = 0;
|
|
|
|
$total_modules = 0;
|
|
|
|
$total_modules_data = 0;
|
|
|
|
|
|
|
|
// --------------------------------
|
|
|
|
// FORCE A RECON TASK
|
|
|
|
// --------------------------------
|
|
|
|
if (check_acl($config['id_user'], 0, 'PM')) {
|
|
|
|
if (isset($_GET['force'])) {
|
|
|
|
$id = (int) get_parameter_get('force', 0);
|
|
|
|
servers_force_recon_task($id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
foreach ($servers as $serverItem) {
|
|
|
|
$id_server = $serverItem['id_server'];
|
|
|
|
$server_name = servers_get_name($id_server);
|
|
|
|
$recon_tasks = db_get_all_rows_field_filter('trecon_task', 'id_recon_server', $id_server);
|
|
|
|
|
|
|
|
// Show network tasks for Recon Server
|
|
|
|
if ($recon_tasks === false) {
|
|
|
|
$recon_tasks = [];
|
|
|
|
}
|
|
|
|
|
|
|
|
$table = new StdClass();
|
2019-03-27 17:03:55 +01:00
|
|
|
$table->cellpadding = 0;
|
|
|
|
$table->cellspacing = 0;
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->width = '100%';
|
2019-03-27 17:03:55 +01:00
|
|
|
$table->class = 'info_table';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->head = [];
|
|
|
|
$table->data = [];
|
|
|
|
$table->align = [];
|
|
|
|
$table->headstyle = [];
|
|
|
|
for ($i = 0; $i < 9; $i++) {
|
|
|
|
$table->headstyle[$i] = 'text-align: left;';
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->head[0] = __('Force');
|
|
|
|
$table->align[0] = 'left';
|
|
|
|
|
|
|
|
$table->head[1] = __('Task name');
|
|
|
|
$table->align[1] = 'left';
|
|
|
|
|
|
|
|
$table->head[2] = __('Interval');
|
|
|
|
$table->align[2] = 'left';
|
|
|
|
|
|
|
|
$table->head[3] = __('Network');
|
|
|
|
$table->align[3] = 'left';
|
|
|
|
|
|
|
|
$table->head[4] = __('Status');
|
|
|
|
$table->align[4] = 'left';
|
|
|
|
|
|
|
|
$table->head[5] = __('Template');
|
|
|
|
$table->align[5] = 'left';
|
|
|
|
|
|
|
|
$table->head[6] = __('Progress');
|
|
|
|
$table->align[6] = 'left';
|
|
|
|
|
|
|
|
$table->head[7] = __('Updated at');
|
|
|
|
$table->align[7] = 'left';
|
|
|
|
|
|
|
|
$table->head[8] = __('Edit');
|
|
|
|
$table->align[8] = 'left';
|
|
|
|
|
|
|
|
foreach ($recon_tasks as $task) {
|
|
|
|
$data = [];
|
|
|
|
|
|
|
|
if ($task['disabled'] == 0) {
|
|
|
|
$data[0] = '<a href="index.php?sec=estado&sec2=operation/servers/recon_view&server_id='.$id_server.'&force='.$task['id_rt'].'">';
|
|
|
|
$data[0] .= html_print_image('images/target.png', true, ['title' => __('Force')]);
|
|
|
|
$data[0] .= '</a>';
|
|
|
|
} else {
|
|
|
|
$data[0] = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
$data[1] = '<b>'.$task['name'].'</b>';
|
|
|
|
|
|
|
|
$data[2] = human_time_description_raw($task['interval_sweep']);
|
|
|
|
|
|
|
|
if ($task['id_recon_script'] == 0) {
|
|
|
|
$data[3] = $task['subnet'];
|
|
|
|
} else {
|
|
|
|
$data[3] = '-';
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($task['status'] <= 0) {
|
|
|
|
$data[4] = __('Done');
|
|
|
|
} else {
|
|
|
|
$data[4] = __('Pending');
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($task['id_recon_script'] == 0) {
|
|
|
|
// Network recon task
|
|
|
|
$data[5] = html_print_image('images/network.png', true, ['title' => __('Network recon task')]).' ';
|
|
|
|
$data[5] .= network_profiles_get_name($task['id_network_profile']);
|
|
|
|
} else {
|
|
|
|
// APP recon task
|
|
|
|
$data[5] = html_print_image('images/plugin.png', true).' ';
|
|
|
|
$data[5] .= db_get_sql(sprintf('SELECT name FROM trecon_script WHERE id_recon_script = %d', $task['id_recon_script']));
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($task['status'] <= 0 || $task['status'] > 100) {
|
|
|
|
$data[6] = '-';
|
|
|
|
} else {
|
|
|
|
$data[6] = progress_bar($task['status'], 100, 20, __('Progress').':'.$task['status'].'%', 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
$data[7] = ui_print_timestamp($task['utimestamp'], true);
|
|
|
|
|
|
|
|
if (check_acl($config['id_user'], $task['id_group'], 'PM')) {
|
2019-04-02 13:42:30 +02:00
|
|
|
$table->cellclass[][8] = 'action_buttons';
|
2019-01-30 16:18:44 +01:00
|
|
|
$data[8] = '<a href="index.php?sec=gservers&sec2=godmode/servers/manage_recontask_form&update='.$task['id_rt'].'">'.html_print_image('images/wrench_orange.png', true).'</a>';
|
|
|
|
} else {
|
|
|
|
$data[8] = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
array_push($table->data, $data);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (empty($table->data)) {
|
|
|
|
echo '<div class="nf">'.__('Server').' '.$server_name.' '.__('has no recon tasks assigned').'</div>';
|
|
|
|
} else {
|
|
|
|
html_print_table($table);
|
|
|
|
}
|
|
|
|
|
|
|
|
unset($table);
|
|
|
|
}
|
|
|
|
}
|
2012-04-02 Dario Rodriguez <dario.rodriguez@artica.es>
*operation/visual_console/render_view.php,
operation/visual_console/index.php,
operation/agentes/networkmap.php,
operation/servers/view_server.php,
operation/servers/recon_view.php,
operation/servers/view_server_detail.php,
operation/menu.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
general/header.php,
godmode/servers/modificar_server.php,
godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/graph_builder.main.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/graph_builder.php,
godmode/reporting/graph_builder.graph_editor.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/map_builder.php,
godmode/reporting/graphs.php: Merged changes in menu structure
from 4.0.2 to trunk version
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5860 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-04-02 09:53:24 +02:00
|
|
|
}
|