2010-09-13 12:26:33 +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;
|
|
|
|
|
|
|
|
require_once ("include/functions_agents.php");
|
|
|
|
|
|
|
|
if (! give_acl ($config['id_user'], $id_grupo, "AR")) {
|
2010-10-27 Miguel de Dios <miguel.dedios@artica.es>
* godmode/admin_access_logs.php: added hooks to enterprise code, and added
new filter with more options.
* include/functions_db.php: erase the deprecated function "audit_db", and
added in function "pandora_audit" two new parameters $user_id, $ip for
pass this values when it are differents to the default values. Finally
replaced the depecrated "audit_db" for "pandora_audit".
* include/functions_events.php, include/functions_filemanager.php,
include/ajax/reporting.ajax.php,
include/ajax/visual_console_builder.ajax.php,
include/ajax/alert_list.ajax.php, include/help/es/modu_group_list.php,
include/functions_incidents.php, index.php, extensions/agents_modules.php,
extensions/insert_data.php, extensions/system_info.php,
extensions/dbmanager.php, extensions/update_manager/settings.php,
extensions/pandora_logs.php, extensions/plugin_registration.php,
operation/incidents/incident.php, operation/incidents/incident_detail.php,
operation/incidents/incident_statistics.php, operation/extensions.php,
operation/visual_console/render_view.php,
operation/agentes/status_monitor.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php, operation/agentes/alerts_status.php,
operation/agentes/estado_generalagente.php,
operation/agentes/custom_fields.php, operation/agentes/estado_agente.php,
operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php, operation/agentes/sla_view.php,
operation/agentes/gis_view.php, operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/graphs.php,
operation/agentes/agent_fields.php, operation/agentes/tactical.php,
operation/agentes/group_view.php, operation/agentes/networkmap.php,
operation/servers/view_server.php,operation/servers/view_server_detail.php,
operation/snmpconsole/snmp_view.php, operation/users/user_edit.php,
operation/gis_maps/render_view.php, operation/events/event_statistics.php,
operation/events/sound_events.php, operation/events/events_validate.php,
operation/events/events_list.php, operation/events/events_marquee.php,
operation/events/events.php, operation/reporting/reporting_xml.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
mobile/operation/agents/view_agents.php, mobile/index.php,
godmode/groups/modu_group_list.php, godmode/groups/configure_group.php,
godmode/groups/configure_modu_group.php, godmode/groups/group_list.php,
godmode/extensions.php, godmode/db/db_main.php, godmode/db/db_audit.php,
godmode/db/db_sanity.php, godmode/db/db_refine.php, godmode/db/db_info.php,
godmode/db/db_event.php, godmode/db/db_purge.php,
godmode/agentes/fields_manager.php, godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php, godmode/agentes/configurar_agente.php,
godmode/agentes/configure_field.php, godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php,
godmode/servers/manage_export.php, godmode/servers/recon_script.php,
godmode/servers/manage_export_form.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php, godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/alert_list.list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php, godmode/alerts/alert_list.builder.php,
godmode/alerts/alert_commands.php, godmode/snmpconsole/snmp_alert.php,
godmode/snmpconsole/snmp_filters.php, godmode/setup/file_manager.php,
godmode/setup/os.list.php, godmode/setup/news.php,
godmode/setup/gis_step_2.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/setup/os.php,
godmode/setup/performance.php, godmode/setup/setup_auth.php,
godmode/setup/gis.php, godmode/setup/os.builder.php,
godmode/setup/setup_visuals.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/users/configure_profile.php,
godmode/gis_maps/configure_gis_map.php, godmode/gis_maps/index.php,
godmode/massive/massive_add_alerts.php,
godmode/massive/massive_copy_modules.php,
godmode/massive/massive_delete_agents.php,
godmode/massive/massive_enable_disable_alerts.php,
godmode/massive/massive_operations.php,
godmode/massive/massive_delete_profiles.php,
godmode/massive/massive_edit_agents.php,
godmode/massive/massive_delete_action_alerts.php,
godmode/massive/massive_delete_modules.php,
godmode/massive/massive_add_profiles.php,
godmode/massive/massive_delete_alerts.php,
godmode/massive/massive_edit_modules.php,
godmode/massive/massive_standby_alerts.php,
godmode/massive/massive_add_action_alerts.php,
godmode/modules/manage_network_components_form.php,
godmode/modules/manage_nc_groups_form.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_components_form_common.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_templates_form.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.list_items.php,
godmode/reporting/graph_builder.main.php,
godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/visual_console_builder.php,
godmode/reporting/reporting_builder.preview.php,
godmode/reporting/reporting_builder.main.php,
godmode/reporting/visual_console_builder.data.php,
godmode/reporting/map_builder_wizard.php,
godmode/reporting/visual_console_builder.elements.php,
godmode/reporting/graph_builder.php,
godmode/reporting/visual_console_builder.preview.php,
godmode/reporting/graph_builder.graph_editor.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/visual_console_builder.editor.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/reporting/graphs.php, godmode/reporting/graph_builder.preview.php:
Replaced the depecrated "audit_db" for "pandora_audit".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-10-27 12:47:07 +02:00
|
|
|
pandora_audit("ACL Violation",
|
2010-09-13 12:26:33 +02:00
|
|
|
"Trying to access (read) to agent ".get_agent_name($id_agente));
|
|
|
|
include ("general/noaccess.php");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
require_once('include/fgraph.php');
|
|
|
|
|
|
|
|
$period = get_parameter ( "period", 3600);
|
|
|
|
$draw_alerts = get_parameter("draw_alerts", 0);
|
|
|
|
$avg_only = get_parameter ("avg_only", 0);
|
|
|
|
$period = get_parameter ("period", 3600);
|
|
|
|
$width = get_parameter ("width", 555);
|
|
|
|
$height = get_parameter ("height", 245);
|
|
|
|
$label = get_parameter ("label", "");
|
|
|
|
$start_date = get_parameter ("start_date", date("Y-m-d"));
|
|
|
|
$draw_events = get_parameter ("draw_events", 0);
|
|
|
|
$zoom = get_parameter ("zoom", 1);
|
|
|
|
$modulesChecked = get_parameter('modules', array());
|
|
|
|
$filter = get_parameter('filter', 0);
|
|
|
|
|
|
|
|
$modules = get_agent_modules($id_agente);
|
|
|
|
|
|
|
|
if (!$filter) {
|
|
|
|
foreach ($modules as $id => $module) {
|
|
|
|
$modulesChecked[$id] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$table = null;
|
|
|
|
$table->width = '90%';
|
|
|
|
|
|
|
|
$table->size = array();
|
|
|
|
$table->size[0] = '20%';
|
|
|
|
$table->size[1] = '80%';
|
|
|
|
|
|
|
|
$table->style[0] = 'font-weight: bolder; text-align: right;';
|
|
|
|
$table->style[1] = '';
|
|
|
|
|
|
|
|
$table->data[0][0] = __('Modules');
|
|
|
|
$listModules = array();
|
|
|
|
foreach ($modules as $id => $module) {
|
|
|
|
$checked = false;
|
|
|
|
if (isset($modulesChecked[$id]))
|
|
|
|
$checked = (bool) $modulesChecked[$id];
|
|
|
|
$listModules[] = '<span style="white-space: nowrap;">' . print_checkbox('modules[' . $id . ']', 1, $checked, true) . ' ' . $module . '</span>';
|
|
|
|
}
|
|
|
|
$table->data[0][1] = implode(' ', $listModules);
|
|
|
|
|
|
|
|
$table->data[1][0] = __('Begin date');
|
|
|
|
$table->data[1][1] = print_input_text ("start_date", substr ($start_date, 0, 10),'', 10, 40, true);
|
|
|
|
$table->data[1][1] .= print_image ("images/calendar_view_day.png", true, array ("onclick" => "scwShow(scwID('text-start_date'),this);"));
|
|
|
|
|
|
|
|
$table->data[2][0] = __('Zoom factor');
|
|
|
|
$options = array ();
|
|
|
|
$options[$zoom] = 'x'.$zoom;
|
|
|
|
$options[1] = 'x1';
|
|
|
|
$options[2] = 'x2';
|
|
|
|
$options[3] = 'x3';
|
|
|
|
$options[4] = 'x4';
|
|
|
|
$table->data[2][1] = print_select ($options, "zoom", $zoom, '', '', 0, true);
|
|
|
|
|
|
|
|
$table->data[3][0] = __('Time range');
|
|
|
|
$options = array ();
|
|
|
|
$options[3600] = human_time_description_raw (3600);
|
|
|
|
$options[7200] = human_time_description_raw (7200);
|
|
|
|
$options[21600] = human_time_description_raw (21600);
|
|
|
|
$options[43200] = human_time_description_raw (43200);
|
|
|
|
$options[86400] = human_time_description_raw (86400);
|
|
|
|
$options[172800] = human_time_description_raw (172800);
|
|
|
|
$options[432000] = human_time_description_raw (432000);
|
|
|
|
$options[604800] = human_time_description_raw (604800);
|
|
|
|
$options[1296000] = human_time_description_raw (1296000);
|
|
|
|
$options[2592000] = human_time_description_raw (2592000);
|
|
|
|
$options[5184000] = human_time_description_raw (5184000);
|
|
|
|
$options[15552000] = human_time_description_raw (15552000);
|
|
|
|
$table->data[3][1] = print_extended_select_for_time($options, 'period', $period, '', '', 0, 7, true) . ' ' . __('secs');
|
|
|
|
|
|
|
|
$table->data[4][0] = __('Show events');
|
|
|
|
$table->data[4][1] = print_checkbox ("draw_events", 1, (bool) $draw_events, true);
|
|
|
|
$table->data[5][0] = __('Show alerts');
|
|
|
|
$table->data[5][1] = print_checkbox ("draw_alerts", 1, (bool) $draw_alerts, true);
|
|
|
|
|
|
|
|
$htmlForm = '<form method="post" action="index.php?sec=estado&sec2=operation/agentes/ver_agente&tab=graphs&id_agente=' . $id_agente . '" >';
|
|
|
|
$htmlForm .= print_table($table, true);
|
|
|
|
$htmlForm .= print_input_hidden('filter', 1, true);
|
|
|
|
$htmlForm .= '<div class="action-buttons" style="width: '.$table->width.'">';
|
|
|
|
$htmlForm .= print_submit_button (__('Filter'), 'filter_button', false, 'class="sub upd"', true);
|
|
|
|
$htmlForm .= '</div>';
|
|
|
|
$htmlForm .= '</form>';
|
|
|
|
|
|
|
|
toggle($htmlForm,__('Filter graphs'), __('Toggle filter(s)'));
|
|
|
|
|
|
|
|
$utime = get_system_time ();
|
|
|
|
$current = date("Y-m-d", $utime);
|
|
|
|
|
|
|
|
if ($start_date != $current)
|
|
|
|
$date = strtotime($start_date);
|
|
|
|
else
|
|
|
|
$date = $utime;
|
|
|
|
|
|
|
|
foreach ($modulesChecked as $idModuleShowGraph => $value) {
|
|
|
|
echo "<h3>" . $modules[$idModuleShowGraph] . '</h3>';
|
|
|
|
if ($config['flash_charts']) {
|
|
|
|
echo grafico_modulo_sparse ($idModuleShowGraph, $period, $draw_events, $width, $height,
|
|
|
|
$modules[$idModuleShowGraph], $unit_name, $draw_alerts, $avg_only, $pure, $date);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$image = 'include/fgraph.php?' .
|
|
|
|
'tipo=sparse' .
|
|
|
|
'&draw_alerts=' . $draw_alerts .
|
|
|
|
'&draw_events=' . $draw_events .
|
|
|
|
'&id=' . $idModuleShowGraph .
|
|
|
|
'&zoom=' . $zoom .
|
|
|
|
'&label=' . $modules[$idModuleShowGraph] .
|
|
|
|
'&height=' . $height .
|
|
|
|
'&width=' . $width .
|
|
|
|
'&period=' . $period .
|
|
|
|
'&avg_only=' . $avg_only .
|
|
|
|
'&date=' . $date;
|
|
|
|
|
|
|
|
print_image ($image, false, array ("border" => 0));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "<div style='clear: both;'></div>";
|
2010-12-28 07:17:10 +01:00
|
|
|
?>
|