mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-29 12:59:00 +02:00
* include/functions_graph.php include/functions_users.php include/functions_html.php include/functions_menu.php include/functions_messages.php include/functions_modules.php include/functions_reporting.php include/functions_groups.php include/functions_gis.php include/auth/ldap.php include/auth/mysql.php include/functions_networkmap.php include/functions_network_components.php include/functions_visual_map.php include/functions_profile.php include/ajax/visual_console_builder.ajax.php include/ajax/alert_list.ajax.php include/ajax/module.php include/functions_config.php include/functions_api.php include/functions_ui.php include/functions_custom_graphs.php include/fgraph.php include/functions_agents.php include/functions_db.php include/functions_alerts.php include/functions_reports.php index.php extensions/insert_data.php extensions/agents_modules.php extensions/resource_registration.php extensions/resource_exportation.php extensions/module_groups.php operation/incidents/incident_detail.php operation/search_modules.php operation/agentes/status_monitor.php operation/agentes/export_csv.php operation/agentes/estado_ultimopaquete.php operation/agentes/datos_agente.php operation/agentes/alerts_status.php operation/agentes/estado_generalagente.php operation/agentes/estado_agente.php operation/agentes/sla_view.php operation/agentes/exportdata.php operation/agentes/gis_view.php operation/agentes/estado_monitores.php operation/agentes/ver_agente.php operation/agentes/graphs.php operation/agentes/group_view.php operation/search_agents.php operation/snmpconsole/snmp_view.php operation/users/user_edit.php operation/integria_incidents/incident_detail.php operation/gis_maps/render_view.php operation/gis_maps/ajax.php operation/events/events_rss.php operation/events/export_csv.php operation/events/events_list.php operation/events/events_marquee.php operation/events/events.php operation/search_alerts.php operation/messages/message.php operation/search_users.php mobile/operation/agents/monitor_status.php mobile/operation/agents/view_agents.php mobile/operation/agents/view_alerts.php mobile/operation/agents/group_view.php mobile/operation/events/events.php ajax.php general/ui/agents_list.php godmode/groups/configure_group.php godmode/groups/group_list.php godmode/db/db_refine.php godmode/db/db_info.php godmode/db/db_purge.php godmode/agentes/module_manager_editor_common.php godmode/agentes/module_manager_editor_network.php godmode/agentes/module_manager_editor_wmi.php godmode/agentes/module_manager_editor_plugin.php godmode/agentes/module_manager_editor_prediction.php godmode/agentes/agent_conf_gis.php godmode/agentes/module_manager.php godmode/agentes/modificar_agente.php godmode/agentes/configurar_agente.php godmode/agentes/module_manager_editor.php godmode/agentes/planned_downtime.php godmode/agentes/manage_config_remote.php godmode/agentes/agent_manager.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/alert_actions.php godmode/alerts/alert_list.builder.php godmode/setup/setup_auth.php godmode/users/user_list.php godmode/users/configure_user.php godmode/users/configure_profile.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_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/reporting/visual_console_builder.wizard.php godmode/reporting/reporting_builder.list_items.php godmode/reporting/visual_console_builder.php godmode/reporting/reporting_builder.main.php godmode/reporting/visual_console_builder.data.php godmode/reporting/visual_console_builder.elements.php godmode/reporting/graph_builder.graph_editor.php godmode/reporting/reporting_builder.php godmode/reporting/reporting_builder.item_editor.php: Functions in functions_profile.php, functions_agents.php, functions_users.php, functions_massive_policies.php, functions_audit.php, functions_backup.php, functions_collection.php, functions_skins.php, functions_enterprise.php, functions_groups.php, functions_local_components.php, functions_metaconsole.php, functions_policies.php, functions_reporting.php, functions_reporting_csv.php, functions_reporting_pdf2.php, functions_services.php have their own prefixes. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4333 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
91 lines
2.8 KiB
PHP
91 lines
2.8 KiB
PHP
<?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.
|
|
|
|
session_start ();
|
|
|
|
require_once ("../../include/config.php");
|
|
require_once ("../../include/functions.php");
|
|
require_once ("../../include/functions_db.php");
|
|
require_once ("../../include/functions_modules.php");
|
|
require_once ("../../include/functions_agents.php");
|
|
|
|
$config["id_user"] = $_SESSION["id_usuario"];
|
|
if (! check_acl ($config['id_user'], 0, "AR") && ! check_acl ($config['id_user'], 0, "AW")) {
|
|
require ("../../general/noaccess.php");
|
|
return;
|
|
}
|
|
|
|
if (isset ($_GET["agentmodule"]) && isset ($_GET["agent"]) ){
|
|
$id_agentmodule = $_GET["agentmodule"];
|
|
$id_agent = $_GET["agent"];
|
|
$agentmodule_name = modules_get_agentmodule_name ($id_agentmodule);
|
|
if (! check_acl ($config['id_user'], agents_get_agent_group($id_agent), "AR")) {
|
|
db_pandora_audit("ACL Violation",
|
|
"Trying to access Agent Export Data");
|
|
require ("../../general/noaccess.php");
|
|
exit;
|
|
}
|
|
|
|
$now = date("Y/m/d H:i:s");
|
|
|
|
// Show contentype header
|
|
Header("Content-type: text/txt");
|
|
header('Content-Disposition: attachment; filename="pandora_export_'.$agentmodule_name.'.txt"');
|
|
|
|
if (isset($_GET["from_date"]))
|
|
$from_date = $_GET["from_date"];
|
|
else
|
|
$from_date = $now;
|
|
|
|
if (isset($_GET["to_date"]))
|
|
$to_date = $_GET["to_date"];
|
|
else
|
|
$to_date = $now;
|
|
|
|
// Convert to unix date
|
|
$from_date = date("U", strtotime($from_date));
|
|
$to_date = date("U", strtotime($to_date));
|
|
|
|
// Make the query
|
|
$sql1="SELECT * FROM tdatos WHERE id_agente = $id_agent AND id_agente_modulo = $id_agentmodule";
|
|
$tipo = modules_get_moduletype_name (modules_get_agentmodule_type ($id_agentmodule));
|
|
if ($tipo == "generic_data_string")
|
|
$sql1 = "SELECT *
|
|
FROM tagente_datos_string
|
|
WHERE utimestamp > $from_date AND utimestamp < $to_date AND id_agente_modulo = $id_agentmodule
|
|
ORDER BY utimestamp DESC";
|
|
else
|
|
$sql1 = "SELECT *
|
|
FROM tagente_datos
|
|
WHERE utimestamp > $from_date AND utimestamp < $to_date AND id_agente_modulo = $id_agentmodule
|
|
ORDER BY utimestamp DESC";
|
|
$result1 = db_get_all_rows_sql ($sql1, true);
|
|
if ($result1 === false) {
|
|
$result1 = array ();
|
|
}
|
|
|
|
// Render data
|
|
foreach ($result1 as $row){
|
|
echo $agentmodule_name;
|
|
echo ",";
|
|
echo $row["datos"];
|
|
echo ",";
|
|
echo $row["utimestamp"];
|
|
echo chr(13);
|
|
}
|
|
}
|
|
?>
|
|
|