2009-07-16 18:15:10 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
2011-03-02 22:56:48 +01:00
|
|
|
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
|
2009-07-16 18:15:10 +02:00
|
|
|
// 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 Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation; 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.
|
|
|
|
|
2013-07-03 10:50:50 +02:00
|
|
|
|
|
|
|
|
2009-08-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_menu.php, include/functions_html.php,
include/functions_events.php, include/functions_messages.php,
include/functions_modules.php, include/functions_exportserver.php,
include/functions_reporting.php, include/functions_filemanager.php,
include/pchart_graph.php, include/pandora_graph.php, include/auth/dev.php,
include/auth/ldap.php, include/auth/mysql.php, include/config.inc.php,
include/functions_networkmap.php, include/functions_servers.php,
include/FusionCharts/FusionCharts_Gen.php,
include/FusionCharts/FusionCharts.php,
include/functions_network_profiles.php, include/gettext.php,
include/functions_network_components.php, include/functions_visual_map.php,
include/fgraph2.php, include/Image/image_functions.php,
include/functions_config.php, include/help/en/help_plugin_parameters.php,
include/help/en/help_snmpcommunity.php, include/help/en/help_wmiquery.php,
include/help/en/help_postprocess.php,
include/help/en/help_prediction_source_module.php,
include/help/en/help_date_format.php, include/help/en/help_recontask.php,
include/help/en/help_alert-matches.php, include/help/en/help_tcp_send.php,
include/help/en/help_wmifield.php, include/help/en/help_duplicateconfig.php,
include/help/en/help_agent_status.php,
include/help/en/help_manage_alerts.php, include/help/en/help_wmikey.php,
include/help/en/help_alert_type.php,
include/help/en/help_network_component.php,
include/help/en/help_time_stamp-comparation.php,
include/help/en/help_eventview.php, include/help/en/help_timesource.php,
include/help/en/help_alert_validation.php,
include/help/en/help_map_builder.php,
include/help/en/help_alert_recovery.php,
include/help/en/help_module_type.php,
include/help/en/help_planned_downtime.php,
include/help/en/help_serverlag.php, include/help/en/help_alerts.php,
include/help/en/help_snmpwalk.php,
include/help/en/help_module_definition.php,
include/help/en/help_plugin_definition.php,
include/help/en/help_wminamespace.php, include/help/en/help_snmpoid.php
include/help/en/help_manageconfig.php,
include/help/es/help_alert_validation.php,
include/help/es/help_plugin_parameters.php,
include/help/es/help_snmpcommunity.php, include/help/es/help_wmiquery.php,
include/help/es/help_map_builder.php, include/help/es/help_postprocess.php,
include/help/es/help_date_format.php,
include/help/es/help_alert_recovery.php,
include/help/es/help_prediction_source_module.php,
include/help/es/help_module_type.php,
include/help/es/help_planned_downtime.php,
include/help/es/help_alert-matches.php, include/help/es/help_recontask.php,
include/help/es/help_alerts.php, include/help/es/help_serverlag.php,
include/help/es/help_snmpwalk.php,
include/help/es/help_module_definition.php,
include/help/es/help_tcp_send.php, include/help/es/help_duplicateconfig.php,
include/help/es/help_wmifield.php, include/help/es/help_manage_alerts.php,
include/help/es/help_wmikey.php, include/help/es/help_plugin_definition.php,
include/help/es/help_alert_type.php, include/help/es/help_snmpoid.php,
include/help/es/help_wminamespace.php,
include/help/es/help_network_component.php,
include/help/es/help_time_stamp-comparation.php,
include/help/es/help_manageconfig.php, include/help/es/help_timesource.php,
include/config_process.php, include/functions_ui.php, include/htmlawed.php,
include/functions_custom_graphs.php, include/fgraph.php,
include/functions_incidents.php, include/functions.php,
include/functions_agents.php, include/functions_db.php,
include/functions_themes.php, include/streams.php,
include/functions_fsgraph.php, include/functions_alerts.php,
include/functions_reports.php, include/functions_extensions.php,
include/functions_ui_renders.php: change comments blocks for delete the
warnings to construct phpDoc Files, give a struct and order in the
phpDoc files.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1881 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-25 19:39:28 +02:00
|
|
|
/**
|
|
|
|
* @package Include
|
2009-08-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_menu.php, include/functions_html.php,
include/functions_events.php, include/functions_messages.php,
include/functions_modules.php, include/functions_exportserver.php,
include/functions_reporting.php, include/functions_filemanager.php,
include/pchart_graph.php, include/pandora_graph.php, include/auth/ldap.php,
include/auth/mysql.php, include/config.inc.php,
include/functions_networkmap.php, include/functions_servers.php,
include/functions_network_profiles.php, include/gettext.php,
include/functions_network_components.php, include/functions_visual_map.php,
include/fgraph2.php, include/Image/image_functions.php,
include/functions_config.php, include/config_process.php,
include/functions_ui.php, include/htmlawed.php,
include/functions_custom_graphs.php, include/fgraph.php,
include/functions_incidents.php, include/functions.php,
include/functions_agents.php, include/functions_db.php,
include/functions_themes.php, include/streams.php,
include/functions_fsgraph.php, include/functions_alerts.php,
include/functions_reports.php, include/functions_extensions.php,
include/functions_ui_renders.php: change or add the subpackage in phpdoc
comment blocks for to organize more the result phpdoc files. Start to
document undocument functions.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1882 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-26 17:37:47 +02:00
|
|
|
* @subpackage Network_Map
|
2009-08-24 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_menu.php, include/functions_html.php,
include/functions_events.php, include/functions_messages.php,
include/functions_modules.php, include/functions_exportserver.php,
include/functions_reporting.php, include/functions_filemanager.php,
include/pchart_graph.php, include/pandora_graph.php, include/auth/dev.php,
include/auth/ldap.php, include/auth/mysql.php, include/config.inc.php,
include/functions_networkmap.php, include/functions_servers.php,
include/FusionCharts/FusionCharts_Gen.php,
include/FusionCharts/FusionCharts.php,
include/functions_network_profiles.php, include/gettext.php,
include/functions_network_components.php, include/functions_visual_map.php,
include/fgraph2.php, include/Image/image_functions.php,
include/functions_config.php, include/help/en/help_plugin_parameters.php,
include/help/en/help_snmpcommunity.php, include/help/en/help_wmiquery.php,
include/help/en/help_postprocess.php,
include/help/en/help_prediction_source_module.php,
include/help/en/help_date_format.php, include/help/en/help_recontask.php,
include/help/en/help_alert-matches.php, include/help/en/help_tcp_send.php,
include/help/en/help_wmifield.php, include/help/en/help_duplicateconfig.php,
include/help/en/help_agent_status.php,
include/help/en/help_manage_alerts.php, include/help/en/help_wmikey.php,
include/help/en/help_alert_type.php,
include/help/en/help_network_component.php,
include/help/en/help_time_stamp-comparation.php,
include/help/en/help_eventview.php, include/help/en/help_timesource.php,
include/help/en/help_alert_validation.php,
include/help/en/help_map_builder.php,
include/help/en/help_alert_recovery.php,
include/help/en/help_module_type.php,
include/help/en/help_planned_downtime.php,
include/help/en/help_serverlag.php, include/help/en/help_alerts.php,
include/help/en/help_snmpwalk.php,
include/help/en/help_module_definition.php,
include/help/en/help_plugin_definition.php,
include/help/en/help_wminamespace.php, include/help/en/help_snmpoid.php
include/help/en/help_manageconfig.php,
include/help/es/help_alert_validation.php,
include/help/es/help_plugin_parameters.php,
include/help/es/help_snmpcommunity.php, include/help/es/help_wmiquery.php,
include/help/es/help_map_builder.php, include/help/es/help_postprocess.php,
include/help/es/help_date_format.php,
include/help/es/help_alert_recovery.php,
include/help/es/help_prediction_source_module.php,
include/help/es/help_module_type.php,
include/help/es/help_planned_downtime.php,
include/help/es/help_alert-matches.php, include/help/es/help_recontask.php,
include/help/es/help_alerts.php, include/help/es/help_serverlag.php,
include/help/es/help_snmpwalk.php,
include/help/es/help_module_definition.php,
include/help/es/help_tcp_send.php, include/help/es/help_duplicateconfig.php,
include/help/es/help_wmifield.php, include/help/es/help_manage_alerts.php,
include/help/es/help_wmikey.php, include/help/es/help_plugin_definition.php,
include/help/es/help_alert_type.php, include/help/es/help_snmpoid.php,
include/help/es/help_wminamespace.php,
include/help/es/help_network_component.php,
include/help/es/help_time_stamp-comparation.php,
include/help/es/help_manageconfig.php, include/help/es/help_timesource.php,
include/config_process.php, include/functions_ui.php, include/htmlawed.php,
include/functions_custom_graphs.php, include/fgraph.php,
include/functions_incidents.php, include/functions.php,
include/functions_agents.php, include/functions_db.php,
include/functions_themes.php, include/streams.php,
include/functions_fsgraph.php, include/functions_alerts.php,
include/functions_reports.php, include/functions_extensions.php,
include/functions_ui_renders.php: change comments blocks for delete the
warnings to construct phpDoc Files, give a struct and order in the
phpDoc files.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1881 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-08-25 19:39:28 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Include agents function
|
|
|
|
*/
|
2009-07-16 18:15:10 +02:00
|
|
|
require_once ('functions_agents.php');
|
* include/functions_graph.php
include/functions_html.php
include/functions_messages.php
include/db/postgresql.php
include/db/mysql.php
include/db/oracle.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_gis.php
include/auth/ldap.php
include/auth/mysql.php
include/functions_networkmap.php
include/functions_network_components.php
include/ajax/skins.ajax.php
include/ajax/reporting.ajax.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/help/en/help_timesource.php
include/help/es/help_timesource.php
include/help/ja/help_timesource.php
include/config_process.php
include/functions_ui.php
include/functions_custom_graphs.php
include/fgraph.php
include/functions_incidents.php
include/api.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/system_info.php
extensions/extension_uploader.php
extensions/pandora_logs.php
extensions/agents_modules.php
extensions/update_manager.php
extensions/ssh_console.php
extensions/dbmanager.php
extensions/vnc_view.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/users_connected.php
extensions/module_groups.php
extensions/update_manager/load_updatemanager.php
extensions/update_manager/lib/libupdate_manager_client.php
extensions/update_manager/lib/libupdate_manager.php
extensions/update_manager/lib/libupdate_manager_components.php
extensions/update_manager/lib/libupdate_manager_updates.php
extensions/update_manager/settings.php
extensions/update_manager/main.php
extensions/plugin_registration.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident_statistics.php
operation/search_modules.php
operation/visual_console/render_view.php
operation/visual_console/index.php
operation/extensions.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/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/exportdata.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/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/search_graphs.php
operation/snmpconsole/snmp_view.php
operation/users/user_edit.php
operation/gis_maps/render_view.php
operation/gis_maps/ajax.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident_statistics.php
operation/events/event_statistics.php
operation/events/events_rss.php
operation/events/export_csv.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/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/graph_viewer.php
operation/search_reports.php
operation/search_maps.php
operation/search_users.php
extras/pandora_diag.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
mobile/index.php
general/error_authconfig.php
general/links_menu.php
general/logon_ok.php
general/error_dbconfig.php
general/ui/agents_list.php
general/header.php
godmode/groups/modu_group_list.php
godmode/groups/configure_group.php
godmode/groups/configure_modu_group.php
godmode/groups/group_list.php
godmode/admin_access_logs.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/extensions.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/fields_manager.php
godmode/agentes/agent_conf_gis.php
godmode/agentes/module_manager_editor_prediction.php
godmode/agentes/module_manager.php
godmode/agentes/modificar_agente.php
godmode/agentes/configurar_agente.php
godmode/agentes/configure_field.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/recon_script.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/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/snmpconsole/snmp_alert.php
godmode/snmpconsole/snmp_filters.php
godmode/users/user_list.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/visual_console_builder.wizard.php
godmode/reporting/graph_builder.main.php
godmode/reporting/reporting_builder.list_items.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/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/map_builder.php
godmode/reporting/graphs.php
godmode/reporting/graph_builder.preview.php
include/functions_db.php: Added some includes and functions of this code have "db_" prefix.
* include/functions.php: Moved function check_login(), check_acl(),
dame_nombre_pluginid(), get_os_name() from functions_db.php to functions.php.
* include/functions_groups.php: Moved functions get_childrens(), safe_acl_group()
and get_parents(), give_disabled_group(), isAllGroups(), get_group_icon(), get_all_groups(),
get_id_groups_recursive(), get_user_groups_tree_recursive(), get_group_status(),
get_group_name(), get_group_users() from functions_db.php to this code.
* include/functions_profile.php: New library with profile functions. Moved functions
get_profile_name(), get_profiles(), create_user_profile(), delete_user_profile(),
delete_profile() from functions_db.php to this code. Added new parameter in function
get_profile() to retrieve profiles with filter conditions applied.
* include/functions_users.php: New library with users functions. Moved functions
get_users_info(), get_all_model_groups(), get_user_groups(), get_user_groups_tree(),
get_user_first_group(), user_access_to_agent() from funtions_db.php to this code.
* godmode/users/configure_user.php: Changed get_profile_filter() function to get_profile().
* include/functions_agents.php: Moved functions get_group_agents(), get_agent_modules(),
get_agent_module_id(), get_agent_id(), get_agent_name(), get_agent_modules_data_count(),
check_alert_fired(), get_agent_interval(), get_agent_os(), give_agentmodule_flag(),
agent_add_address(), agent_delete_address(), get_agent_address(), get_agent_with_ip(),
get_agent_addresses(), get_agent_status(), delete_agent(), get_agentmodule_group(),
get_agent_group() from functions_db.php to this code.
* include/functions_modules.php: Moved functions get_agentmodule(), get_agentmodule_id(),
get_agentmodule_is_init(), get_agent_modules_count(), get_module_type_name(),
get_module_type_icon(), get_agentmodule_agent(), get_agentmodule_agent_name(),
get_agentmodule_name(), get_agentmodule_type(), get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(), get_monitors_in_group(),
get_monitors_in_agent(), get_monitors_down(), get_moduletype_name(),
get_moduletype_description(), get_moduletypes(), get_module_interval(), show_icon_type(),
give_modulecategory_name(),
give_agent_id_from_module_id(), get_module_status(), get_agent_module_last_value(),
get_previous_data(), get_agentmodule_modulegroup(), get_modulegroups(),
get_modulegroup_name() from functions_db.php to this code.
* include/functions_alerts.php: Moved functions get_alert_type(), get_agent_alert_fired(),
get_module_alert_fired(), get_alert_fires_in_period(), get_group_alerts(), get_alerts_fired(),
get_alert_last_fire_timestamp_in_period(), get_agentmodule_status(),
get_agentmodule_last_status() from functions_db.php to this code.
* include/functions_exportserver.php: Moved function dame_nombre_servidorexportacion()
from functions_db.php to this code.
* include/functions_events.php: Moved functions get_group_events(), get_agent_events(),
get_module_events() from functions_db.php to this code.
* include/functions_servers.php: Moved functions get_server_name(), show_server_type(),
check_server_status(), server_status() from functions_db.php to this code.
* include/functions_network_profiles.php: Moved function get_networkprofile_name()
from functions_db.php to this code.
* include/functions_visual_map.php: Moved functions get_layoutdata_x(), get_layoutdata_y()
from fucntions_db.php to this code.
* include/functions_io.php: Moved function __() from functions_db.php to this code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4258 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-19 20:42:49 +02:00
|
|
|
require_once($config['homedir'] . "/include/functions_modules.php");
|
|
|
|
require_once($config['homedir'] . "/include/functions_groups.php");
|
2011-04-13 18:11:02 +02:00
|
|
|
ui_require_css_file ('cluetip');
|
2009-07-16 18:15:10 +02:00
|
|
|
|
|
|
|
// Check if a node descends from a given node
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
function networkmap_is_descendant ($node, $ascendant, $parents) {
|
2009-07-16 18:15:10 +02:00
|
|
|
if (! isset ($parents[$node])) {
|
|
|
|
return false;
|
|
|
|
}
|
2012-05-03 11:35:30 +02:00
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
if ($node == $ascendant) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
return networkmap_is_descendant ($parents[$node], $ascendant, $parents);
|
2009-07-16 18:15:10 +02:00
|
|
|
}
|
|
|
|
|
2013-07-25 18:52:45 +02:00
|
|
|
|
|
|
|
function networkmap_print_jsdata($graph, $js_tags = true) {
|
|
|
|
if ($js_tags) {
|
|
|
|
echo "<script type='text/javascript'>";
|
|
|
|
|
|
|
|
if (empty($graph)) {
|
|
|
|
echo "var graph = null;\n";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
echo "var graph = \n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "{\n";
|
|
|
|
echo "'nodes' : \n";
|
|
|
|
echo "[\n";
|
|
|
|
$first = true;
|
|
|
|
foreach ($graph['nodes'] as $id => $node) {
|
|
|
|
if (!$first) {
|
|
|
|
echo ",\n";
|
|
|
|
}
|
|
|
|
$first = false;
|
|
|
|
|
|
|
|
echo "{
|
|
|
|
'id' : " . $id . ",
|
|
|
|
'name' : '" . $node['label'] . "',
|
|
|
|
'url' : '" . $node['url'] . "',
|
|
|
|
'tooltip' : '" . $node['tooltip'] . "',
|
2013-07-26 13:53:11 +02:00
|
|
|
'default_tooltip' : 1,
|
|
|
|
'tooltip_content' : ' " . html_print_image('images/spinner.gif',true) . "',
|
2013-07-25 18:52:45 +02:00
|
|
|
'color' : '" . $node['color'] . "'}\n";
|
|
|
|
}
|
|
|
|
echo "],\n";
|
|
|
|
|
|
|
|
echo "'links' : \n";
|
|
|
|
echo "[\n";
|
|
|
|
$first = true;
|
|
|
|
foreach ($graph['lines'] as $line) {
|
|
|
|
if (!$first) {
|
|
|
|
echo ",\n";
|
|
|
|
}
|
|
|
|
$first = false;
|
|
|
|
|
|
|
|
echo "{
|
|
|
|
'source' : " . $line['source'] . ",
|
|
|
|
'target' : " . $line['target'] . "}\n";
|
|
|
|
}
|
|
|
|
echo "]\n";
|
|
|
|
|
|
|
|
echo "}\n";
|
|
|
|
|
|
|
|
if ($js_tags) {
|
|
|
|
echo ";\n";
|
|
|
|
echo "</script>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function networkmap_generate_hash($pandora_name, $group = 0,
|
|
|
|
$simple = 0, $font_size = 12, $layout = 'radial', $nooverlap = 0,
|
|
|
|
$zoom = 1, $ranksep = 2.5, $center = 0, $regen = 1, $pure = 0,
|
|
|
|
$id_networkmap = 0, $show_snmp_modules = 0, $cut_names = true,
|
|
|
|
$relative = false, $text_filter = '') {
|
|
|
|
|
|
|
|
$graph = networkmap_generate_dot($pandora_name, $group,
|
|
|
|
$simple, $font_size, $layout, $nooverlap, $zoom, $ranksep,
|
|
|
|
$center, $regen, $pure, $id_networkmap, $show_snmp_modules,
|
2015-01-23 08:59:42 +01:00
|
|
|
$cut_names, $relative, $text_filter, false, null, false, $strict_user);
|
2013-07-25 18:52:45 +02:00
|
|
|
|
|
|
|
$return = array();
|
|
|
|
if (!empty($graph)) {
|
|
|
|
$graph = str_replace("\r", "\n", $graph);
|
|
|
|
$graph = str_replace("\n", " ", $graph);
|
|
|
|
|
|
|
|
//Removed the head
|
|
|
|
preg_match("/graph networkmap {(.*)}/", $graph, $matches);
|
|
|
|
$graph = $matches[1];
|
|
|
|
|
|
|
|
|
|
|
|
//Get the lines and nodes
|
|
|
|
$tokens = preg_split("/; /", $graph);
|
|
|
|
foreach ($tokens as $token) {
|
|
|
|
if (empty($token)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Ignore the head rests.
|
|
|
|
if (preg_match("/(.+)\s*\[(.*)\]/", $token) != 0) {
|
|
|
|
$items[] = $token;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$lines = $nodes = array();
|
|
|
|
foreach ($items as $item) {
|
|
|
|
$matches = null;
|
|
|
|
preg_match("/(.+)\s*\[(.*)\]/", $item, $matches);
|
|
|
|
if (empty($matches))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
$id_item = trim($matches[1]);
|
|
|
|
$content_item = trim($matches[2]);
|
|
|
|
|
|
|
|
//Check if is a edge or node
|
|
|
|
if (strstr($id_item, "--") !== false) {
|
|
|
|
//edge
|
|
|
|
$lines[$id_item] = $content_item;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
//node
|
|
|
|
$id_item = (int)$id_item;
|
|
|
|
$nodes[$id_item] = $content_item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach($nodes as $key => $node) {
|
|
|
|
if ($key != 0) {
|
|
|
|
//Get label
|
|
|
|
$matches = null;
|
|
|
|
preg_match("/label=(.*),/", $node, $matches);
|
|
|
|
$label = $matches[1];
|
|
|
|
$matches = null;
|
|
|
|
preg_match("/\<TR\>\<TD\>(.*?)\<\/TD\>\<\/TR\>/",
|
|
|
|
$label, $matches);
|
|
|
|
$label = str_replace($matches[0], '', $label);
|
|
|
|
$matches = null;
|
|
|
|
preg_match("/\<TR\>\<TD\>(.*?)\<\/TD\>\<\/TR\>/",
|
|
|
|
$label, $matches);
|
|
|
|
$label = $matches[1];
|
|
|
|
|
|
|
|
//Get color
|
|
|
|
$matches = null;
|
|
|
|
preg_match("/color=\"([^\"]*)/", $node, $matches);
|
|
|
|
$color = $matches[1];
|
|
|
|
|
|
|
|
//Get tooltip
|
|
|
|
$matches = null;
|
|
|
|
preg_match("/tooltip=\"([^\"]*)/", $node, $matches);
|
|
|
|
$tooltip = $matches[1];
|
|
|
|
|
|
|
|
//Get URL
|
|
|
|
$matches = null;
|
|
|
|
preg_match("/URL=\"([^\"]*)/", $node, $matches);
|
|
|
|
$url = $matches[1];
|
|
|
|
|
|
|
|
$return['nodes'][$key]['label'] = $label;
|
|
|
|
$return['nodes'][$key]['color'] = $color;
|
|
|
|
$return['nodes'][$key]['tooltip'] = $tooltip;
|
|
|
|
$return['nodes'][$key]['url'] = $url;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
//Get tooltip
|
|
|
|
$matches = null;
|
|
|
|
preg_match("/tooltip=\"([^\"]*)/", $node, $matches);
|
|
|
|
$tooltip = $matches[1];
|
|
|
|
|
|
|
|
//Get URL
|
|
|
|
$matches = null;
|
|
|
|
preg_match("/URL=\"([^\"]*)/", $node, $matches);
|
|
|
|
$url = $matches[1];
|
|
|
|
|
|
|
|
$return['nodes'][$key]['label'] = "Pandora FMS";
|
|
|
|
$return['nodes'][$key]['color'] = "#7EBE3F";
|
|
|
|
$return['nodes'][$key]['tooltip'] = $tooltip;
|
|
|
|
$return['nodes'][$key]['url'] = $url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ksort($return['nodes']);
|
|
|
|
|
|
|
|
foreach($lines as $key => $line) {
|
|
|
|
$data = array();
|
|
|
|
|
|
|
|
$points = explode(' -- ', $key);
|
|
|
|
$data['source'] = (int) $points[0];
|
|
|
|
$data['target'] = (int) $points[1];
|
|
|
|
$return['lines'][] = $data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $return;
|
|
|
|
}
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
// Generate a dot graph definition for graphviz
|
2013-07-03 10:50:50 +02:00
|
|
|
function networkmap_generate_dot ($pandora_name, $group = 0,
|
|
|
|
$simple = 0, $font_size = 12, $layout = 'radial', $nooverlap = 0,
|
|
|
|
$zoom = 1, $ranksep = 2.5, $center = 0, $regen = 1, $pure = 0,
|
2012-07-10 13:03:00 +02:00
|
|
|
$id_networkmap = 0, $show_snmp_modules = 0, $cut_names = true,
|
2016-04-12 13:22:56 +02:00
|
|
|
$relative = false, $text_filter = '', $l2_network_or_mixed = false,
|
|
|
|
$ip_mask = null, $dont_show_subgroups = false, $strict_user = false,
|
2016-04-13 12:09:16 +02:00
|
|
|
$size_canvas = null, $old_mode = false, $id_tag = 0,
|
2016-04-13 18:00:24 +02:00
|
|
|
$show_all_modules = false, $only_modules_alerts = false,
|
|
|
|
$filter_module_group = 0, $show_modulegroup = false) {
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
|
|
|
|
global $config;
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2016-03-18 16:17:28 +01:00
|
|
|
if ($l2_network_or_mixed === 'mix_l2_l3') {
|
|
|
|
$l2_network = true;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$l2_network = $l2_network_or_mixed;
|
|
|
|
}
|
2015-08-10 19:44:28 +02:00
|
|
|
|
2014-06-24 15:17:14 +02:00
|
|
|
if ($l2_network) {
|
|
|
|
$nooverlap = 1;
|
|
|
|
}
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
$parents = array();
|
|
|
|
$orphans = array();
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
$filter = array ();
|
|
|
|
$filter['disabled'] = 0;
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
|
|
|
|
if (!empty($text_filter)) {
|
|
|
|
switch ($config['dbtype']) {
|
|
|
|
case "mysql":
|
|
|
|
case "postgresql":
|
|
|
|
$filter[] =
|
|
|
|
'(nombre COLLATE utf8_general_ci LIKE "%' . $text_filter . '%")';
|
|
|
|
break;
|
|
|
|
case "oracle":
|
|
|
|
$filter[] =
|
2015-04-30 20:11:07 +02:00
|
|
|
'(upper(nombre) LIKE upper(\'%' . $text_filter . '%\'))';
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-10 19:34:57 +02:00
|
|
|
if ($group >= 1) {
|
2014-07-17 16:28:59 +02:00
|
|
|
if ($dont_show_subgroups)
|
|
|
|
$filter['id_grupo'] = $group;
|
|
|
|
else {
|
|
|
|
$childrens = groups_get_childrens($group, null, true);
|
|
|
|
if (!empty($childrens)) {
|
|
|
|
$childrens = array_keys($childrens);
|
|
|
|
|
|
|
|
$filter['id_grupo'] = $childrens;
|
|
|
|
$filter['id_grupo'][] = $group;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$filter['id_grupo'] = $group;
|
|
|
|
}
|
|
|
|
}
|
2011-08-10 19:34:57 +02:00
|
|
|
|
2014-06-16 18:29:04 +02:00
|
|
|
//Order by id_parent ascendant for to avoid the bugs
|
|
|
|
//because the first agents to process in the next
|
|
|
|
//foreach loop are without parent (id_parent = 0)
|
2015-08-10 19:44:28 +02:00
|
|
|
|
2015-01-23 08:59:42 +01:00
|
|
|
// Get agents data
|
|
|
|
if ($strict_user) {
|
|
|
|
if ($dont_show_subgroups)
|
|
|
|
$filter['id_group'] = $group;
|
|
|
|
else {
|
|
|
|
if (!empty($childrens)) {
|
|
|
|
foreach ($childrens as $children) {
|
|
|
|
$filter_id_groups[$children] = $children;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$filter_id_groups[$group] = $group;
|
|
|
|
$filter['id_group'] = implode(',', $filter_id_groups);
|
|
|
|
}
|
2015-08-10 19:44:28 +02:00
|
|
|
|
2015-01-23 08:59:42 +01:00
|
|
|
$filter['group_by'] = 'tagente.id_agente';
|
|
|
|
$fields = array ('tagente.id_grupo, tagente.nombre, tagente.id_os, tagente.id_parent, tagente.id_agente,
|
|
|
|
tagente.normal_count, tagente.warning_count, tagente.critical_count,
|
|
|
|
tagente.unknown_count, tagente.total_count, tagente.notinit_count');
|
|
|
|
$acltags = tags_get_user_module_and_tags ($config['id_user'],'AR', $strict_user);
|
|
|
|
$agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $filter, $fields, false, $strict_user, true);
|
2015-08-10 19:44:28 +02:00
|
|
|
}
|
|
|
|
else {
|
2015-01-23 08:59:42 +01:00
|
|
|
$agents = agents_get_agents ($filter,
|
|
|
|
array ('id_grupo, nombre, id_os, id_parent, id_agente,
|
|
|
|
normal_count, warning_count, critical_count,
|
|
|
|
unknown_count, total_count, notinit_count'), 'AR',
|
|
|
|
array('field' => 'id_parent', 'order' => 'ASC'));
|
|
|
|
}
|
2014-06-16 18:29:04 +02:00
|
|
|
|
2011-08-10 19:34:57 +02:00
|
|
|
}
|
|
|
|
else if ($group == -666) {
|
|
|
|
$agents = false;
|
|
|
|
}
|
2014-05-26 16:55:19 +02:00
|
|
|
else if (!empty($ip_mask)) {
|
|
|
|
$agents = networkmap_get_new_nodes_from_ip_mask($ip_mask,
|
|
|
|
array ('id_grupo, nombre, id_os, id_parent, id_agente,
|
|
|
|
normal_count, warning_count, critical_count,
|
2015-01-23 08:59:42 +01:00
|
|
|
unknown_count, total_count, notinit_count'), $strict_user);
|
2016-04-12 15:00:38 +02:00
|
|
|
|
|
|
|
if (!empty($text_filter)) {
|
|
|
|
foreach ($agents as $index => $agent) {
|
|
|
|
if (strstr($agent['nombre'], $text_filter) === false) {
|
|
|
|
unset($agents[$index]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-05-26 16:55:19 +02:00
|
|
|
}
|
2011-08-10 19:34:57 +02:00
|
|
|
else {
|
2014-06-16 18:29:04 +02:00
|
|
|
//Order by id_parent ascendant for to avoid the bugs
|
|
|
|
//because the first agents to process in the next
|
|
|
|
//foreach loop are without parent (id_parent = 0)
|
|
|
|
|
2015-01-23 08:59:42 +01:00
|
|
|
if ($strict_user) {
|
|
|
|
$filter['group_by'] = 'tagente.id_agente';
|
|
|
|
$fields = array ('tagente.id_grupo, tagente.nombre, tagente.id_os, tagente.id_parent, tagente.id_agente,
|
|
|
|
tagente.normal_count, tagente.warning_count, tagente.critical_count,
|
|
|
|
tagente.unknown_count, tagente.total_count, tagente.notinit_count');
|
|
|
|
$acltags = tags_get_user_module_and_tags ($config['id_user'],'AR', $strict_user);
|
|
|
|
$agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $filter, $fields, false, $strict_user, true);
|
2015-08-10 19:44:28 +02:00
|
|
|
}
|
|
|
|
else {
|
2015-01-23 08:59:42 +01:00
|
|
|
$agents = agents_get_agents ($filter,
|
|
|
|
array ('id_grupo, nombre, id_os, id_parent, id_agente,
|
|
|
|
normal_count, warning_count, critical_count,
|
|
|
|
unknown_count, total_count, notinit_count'), 'AR',
|
|
|
|
array('field' => 'id_parent', 'order' => 'ASC'));
|
|
|
|
}
|
2011-08-10 19:34:57 +02:00
|
|
|
}
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
if ($agents === false)
|
2011-08-10 19:34:57 +02:00
|
|
|
//return false;
|
|
|
|
$agents = array();
|
2014-03-20 Miguel de Dios <miguel.dedios@artica.es>
* images/group_green.disabled.png, images/group_green.png,
extras/pandoradb_migrate_5.0.x_to_5.1.postgreSQL.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.oracle.sql,
extras/pandoradb_migrate_5.0.x_to_5.1.mysql.sql,
godmode/reporting/visual_console_builder.editor.js,
godmode/agentes/configurar_agente.php, include/styles/pandora.css,
include/functions_networkmap.php, include/functions_agents.php,
include/functions_visual_map_editor.php,
include/functions_modules.php, include/functions_groups.php,
include/constants.php, include/functions_visual_map.php,
include/ajax/visual_console_builder.ajax.php, pandoradb.sql,
pandoradb.postgreSQL.sql, pandoradb.oracle.sql: added the feature to
show the item for groups in visualmap.
Incident: #671
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9621 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-03-20 17:43:42 +01:00
|
|
|
|
2016-04-12 14:40:50 +02:00
|
|
|
// Filter by tags
|
|
|
|
if (!empty($id_tag)) {
|
|
|
|
foreach ($agents as $index => $agent) {
|
|
|
|
if (!tags_agent_has_tag($agent['id_agente'], $id_tag)) {
|
|
|
|
unset($agents[$index]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
// Open Graph
|
2014-05-07 19:15:48 +02:00
|
|
|
$graph = networkmap_open_graph ($layout, $nooverlap, $pure, $zoom,
|
2015-08-10 19:44:28 +02:00
|
|
|
$ranksep, $font_size, $size_canvas);
|
2009-07-16 18:15:10 +02:00
|
|
|
|
|
|
|
// Parse agents
|
|
|
|
$nodes = array ();
|
2011-08-17 17:16:54 +02:00
|
|
|
|
2014-04-01 15:10:34 +02:00
|
|
|
// Add node refs
|
2011-08-17 17:16:54 +02:00
|
|
|
$node_ref = array();
|
2014-03-19 17:43:08 +01:00
|
|
|
$modules_node_ref = array();
|
2014-04-16 15:43:28 +02:00
|
|
|
|
2016-04-13 18:00:24 +02:00
|
|
|
$module_groups = array();
|
|
|
|
|
2014-04-01 15:10:34 +02:00
|
|
|
$node_count = 0;
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
foreach ($agents as $agent) {
|
2014-04-01 15:10:34 +02:00
|
|
|
$node_count++;
|
2014-04-16 15:43:28 +02:00
|
|
|
|
2014-04-01 15:10:34 +02:00
|
|
|
$node_ref[$agent['id_agente']] = $node_count;
|
2014-04-16 15:43:28 +02:00
|
|
|
|
2011-07-04 15:07:04 +02:00
|
|
|
$agent['id_node'] = $node_count;
|
|
|
|
$agent['type'] = 'agent';
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
// Add node
|
2011-07-04 15:07:04 +02:00
|
|
|
$nodes[$node_count] = $agent;
|
|
|
|
|
2014-03-19 17:43:08 +01:00
|
|
|
if ($l2_network || $show_snmp_modules) {
|
|
|
|
$filter = array();
|
|
|
|
$filter['disabled'] = 0;
|
2015-08-10 19:44:28 +02:00
|
|
|
|
2014-03-19 17:43:08 +01:00
|
|
|
// Get agent modules data
|
2015-01-23 08:59:42 +01:00
|
|
|
if ($strict_user) {
|
2015-03-26 19:34:56 +01:00
|
|
|
$modules = tags_get_agent_modules ($agent['id_agente'], false, $acltags, false, $filter, false);
|
2015-08-10 19:44:28 +02:00
|
|
|
}
|
|
|
|
else {
|
2016-04-13 18:00:24 +02:00
|
|
|
$filter_get_modules = $filter;
|
|
|
|
if ($filter_module_group > 0) {
|
|
|
|
$filter_get_modules['id_module_group'] = $filter_module_group;
|
|
|
|
}
|
|
|
|
|
2016-04-12 13:22:56 +02:00
|
|
|
$modules = agents_get_modules(
|
2016-04-13 18:00:24 +02:00
|
|
|
$agent['id_agente'], '*', $filter_get_modules, true, true);
|
2015-08-10 19:44:28 +02:00
|
|
|
}
|
|
|
|
|
2016-04-13 12:09:16 +02:00
|
|
|
if ($modules === false) {
|
2014-03-19 17:43:08 +01:00
|
|
|
$modules = array();
|
2016-04-13 12:09:16 +02:00
|
|
|
}
|
2014-04-03 18:29:51 +02:00
|
|
|
|
2016-04-13 18:00:24 +02:00
|
|
|
$module_groups[$agent['id_node']] = array();
|
|
|
|
|
2011-07-04 15:07:04 +02:00
|
|
|
// Parse modules
|
|
|
|
foreach ($modules as $key => $module) {
|
2014-04-03 18:29:51 +02:00
|
|
|
|
2016-04-13 18:00:24 +02:00
|
|
|
if (!$show_all_modules || $show_snmp_modules) {
|
2016-04-13 12:09:16 +02:00
|
|
|
if ($module['id_tipo_modulo'] != 18 &&
|
|
|
|
(!$l2_network || $module['id_tipo_modulo'] != 6)) {
|
|
|
|
continue;
|
|
|
|
}
|
2014-04-01 15:10:34 +02:00
|
|
|
}
|
2014-04-03 18:29:51 +02:00
|
|
|
|
2016-04-13 18:00:24 +02:00
|
|
|
$status_module = modules_get_agentmodule_status(
|
|
|
|
$module['id_agente_modulo']);
|
|
|
|
|
|
|
|
if ($only_modules_alerts) {
|
|
|
|
if (($status_module != AGENT_MODULE_STATUS_NORMAL_ALERT) ||
|
|
|
|
($status_module != AGENT_MODULE_STATUS_WARNING_ALERT) ||
|
|
|
|
($status_module != AGENT_MODULE_STATUS_CRITICAL_ALERT)) {
|
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-07-04 15:07:04 +02:00
|
|
|
$node_count ++;
|
2014-04-01 15:10:34 +02:00
|
|
|
$modules_node_ref[$module['id_agente_modulo']] = $node_count;
|
|
|
|
$module['id_node'] = $node_count;
|
|
|
|
$module['type'] = 'module';
|
2016-04-13 18:00:24 +02:00
|
|
|
$module['status'] = $status_module;
|
2014-04-03 18:29:51 +02:00
|
|
|
|
2014-03-19 17:43:08 +01:00
|
|
|
// Try to get the interface name
|
2014-03-31 18:41:13 +02:00
|
|
|
if (preg_match ("/_(.+)$/" , (string)$module['nombre'], $matches)) {
|
2014-03-19 17:43:08 +01:00
|
|
|
if ($matches[1]) {
|
|
|
|
$module['nombre'] = $matches[1];
|
|
|
|
}
|
|
|
|
}
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2016-04-13 18:00:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
//// Show module groups
|
|
|
|
if ($show_modulegroup) {
|
|
|
|
|
|
|
|
$id_node_module_group = array_search(
|
|
|
|
$module['id_module_group'],
|
|
|
|
$module_groups[$agent['id_node']]);
|
|
|
|
|
|
|
|
if ($id_node_module_group === false) {
|
|
|
|
$name = db_get_value('name', 'tmodule_group',
|
|
|
|
'id_mg', $module['id_module_group']);
|
|
|
|
|
|
|
|
if (empty($name))
|
|
|
|
$name = _('N/A');
|
|
|
|
|
|
|
|
$node_count ++;
|
|
|
|
|
|
|
|
$module_group = array();
|
|
|
|
$module_group['name'] = $name;
|
|
|
|
$module_group['type'] = "module_group";
|
|
|
|
$module_group['id_server'] = $agent['id_server'];
|
|
|
|
$module_group['id_node'] = $node_count;
|
|
|
|
$module_group['parent'] = $agent['id_node'];
|
|
|
|
$nodes[$node_count] = $module_group;
|
|
|
|
|
|
|
|
$id_node_module_group = $node_count;
|
|
|
|
|
|
|
|
$module_groups[$agent['id_node']][$node_count]
|
|
|
|
= $module['id_module_group'];
|
|
|
|
|
|
|
|
$parents[$id_node_module_group] =
|
|
|
|
$module_group['parent'];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Change the status to module group to worst
|
|
|
|
//~ $status = modules_get_agentmodule_status(
|
|
|
|
//~ $module['id_agente_modulo'],
|
|
|
|
//~ false, true, $agent['id_server']);
|
|
|
|
|
|
|
|
switch ($module['status']) {
|
|
|
|
case 0: // Normal monitor
|
|
|
|
if (empty(
|
|
|
|
$nodes[$id_node_module_group]['status']))
|
|
|
|
{
|
|
|
|
$nodes[$id_node_module_group]['status'] = 0;
|
|
|
|
}
|
|
|
|
elseif ($nodes[$id_node_module_group]['status']
|
|
|
|
== -1) {
|
|
|
|
$nodes[$id_node_module_group]['status'] = 0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1: //Critical monitor
|
|
|
|
$nodes[$id_node_module_group]['status'] = 1;
|
|
|
|
break;
|
|
|
|
case 2: // Warning monitor
|
|
|
|
if (empty(
|
|
|
|
$nodes[$id_node_module_group]['status']))
|
|
|
|
{
|
|
|
|
$nodes[$id_node_module_group]['status'] = 0;
|
|
|
|
}
|
|
|
|
elseif ($nodes[$id_node_module_group]['status']
|
|
|
|
!= 1) {
|
|
|
|
$nodes[$id_node_module_group]['status'] = 2;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 4: // Alert fired
|
|
|
|
if (empty(
|
|
|
|
$nodes[$id_node_module_group]['status']))
|
|
|
|
{
|
|
|
|
$nodes[$id_node_module_group]['status'] = 4;
|
|
|
|
}
|
|
|
|
elseif (($nodes[$id_node_module_group]['status']
|
|
|
|
== 0) ||
|
|
|
|
($nodes[$id_node_module_group]['status']
|
|
|
|
== -1)) {
|
|
|
|
$nodes[$id_node_module_group]['status'] = 4;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default: // Unknown monitor
|
|
|
|
$nodes[$id_node_module_group]['status'] = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$module['parent'] = $id_node_module_group;
|
|
|
|
|
|
|
|
$parents[$module['id_node']] =
|
|
|
|
$id_node_module_group;
|
|
|
|
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$parents[$module['id_node']] =
|
|
|
|
$module['parent'] =
|
|
|
|
$agent['id_node'];
|
|
|
|
}
|
|
|
|
////////////////////////////////////////////////////////
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2011-07-04 15:07:04 +02:00
|
|
|
// Add node
|
2016-04-13 18:00:24 +02:00
|
|
|
$nodes[$module['id_node']] = $module;
|
2011-07-04 15:07:04 +02:00
|
|
|
}
|
|
|
|
}
|
2009-07-16 18:15:10 +02:00
|
|
|
}
|
2014-05-29 11:36:06 +02:00
|
|
|
|
2014-03-19 17:43:08 +01:00
|
|
|
// Drop the modules without a partner if l2_network is true
|
|
|
|
// and the snmp interfaces token is false
|
2016-03-18 16:17:28 +01:00
|
|
|
if ($l2_network_or_mixed === 'mix_l2_l3') {
|
2016-04-13 18:00:24 +02:00
|
|
|
if (!$show_all_modules || $show_snmp_modules) {
|
2016-04-13 12:09:16 +02:00
|
|
|
foreach ($modules_node_ref as $id_module => $node_count) {
|
|
|
|
if (! modules_relation_exists($id_module, array_keys($modules_node_ref))) {
|
|
|
|
if ($show_snmp_modules) {
|
|
|
|
$module_type = modules_get_agentmodule_type($id_module);
|
|
|
|
if ($module_type != 18) {
|
|
|
|
unset($nodes[$node_count]);
|
|
|
|
unset($orphans[$node_count]);
|
|
|
|
unset($parents[$node_count]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2016-03-18 16:17:28 +01:00
|
|
|
unset($nodes[$node_count]);
|
|
|
|
unset($orphans[$node_count]);
|
|
|
|
unset($parents[$node_count]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
2016-04-13 12:09:16 +02:00
|
|
|
$module_type = modules_get_agentmodule_type($id_module);
|
|
|
|
if ($module_type != 18) {
|
|
|
|
unset($nodes[$node_count]);
|
|
|
|
unset($orphans[$node_count]);
|
|
|
|
unset($parents[$node_count]);
|
|
|
|
}
|
2016-03-18 16:17:28 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Addded the relationship of parents of agents
|
|
|
|
foreach ($agents as $agent) {
|
|
|
|
if ($agent['id_parent'] != "0" &&
|
|
|
|
array_key_exists($agent['id_parent'], $node_ref)) {
|
|
|
|
|
|
|
|
|
|
|
|
$parents[$node_ref[$agent['id_agente']]] = $node_ref[$agent['id_parent']];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$orphans[$node_ref[$agent['id_agente']]] = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else if ($l2_network) {
|
2014-03-19 17:43:08 +01:00
|
|
|
foreach ($modules_node_ref as $id_module => $node_count) {
|
|
|
|
if (! modules_relation_exists($id_module, array_keys($modules_node_ref))) {
|
2014-04-01 15:10:34 +02:00
|
|
|
if ($show_snmp_modules) {
|
|
|
|
$module_type = modules_get_agentmodule_type($id_module);
|
|
|
|
if ($module_type != 18) {
|
|
|
|
unset($nodes[$node_count]);
|
2014-04-03 18:29:51 +02:00
|
|
|
unset($orphans[$node_count]);
|
2014-04-01 15:10:34 +02:00
|
|
|
unset($parents[$node_count]);
|
|
|
|
}
|
2014-04-03 18:29:51 +02:00
|
|
|
}
|
|
|
|
else {
|
2014-04-01 15:10:34 +02:00
|
|
|
unset($nodes[$node_count]);
|
2014-04-03 18:29:51 +02:00
|
|
|
unset($orphans[$node_count]);
|
2014-04-01 15:10:34 +02:00
|
|
|
unset($parents[$node_count]);
|
|
|
|
}
|
2014-04-03 18:29:51 +02:00
|
|
|
}
|
|
|
|
else {
|
2014-04-01 15:10:34 +02:00
|
|
|
$module_type = modules_get_agentmodule_type($id_module);
|
|
|
|
if ($module_type != 18) {
|
|
|
|
unset($nodes[$node_count]);
|
2014-04-03 18:29:51 +02:00
|
|
|
unset($orphans[$node_count]);
|
2014-04-01 15:10:34 +02:00
|
|
|
unset($parents[$node_count]);
|
|
|
|
}
|
2014-03-19 17:43:08 +01:00
|
|
|
}
|
|
|
|
}
|
2015-08-10 19:44:28 +02:00
|
|
|
}
|
|
|
|
else {
|
2015-06-03 17:20:37 +02:00
|
|
|
// Addded the relationship of parents of agents
|
|
|
|
foreach ($agents as $agent) {
|
|
|
|
if ($agent['id_parent'] != "0" &&
|
|
|
|
array_key_exists($agent['id_parent'], $node_ref)) {
|
|
|
|
|
|
|
|
|
|
|
|
$parents[$node_ref[$agent['id_agente']]] = $node_ref[$agent['id_parent']];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$orphans[$node_ref[$agent['id_agente']]] = 1;
|
|
|
|
}
|
|
|
|
}
|
2014-03-19 17:43:08 +01:00
|
|
|
}
|
2009-07-16 18:15:10 +02:00
|
|
|
|
2013-01-10 15:07:52 +01:00
|
|
|
// Create void statistics array
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
$stats = array();
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
// Create nodes
|
|
|
|
foreach ($nodes as $node_id => $node) {
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
if ($center > 0 && ! networkmap_is_descendant ($node_id, $center, $parents)) {
|
2009-07-16 18:15:10 +02:00
|
|
|
unset ($parents[$node_id]);
|
|
|
|
unset ($orphans[$node_id]);
|
|
|
|
unset ($nodes[$node_id]);
|
|
|
|
continue;
|
|
|
|
}
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2012-07-10 13:03:00 +02:00
|
|
|
switch ($node['type']) {
|
2011-07-04 15:07:04 +02:00
|
|
|
case 'agent':
|
2014-04-16 15:43:28 +02:00
|
|
|
$graph .= networkmap_create_agent_node($node, $simple,
|
|
|
|
$font_size, $cut_names, $relative) . "\n\t\t";
|
2012-04-23 16:21:54 +02:00
|
|
|
$stats['agents'][] = $node['id_agente'];
|
2011-07-04 15:07:04 +02:00
|
|
|
break;
|
|
|
|
case 'module':
|
2014-04-16 15:43:28 +02:00
|
|
|
$graph .= networkmap_create_module_node($node, $simple,
|
|
|
|
$font_size) . "\n\t\t";
|
2012-04-23 16:21:54 +02:00
|
|
|
$stats['modules'][] = $node['id_agente_modulo'];
|
2011-07-04 15:07:04 +02:00
|
|
|
break;
|
2016-04-13 18:00:24 +02:00
|
|
|
case 'module_group':
|
|
|
|
$graph .= networkmap_create_module_group_node ($node , $simple, $font_size, true, $node['id_server']) . "\n\t\t";
|
|
|
|
$stats['module_group'][] = null;
|
|
|
|
break;
|
2011-07-04 15:07:04 +02:00
|
|
|
}
|
2009-07-16 18:15:10 +02:00
|
|
|
}
|
2012-02-28 17:08:30 +01:00
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
// Define edges
|
|
|
|
foreach ($parents as $node => $parent_id) {
|
|
|
|
// Verify that the parent is in the graph
|
|
|
|
if (isset ($nodes[$parent_id])) {
|
2014-04-16 15:43:28 +02:00
|
|
|
$graph .= networkmap_create_edge ($parent_id,
|
|
|
|
$node,
|
|
|
|
$layout,
|
|
|
|
$nooverlap,
|
|
|
|
$pure,
|
|
|
|
$zoom,
|
|
|
|
$ranksep,
|
|
|
|
$simple,
|
|
|
|
$regen,
|
|
|
|
$font_size,
|
|
|
|
$group,
|
|
|
|
'operation/agentes/networkmap',
|
|
|
|
'topology',
|
|
|
|
$id_networkmap);
|
2012-05-03 11:35:30 +02:00
|
|
|
}
|
|
|
|
else {
|
2009-07-16 18:15:10 +02:00
|
|
|
$orphans[$node] = 1;
|
|
|
|
}
|
|
|
|
}
|
2012-02-28 17:08:30 +01:00
|
|
|
|
2014-03-19 17:43:08 +01:00
|
|
|
// Define edges for the module interfaces relations
|
2014-06-24 14:00:17 +02:00
|
|
|
// Get the remote_snmp_proc relations
|
|
|
|
$relations = modules_get_relations();
|
|
|
|
if ($relations === false)
|
|
|
|
$relations = array();
|
|
|
|
foreach ($relations as $key => $relation) {
|
|
|
|
$module_a = $relation['module_a'];
|
|
|
|
$module_a_type = modules_get_agentmodule_type($module_a);
|
|
|
|
$agent_a = modules_get_agentmodule_agent($module_a);
|
|
|
|
$module_b = $relation['module_b'];
|
|
|
|
$module_b_type = modules_get_agentmodule_type($module_b);
|
|
|
|
$agent_b = modules_get_agentmodule_agent($module_b);
|
|
|
|
|
|
|
|
if ($module_a_type == 18 && $module_b_type == 18) {
|
|
|
|
if (isset($modules_node_ref[$module_a]) &&
|
|
|
|
isset($modules_node_ref[$module_b])) {
|
|
|
|
$graph .= networkmap_create_edge(
|
|
|
|
$modules_node_ref[$module_a],
|
|
|
|
$modules_node_ref[$module_b],
|
|
|
|
$layout,
|
|
|
|
$nooverlap,
|
|
|
|
$pure,
|
|
|
|
$zoom,
|
|
|
|
$ranksep,
|
|
|
|
$simple,
|
|
|
|
$regen,
|
|
|
|
$font_size,
|
|
|
|
$group,
|
|
|
|
'operation/agentes/networkmap',
|
|
|
|
'topology',
|
|
|
|
$id_networkmap);
|
2014-04-16 15:43:28 +02:00
|
|
|
}
|
2014-06-24 14:00:17 +02:00
|
|
|
}
|
|
|
|
elseif ($module_a_type == 6 && $module_b_type == 6) {
|
|
|
|
if (isset($node_ref[$agent_a]) &&
|
|
|
|
isset($node_ref[$agent_b])) {
|
|
|
|
$graph .= networkmap_create_edge(
|
|
|
|
$node_ref[$agent_a],
|
|
|
|
$node_ref[$agent_b],
|
|
|
|
$layout,
|
|
|
|
$nooverlap,
|
|
|
|
$pure,
|
|
|
|
$zoom,
|
|
|
|
$ranksep,
|
|
|
|
$simple,
|
|
|
|
$regen,
|
|
|
|
$font_size,
|
|
|
|
$group,
|
|
|
|
'operation/agentes/networkmap',
|
|
|
|
'topology',
|
|
|
|
$id_networkmap);
|
2014-04-16 15:43:28 +02:00
|
|
|
}
|
2014-06-24 14:00:17 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
elseif ($module_a_type == 6 && $module_b_type == 18) {
|
|
|
|
if (isset($node_ref[$agent_a]) &&
|
|
|
|
isset($modules_node_ref[$module_b])) {
|
|
|
|
$graph .= networkmap_create_edge(
|
|
|
|
$node_ref[$agent_a],
|
|
|
|
$modules_node_ref[$module_b],
|
|
|
|
$layout,
|
|
|
|
$nooverlap,
|
|
|
|
$pure,
|
|
|
|
$zoom,
|
|
|
|
$ranksep,
|
|
|
|
$simple,
|
|
|
|
$regen,
|
|
|
|
$font_size,
|
|
|
|
$group,
|
|
|
|
'operation/agentes/networkmap',
|
|
|
|
'topology',
|
|
|
|
$id_networkmap);
|
2014-04-16 15:43:28 +02:00
|
|
|
}
|
2014-06-24 14:00:17 +02:00
|
|
|
}
|
|
|
|
elseif ($module_b_type == 6 && $module_a_type == 18) {
|
|
|
|
if (isset($node_ref[$agent_b]) &&
|
|
|
|
isset($modules_node_ref[$module_a])) {
|
|
|
|
$graph .= networkmap_create_edge(
|
|
|
|
$node_ref[$agent_b],
|
|
|
|
$modules_node_ref[$module_a],
|
|
|
|
$layout,
|
|
|
|
$nooverlap,
|
|
|
|
$pure,
|
|
|
|
$zoom,
|
|
|
|
$ranksep,
|
|
|
|
$simple,
|
|
|
|
$regen,
|
|
|
|
$font_size,
|
|
|
|
$group,
|
|
|
|
'operation/agentes/networkmap',
|
|
|
|
'topology',
|
|
|
|
$id_networkmap);
|
2014-03-19 17:43:08 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2014-06-24 14:00:17 +02:00
|
|
|
|
2016-01-12 12:29:54 +01:00
|
|
|
if ($l2_network || $old_mode) {
|
2014-06-25 12:49:11 +02:00
|
|
|
$count = 0;
|
|
|
|
$group_nodes = 10;
|
|
|
|
$graph .= networkmap_create_transparent_node($count);
|
|
|
|
foreach (array_keys($orphans) as $node) {
|
|
|
|
if ($group_nodes == 0) {
|
|
|
|
$count++;
|
|
|
|
$graph .= networkmap_create_transparent_node($count);
|
|
|
|
|
|
|
|
$group_nodes = 10;
|
|
|
|
}
|
|
|
|
|
|
|
|
$graph .= networkmap_create_transparent_edge('transp_' . $count,
|
|
|
|
$node);
|
|
|
|
|
|
|
|
$group_nodes--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
// Create a central node if orphan nodes exist
|
|
|
|
if (count ($orphans) || empty ($nodes)) {
|
|
|
|
$graph .= networkmap_create_pandora_node ($pandora_name, $font_size, $simple, $stats);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Define edges for orphan nodes
|
|
|
|
foreach (array_keys($orphans) as $node) {
|
|
|
|
$graph .= networkmap_create_edge ('0', $node, $layout, $nooverlap, $pure, $zoom, $ranksep, $simple, $regen, $font_size, $group, 'operation/agentes/networkmap', 'topology', $id_networkmap);
|
|
|
|
}
|
|
|
|
|
2014-03-31 18:41:13 +02:00
|
|
|
}
|
2009-07-16 18:15:10 +02:00
|
|
|
|
|
|
|
// Close graph
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
$graph .= networkmap_close_graph ();
|
2009-07-16 18:15:10 +02:00
|
|
|
|
|
|
|
return $graph;
|
|
|
|
}
|
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Generate a dot graph definition for graphviz with groups
|
2014-07-17 16:28:59 +02:00
|
|
|
function networkmap_generate_dot_groups ($pandora_name, $group = 0,
|
|
|
|
$simple = 0, $font_size = 12, $layout = 'radial', $nooverlap = 0,
|
|
|
|
$zoom = 1, $ranksep = 2.5, $center = 0, $regen = 1, $pure = 0,
|
|
|
|
$modwithalerts = 0, $module_group = 0, $hidepolicymodules = 0,
|
|
|
|
$depth = 'all', $id_networkmap = 0, $dont_show_subgroups = 0,
|
2015-08-10 19:44:28 +02:00
|
|
|
$text_filter = '', $strict_user = false, $size_canvas = null) {
|
2014-07-17 16:28:59 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
global $config;
|
2015-01-23 08:59:42 +01:00
|
|
|
|
|
|
|
if ($strict_user) {
|
|
|
|
$acltags = tags_get_user_module_and_tags ($config['id_user'],'AR', $strict_user);
|
|
|
|
}
|
2010-07-23 14:14:07 +02:00
|
|
|
$parents = array();
|
|
|
|
$orphans = array();
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
$filter = array ();
|
|
|
|
$filter['disabled'] = 0;
|
|
|
|
|
2013-01-28 12:50:30 +01:00
|
|
|
if (!empty($text_filter)) {
|
|
|
|
switch ($config['dbtype']) {
|
|
|
|
case "mysql":
|
|
|
|
case "postgresql":
|
|
|
|
$filter[] =
|
|
|
|
'(nombre COLLATE utf8_general_ci LIKE "%' . $text_filter . '%")';
|
|
|
|
break;
|
|
|
|
case "oracle":
|
|
|
|
$filter[] =
|
2015-04-30 20:11:07 +02:00
|
|
|
'(upper(nombre) LIKE upper(\'%' . $text_filter . '%\'))';
|
2013-01-28 12:50:30 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Get groups data
|
|
|
|
if ($group > 0) {
|
2011-02-21 17:47:08 +01:00
|
|
|
$groups = array();
|
2011-04-27 15:43:31 +02:00
|
|
|
$id_groups = groups_get_id_recursive($group, true);
|
2011-02-21 17:47:08 +01:00
|
|
|
|
|
|
|
foreach($id_groups as $id_group) {
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
$add = false;
|
|
|
|
if (check_acl($config["id_user"], $id_group, 'AR')) {
|
|
|
|
$add = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($add) {
|
* include/functions_graph.php
include/functions_html.php
include/functions_messages.php
include/db/postgresql.php
include/db/mysql.php
include/db/oracle.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_gis.php
include/auth/ldap.php
include/auth/mysql.php
include/functions_networkmap.php
include/functions_network_components.php
include/ajax/skins.ajax.php
include/ajax/reporting.ajax.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/help/en/help_timesource.php
include/help/es/help_timesource.php
include/help/ja/help_timesource.php
include/config_process.php
include/functions_ui.php
include/functions_custom_graphs.php
include/fgraph.php
include/functions_incidents.php
include/api.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/system_info.php
extensions/extension_uploader.php
extensions/pandora_logs.php
extensions/agents_modules.php
extensions/update_manager.php
extensions/ssh_console.php
extensions/dbmanager.php
extensions/vnc_view.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/users_connected.php
extensions/module_groups.php
extensions/update_manager/load_updatemanager.php
extensions/update_manager/lib/libupdate_manager_client.php
extensions/update_manager/lib/libupdate_manager.php
extensions/update_manager/lib/libupdate_manager_components.php
extensions/update_manager/lib/libupdate_manager_updates.php
extensions/update_manager/settings.php
extensions/update_manager/main.php
extensions/plugin_registration.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident_statistics.php
operation/search_modules.php
operation/visual_console/render_view.php
operation/visual_console/index.php
operation/extensions.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/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/exportdata.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/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/search_graphs.php
operation/snmpconsole/snmp_view.php
operation/users/user_edit.php
operation/gis_maps/render_view.php
operation/gis_maps/ajax.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident_statistics.php
operation/events/event_statistics.php
operation/events/events_rss.php
operation/events/export_csv.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/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/graph_viewer.php
operation/search_reports.php
operation/search_maps.php
operation/search_users.php
extras/pandora_diag.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
mobile/index.php
general/error_authconfig.php
general/links_menu.php
general/logon_ok.php
general/error_dbconfig.php
general/ui/agents_list.php
general/header.php
godmode/groups/modu_group_list.php
godmode/groups/configure_group.php
godmode/groups/configure_modu_group.php
godmode/groups/group_list.php
godmode/admin_access_logs.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/extensions.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/fields_manager.php
godmode/agentes/agent_conf_gis.php
godmode/agentes/module_manager_editor_prediction.php
godmode/agentes/module_manager.php
godmode/agentes/modificar_agente.php
godmode/agentes/configurar_agente.php
godmode/agentes/configure_field.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/recon_script.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/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/snmpconsole/snmp_alert.php
godmode/snmpconsole/snmp_filters.php
godmode/users/user_list.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/visual_console_builder.wizard.php
godmode/reporting/graph_builder.main.php
godmode/reporting/reporting_builder.list_items.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/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/map_builder.php
godmode/reporting/graphs.php
godmode/reporting/graph_builder.preview.php
include/functions_db.php: Added some includes and functions of this code have "db_" prefix.
* include/functions.php: Moved function check_login(), check_acl(),
dame_nombre_pluginid(), get_os_name() from functions_db.php to functions.php.
* include/functions_groups.php: Moved functions get_childrens(), safe_acl_group()
and get_parents(), give_disabled_group(), isAllGroups(), get_group_icon(), get_all_groups(),
get_id_groups_recursive(), get_user_groups_tree_recursive(), get_group_status(),
get_group_name(), get_group_users() from functions_db.php to this code.
* include/functions_profile.php: New library with profile functions. Moved functions
get_profile_name(), get_profiles(), create_user_profile(), delete_user_profile(),
delete_profile() from functions_db.php to this code. Added new parameter in function
get_profile() to retrieve profiles with filter conditions applied.
* include/functions_users.php: New library with users functions. Moved functions
get_users_info(), get_all_model_groups(), get_user_groups(), get_user_groups_tree(),
get_user_first_group(), user_access_to_agent() from funtions_db.php to this code.
* godmode/users/configure_user.php: Changed get_profile_filter() function to get_profile().
* include/functions_agents.php: Moved functions get_group_agents(), get_agent_modules(),
get_agent_module_id(), get_agent_id(), get_agent_name(), get_agent_modules_data_count(),
check_alert_fired(), get_agent_interval(), get_agent_os(), give_agentmodule_flag(),
agent_add_address(), agent_delete_address(), get_agent_address(), get_agent_with_ip(),
get_agent_addresses(), get_agent_status(), delete_agent(), get_agentmodule_group(),
get_agent_group() from functions_db.php to this code.
* include/functions_modules.php: Moved functions get_agentmodule(), get_agentmodule_id(),
get_agentmodule_is_init(), get_agent_modules_count(), get_module_type_name(),
get_module_type_icon(), get_agentmodule_agent(), get_agentmodule_agent_name(),
get_agentmodule_name(), get_agentmodule_type(), get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(), get_monitors_in_group(),
get_monitors_in_agent(), get_monitors_down(), get_moduletype_name(),
get_moduletype_description(), get_moduletypes(), get_module_interval(), show_icon_type(),
give_modulecategory_name(),
give_agent_id_from_module_id(), get_module_status(), get_agent_module_last_value(),
get_previous_data(), get_agentmodule_modulegroup(), get_modulegroups(),
get_modulegroup_name() from functions_db.php to this code.
* include/functions_alerts.php: Moved functions get_alert_type(), get_agent_alert_fired(),
get_module_alert_fired(), get_alert_fires_in_period(), get_group_alerts(), get_alerts_fired(),
get_alert_last_fire_timestamp_in_period(), get_agentmodule_status(),
get_agentmodule_last_status() from functions_db.php to this code.
* include/functions_exportserver.php: Moved function dame_nombre_servidorexportacion()
from functions_db.php to this code.
* include/functions_events.php: Moved functions get_group_events(), get_agent_events(),
get_module_events() from functions_db.php to this code.
* include/functions_servers.php: Moved functions get_server_name(), show_server_type(),
check_server_status(), server_status() from functions_db.php to this code.
* include/functions_network_profiles.php: Moved function get_networkprofile_name()
from functions_db.php to this code.
* include/functions_visual_map.php: Moved functions get_layoutdata_x(), get_layoutdata_y()
from fucntions_db.php to this code.
* include/functions_io.php: Moved function __() from functions_db.php to this code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4258 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-19 20:42:49 +02:00
|
|
|
$groups[] = db_get_row ('tgrupo', 'id_grupo', $id_group);
|
2011-02-21 17:47:08 +01:00
|
|
|
}
|
|
|
|
}
|
2012-07-10 13:03:00 +02:00
|
|
|
|
2011-02-21 17:47:08 +01:00
|
|
|
$filter['id_grupo'] = $id_groups;
|
2010-07-23 14:14:07 +02:00
|
|
|
}
|
|
|
|
else {
|
2015-01-23 08:59:42 +01:00
|
|
|
if ($strict_user) {
|
|
|
|
$groups = users_get_groups ($config['id_user'],"AR", false, true);
|
|
|
|
} else {
|
|
|
|
$groups = db_get_all_rows_in_table ('tgrupo');
|
|
|
|
}
|
2013-07-16 11:09:50 +02:00
|
|
|
if ($groups === false) {
|
2011-07-19 16:29:59 +02:00
|
|
|
$groups = array();
|
|
|
|
}
|
2010-07-23 14:14:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Open Graph
|
2015-08-10 19:44:28 +02:00
|
|
|
$graph = networkmap_open_graph ($layout, $nooverlap, $pure, $zoom,
|
|
|
|
$ranksep, $font_size, $size_canvas);
|
2010-07-23 14:14:07 +02:00
|
|
|
|
|
|
|
$node_count = 0;
|
|
|
|
|
|
|
|
// Parse groups
|
|
|
|
$nodes = array ();
|
|
|
|
$nodes_groups = array();
|
2011-02-21 17:47:08 +01:00
|
|
|
foreach ($groups as $group2) {
|
2010-07-23 14:14:07 +02:00
|
|
|
$node_count ++;
|
2011-02-21 17:47:08 +01:00
|
|
|
$group2['type'] = 'group';
|
|
|
|
$group2['id_node'] = $node_count;
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Add node
|
2011-02-21 17:47:08 +01:00
|
|
|
$nodes_groups[$group2['id_grupo']] = $group2;
|
2010-07-23 14:14:07 +02:00
|
|
|
}
|
2015-08-10 19:44:28 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
$node_count = 0;
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
$groups_hiden = array();
|
2010-07-23 14:14:07 +02:00
|
|
|
foreach ($nodes_groups as $node_group) {
|
2013-07-03 10:50:50 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
$node_count++;
|
|
|
|
|
|
|
|
// Save node parent information to define edges later
|
2011-02-21 17:47:08 +01:00
|
|
|
if ($node_group['parent'] != "0" && $node_group['id_grupo'] != $group) {
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
if ((!$dont_show_subgroups) || ($group == 0)) {
|
|
|
|
$parents[$node_count] = $nodes_groups[$node_group['parent']]['id_node'];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$groups_hiden[$node_group['id_grupo']] = 1;
|
|
|
|
continue;
|
|
|
|
}
|
2012-07-10 13:03:00 +02:00
|
|
|
}
|
|
|
|
else {
|
2010-07-23 14:14:07 +02:00
|
|
|
$orphans[$node_count] = 1;
|
|
|
|
}
|
|
|
|
|
2012-07-10 13:03:00 +02:00
|
|
|
$nodes[$node_count] = $node_group;
|
2010-07-23 14:14:07 +02:00
|
|
|
}
|
|
|
|
|
2012-07-10 13:03:00 +02:00
|
|
|
if ($depth != 'group') {
|
2015-01-23 08:59:42 +01:00
|
|
|
if ($strict_user) {
|
|
|
|
$filter['group_by'] = 'tagente.nombre';
|
2015-03-31 12:23:40 +02:00
|
|
|
$filter['id_group'] = $filter['id_grupo'];
|
2015-01-23 08:59:42 +01:00
|
|
|
$fields = array ('tagente.id_grupo, tagente.nombre, tagente.id_os, tagente.id_agente,
|
|
|
|
tagente.normal_count, tagente.warning_count, tagente.critical_count,
|
|
|
|
tagente.unknown_count, tagente.total_count, tagente.notinit_count');
|
|
|
|
$agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $filter, $fields, false, $strict_user, true);
|
2015-03-31 12:23:40 +02:00
|
|
|
unset($filter['id_group']);
|
2015-01-23 08:59:42 +01:00
|
|
|
} else {
|
2010-07-23 14:14:07 +02:00
|
|
|
// Get agents data
|
2011-04-15 12:57:43 +02:00
|
|
|
$agents = agents_get_agents ($filter,
|
2012-11-27 10:42:41 +01:00
|
|
|
array ('id_grupo, nombre, id_os, id_agente,
|
2014-07-17 16:28:59 +02:00
|
|
|
normal_count, warning_count, critical_count,
|
|
|
|
unknown_count, total_count, notinit_count'));
|
2016-01-27 13:15:23 +01:00
|
|
|
}
|
2010-07-23 14:14:07 +02:00
|
|
|
if ($agents === false)
|
2011-02-21 17:47:08 +01:00
|
|
|
$agents = array();
|
2010-07-23 14:14:07 +02:00
|
|
|
|
|
|
|
// Parse agents
|
|
|
|
$nodes_agents = array();
|
|
|
|
foreach ($agents as $agent) {
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
if ($dont_show_subgroups) {
|
|
|
|
if (!empty($groups_hiden[$agent['id_grupo']])) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2013-01-29 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/reporting_builder.php,
godmode/agentes/configurar_agente.php, godmode/menu.php,
include/functions_ui.php, include/functions_agents.php,
include/functions_alerts.php, include/functions_menu.php,
include/functions_networkmap.php,
include/help/en/help_alert_type.php,
include/help/es/help_alert_type.php,
include/functions_reporting.php,
operation/agentes/alerts_status.functions.php,
operation/agentes/alerts_status.php: erased the ocurrences about
the deprecated alert compounds.
Fixes: #3602487
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7543 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-29 15:42:55 +01:00
|
|
|
|
2013-01-10 15:07:52 +01:00
|
|
|
// If only agents with alerts => agents without alerts discarded
|
|
|
|
$alert_agent = agents_get_alerts($agent['id_agente']);
|
|
|
|
|
2013-01-29 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/reporting_builder.php,
godmode/agentes/configurar_agente.php, godmode/menu.php,
include/functions_ui.php, include/functions_agents.php,
include/functions_alerts.php, include/functions_menu.php,
include/functions_networkmap.php,
include/help/en/help_alert_type.php,
include/help/es/help_alert_type.php,
include/functions_reporting.php,
operation/agentes/alerts_status.functions.php,
operation/agentes/alerts_status.php: erased the ocurrences about
the deprecated alert compounds.
Fixes: #3602487
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7543 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-29 15:42:55 +01:00
|
|
|
if ($modwithalerts and empty($alert_agent['simple'])) {
|
2013-01-10 15:07:52 +01:00
|
|
|
continue;
|
|
|
|
}
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
$node_count ++;
|
|
|
|
// Save node parent information to define edges later
|
|
|
|
$parents[$node_count] = $agent['parent'] = $nodes_groups[$agent['id_grupo']]['id_node'];
|
2012-07-10 13:03:00 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
$agent['id_node'] = $node_count;
|
|
|
|
$agent['type'] = 'agent';
|
|
|
|
// Add node
|
|
|
|
$nodes[$node_count] = $nodes_agents[$agent['id_agente']] = $agent;
|
|
|
|
|
2012-07-10 13:03:00 +02:00
|
|
|
if ($depth == 'agent') {
|
2010-07-23 14:14:07 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get agent modules data
|
2015-01-23 08:59:42 +01:00
|
|
|
if ($strict_user) {
|
|
|
|
$filter['disabled'] = 0;
|
2015-03-26 19:34:56 +01:00
|
|
|
$modules = tags_get_agent_modules ($agent['id_agente'], false, $acltags, false, $filter, false);
|
2015-01-23 08:59:42 +01:00
|
|
|
} else {
|
|
|
|
$modules = agents_get_modules ($agent['id_agente'], false, array('disabled' => 0), true, false);
|
|
|
|
}
|
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Parse modules
|
|
|
|
foreach ($modules as $key => $module) {
|
|
|
|
$node_count ++;
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
$agent_module = modules_get_agentmodule($key);
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
$alerts_module = db_get_sql('SELECT count(*) AS num
|
2012-07-10 13:03:00 +02:00
|
|
|
FROM talert_template_modules
|
|
|
|
WHERE id_agent_module = ' . $key);
|
2010-07-23 14:14:07 +02:00
|
|
|
|
2012-07-10 13:03:00 +02:00
|
|
|
if ($alerts_module == 0 && $modwithalerts) {
|
2010-07-23 14:14:07 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2012-07-10 13:03:00 +02:00
|
|
|
if ($agent_module['id_module_group'] != $module_group &&
|
|
|
|
$module_group != 0) {
|
2010-07-23 14:14:07 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2012-07-10 13:03:00 +02:00
|
|
|
if ($hidepolicymodules && $config['enterprise_installed']) {
|
2010-07-23 14:14:07 +02:00
|
|
|
enterprise_include_once('include/functions_policies.php');
|
2012-07-10 13:03:00 +02:00
|
|
|
if (policies_is_module_in_policy($key)) {
|
2010-07-23 14:14:07 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
2012-07-10 13:03:00 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Save node parent information to define edges later
|
|
|
|
$parents[$node_count] = $agent_module['parent'] = $agent['id_node'];
|
2012-07-10 13:03:00 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
$agent_module['id_node'] = $node_count;
|
2012-07-10 13:03:00 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
$agent_module['type'] = 'module';
|
|
|
|
// Add node
|
|
|
|
$nodes[$node_count] = $agent_module;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-07-10 13:03:00 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
if (empty ($nodes)) {
|
|
|
|
return false;
|
|
|
|
}
|
2013-01-10 15:07:52 +01:00
|
|
|
|
|
|
|
// Create void statistics array
|
2013-01-29 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/reporting_builder.php,
godmode/agentes/configurar_agente.php, godmode/menu.php,
include/functions_ui.php, include/functions_agents.php,
include/functions_alerts.php, include/functions_menu.php,
include/functions_networkmap.php,
include/help/en/help_alert_type.php,
include/help/es/help_alert_type.php,
include/functions_reporting.php,
operation/agentes/alerts_status.functions.php,
operation/agentes/alerts_status.php: erased the ocurrences about
the deprecated alert compounds.
Fixes: #3602487
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7543 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-29 15:42:55 +01:00
|
|
|
$stats = array();
|
2015-01-23 08:59:42 +01:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Create nodes
|
|
|
|
foreach ($nodes as $node_id => $node) {
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
if ($center > 0 && ! networkmap_is_descendant ($node_id, $center, $parents)) {
|
2010-07-23 14:14:07 +02:00
|
|
|
unset ($parents[$node_id]);
|
|
|
|
unset ($orphans[$node_id]);
|
|
|
|
unset ($nodes[$node_id]);
|
|
|
|
continue;
|
|
|
|
}
|
2012-07-10 13:03:00 +02:00
|
|
|
switch ($node['type']) {
|
2010-07-23 14:14:07 +02:00
|
|
|
case 'group':
|
2015-01-23 08:59:42 +01:00
|
|
|
$graph .= networkmap_create_group_node ($node , $simple, $font_size, $metaconsole = false, null, $strict_user) .
|
2013-07-03 10:50:50 +02:00
|
|
|
"\n\t\t";
|
2012-04-23 16:21:54 +02:00
|
|
|
$stats['groups'][] = $node['id_grupo'];
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
|
|
|
case 'agent':
|
2013-07-03 10:50:50 +02:00
|
|
|
$graph .= networkmap_create_agent_node ($node , $simple, $font_size, true, true) .
|
|
|
|
"\n\t\t";
|
2012-04-23 16:21:54 +02:00
|
|
|
$stats['agents'][] = $node['id_agente'];
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
|
|
|
case 'module':
|
2013-07-03 10:50:50 +02:00
|
|
|
$graph .= networkmap_create_module_node ($node , $simple, $font_size) .
|
|
|
|
"\n\t\t";
|
2012-04-23 16:21:54 +02:00
|
|
|
$stats['modules'][] = $node['id_agente_modulo'];
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Define edges
|
|
|
|
foreach ($parents as $node => $parent_id) {
|
|
|
|
// Verify that the parent is in the graph
|
|
|
|
if (isset ($nodes[$parent_id])) {
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
$graph .= networkmap_create_edge ($node, $parent_id, $layout, $nooverlap, $pure, $zoom, $ranksep, $simple, $regen, $font_size, $group, 'operation/agentes/networkmap', 'groups', $id_networkmap);
|
2012-07-10 13:03:00 +02:00
|
|
|
}
|
|
|
|
else {
|
2010-07-23 14:14:07 +02:00
|
|
|
$orphans[$node] = 1;
|
|
|
|
}
|
|
|
|
}
|
2012-07-10 13:03:00 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Create a central node if orphan nodes exist
|
|
|
|
if (count ($orphans)) {
|
2012-04-23 16:21:54 +02:00
|
|
|
$graph .= networkmap_create_pandora_node ($pandora_name, $font_size, $simple, $stats);
|
2010-07-23 14:14:07 +02:00
|
|
|
}
|
2012-07-10 13:03:00 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Define edges for orphan nodes
|
|
|
|
foreach (array_keys($orphans) as $node) {
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
$graph .= networkmap_create_edge ('0', $node, $layout, $nooverlap, $pure, $zoom, $ranksep, $simple, $regen, $font_size, $group, 'operation/agentes/networkmap', 'groups', $id_networkmap);
|
2010-07-23 14:14:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// Close graph
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
$graph .= networkmap_close_graph ();
|
2010-07-23 14:14:07 +02:00
|
|
|
|
|
|
|
return $graph;
|
|
|
|
}
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
// Returns an edge definition
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
function networkmap_create_edge ($head, $tail, $layout, $nooverlap, $pure, $zoom, $ranksep, $simple, $regen, $font_size, $group, $sec2 = 'operation/agentes/networkmap', $tab = 'topology', $id_networkmap = 0) {
|
2012-10-09 17:51:33 +02:00
|
|
|
|
|
|
|
if (defined("METACONSOLE")) {
|
|
|
|
$url = '';
|
|
|
|
}
|
|
|
|
else {
|
2014-04-16 15:43:28 +02:00
|
|
|
$url = 'index.php?sec=estado&' .
|
|
|
|
'sec2=' . $sec2 .'&' .
|
|
|
|
'tab=' . $tab . '&' .
|
|
|
|
'recenter_networkmap=1&' .
|
|
|
|
'center=' . $head . '&' .
|
|
|
|
'layout=' . $layout . '&' .
|
|
|
|
'nooverlap=' . $nooverlap . '&' .
|
|
|
|
'pure=' . $pure . '&' .
|
|
|
|
'zoom=' . $zoom . '&' .
|
|
|
|
'ranksep=' . $ranksep . '&' .
|
|
|
|
'simple=' . $simple . '&' .
|
|
|
|
'regen=1'. '&' .
|
|
|
|
'font_size=' . $font_size . '&' .
|
|
|
|
'group=' . $group . '&' .
|
|
|
|
'id_networkmap=' . $id_networkmap;
|
2012-10-09 17:51:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// edgeURL allows node navigation
|
2014-04-16 15:43:28 +02:00
|
|
|
$edge = "\n" . $head . ' -- ' . $tail .
|
|
|
|
'[color="#BDBDBD", headclip=false, tailclip=false, edgeURL=""];' . "\n";
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
return $edge;
|
|
|
|
}
|
|
|
|
|
2014-06-25 12:49:11 +02:00
|
|
|
function networkmap_create_transparent_edge($head, $tail) {
|
|
|
|
// edgeURL allows node navigation
|
|
|
|
$edge = "\n" . $head . ' -- ' . $tail .
|
|
|
|
'[color="#00000000", headclip=false, tailclip=false, edgeURL=""];' . "\n";
|
|
|
|
|
|
|
|
return $edge;
|
|
|
|
}
|
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Returns a group node definition
|
2015-01-23 08:59:42 +01:00
|
|
|
function networkmap_create_group_node ($group, $simple = 0, $font_size = 10, $metaconsole = false, $id_server = null, $strict_user = false) {
|
2013-07-03 10:50:50 +02:00
|
|
|
global $config;
|
|
|
|
global $hack_networkmap_mobile;
|
|
|
|
|
2015-01-23 08:59:42 +01:00
|
|
|
$status = groups_get_status ($group['id_grupo'], $strict_user);
|
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Set node status
|
2013-07-03 10:50:50 +02:00
|
|
|
switch ($status) {
|
2010-07-23 14:14:07 +02:00
|
|
|
case 0:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_NORMAL; // Normal monitor
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
|
|
|
case 1:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_CRITICAL; // Critical monitor
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
|
|
|
case 2:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_WARNING; // Warning monitor
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
|
|
|
case 4:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_ALERTFIRED; // Alert fired
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
|
|
|
default:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_UNKNOWN; // Unknown monitor
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2013-07-03 10:50:50 +02:00
|
|
|
|
|
|
|
|
2011-04-27 15:43:31 +02:00
|
|
|
$icon = groups_get_icon($group['id_grupo']);
|
2010-07-23 14:14:07 +02:00
|
|
|
|
2012-10-09 17:51:33 +02:00
|
|
|
if ($simple == 0) {
|
2010-07-23 14:14:07 +02:00
|
|
|
// Set node icon
|
2013-07-03 10:50:50 +02:00
|
|
|
if ($hack_networkmap_mobile) {
|
|
|
|
$img_node = $config['homedir'] . "/images/groups_small/" . $icon . ".png";
|
2013-07-30 16:10:05 +02:00
|
|
|
|
2013-07-03 10:50:50 +02:00
|
|
|
if (!file_exists($img_node)) {
|
|
|
|
$img_node = '-';
|
|
|
|
}
|
|
|
|
$img_node = '<img src="' . $img_node . '" />';
|
|
|
|
}
|
|
|
|
else if (file_exists (html_print_image("images/groups_small/" . $icon . ".png", true, false, true, true))) {
|
2011-07-14 17:47:29 +02:00
|
|
|
$img_node = html_print_image("images/groups_small/" . $icon . ".png", true, false, false, true);
|
2012-02-28 17:08:30 +01:00
|
|
|
}
|
|
|
|
else {
|
2010-07-23 14:14:07 +02:00
|
|
|
$img_node = '-';
|
|
|
|
}
|
2012-02-28 17:08:30 +01:00
|
|
|
|
2013-07-03 10:50:50 +02:00
|
|
|
if (strlen(groups_get_name($group['id_grupo'])) > 40) {
|
2011-07-14 17:47:29 +02:00
|
|
|
$name = substr(groups_get_name($group['id_grupo']), 0, 40) . '...';
|
|
|
|
}
|
2013-07-03 10:50:50 +02:00
|
|
|
else {
|
2011-07-14 17:47:29 +02:00
|
|
|
$name = groups_get_name($group['id_grupo']);
|
|
|
|
}
|
2010-07-23 14:14:07 +02:00
|
|
|
|
2012-10-25 13:02:22 +02:00
|
|
|
if (defined("METACONSOLE")) {
|
|
|
|
$url = '';
|
|
|
|
$url_tooltip = '';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url = 'index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$group['id_grupo'];
|
|
|
|
$url_tooltip = 'ajax.php?page=operation/agentes/ver_agente&get_group_status_tooltip=1&id_group='.$group['id_grupo'];
|
|
|
|
}
|
|
|
|
|
2012-10-09 17:51:33 +02:00
|
|
|
$node = "\n" . $group['id_node'].' [ color="'.$status_color.'", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.30, height=0.30, label=<<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD>'.$img_node.'</TD></TR>
|
2012-04-23 16:21:54 +02:00
|
|
|
<TR><TD>'.io_safe_output($name).'</TD></TR></TABLE>>,
|
2012-10-25 13:02:22 +02:00
|
|
|
shape="invtrapezium", URL="' . $url . '",
|
|
|
|
tooltip="' . $url_tooltip . '"];' . "\n";
|
2012-02-28 17:08:30 +01:00
|
|
|
}
|
|
|
|
else {
|
2012-10-25 13:02:22 +02:00
|
|
|
if (defined("METACONSOLE")) {
|
|
|
|
$url = '';
|
|
|
|
$url_tooltip = '';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url = 'index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$group['id_grupo'];
|
|
|
|
$url_tooltip = 'ajax.php?page=operation/agentes/ver_agente&get_group_status_tooltip=1&id_group='.$group['id_grupo'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$node = "\n" . $group['id_node'] . ' [ color="'.$status_color.'", fontsize='.$font_size.', shape="invtrapezium",
|
|
|
|
URL="' . $url . '", style="filled", fixedsize=true, width=0.20, height=0.20, label="",
|
|
|
|
tooltip="' . $url_tooltip . '"];' . "\n";
|
2010-07-23 14:14:07 +02:00
|
|
|
}
|
|
|
|
return $node;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns a node definition
|
2015-01-23 08:59:42 +01:00
|
|
|
function networkmap_create_agent_node ($agent, $simple = 0, $font_size = 10, $cut_names = true, $relative = false, $metaconsole = false, $id_server = null, $strict_user = false) {
|
2011-08-22 13:30:43 +02:00
|
|
|
global $config;
|
2013-07-03 10:50:50 +02:00
|
|
|
global $hack_networkmap_mobile;
|
|
|
|
|
2015-01-23 08:59:42 +01:00
|
|
|
if ($strict_user) {
|
2015-03-11 21:06:16 +01:00
|
|
|
require_once($config['homedir']."/include/functions_tags.php");
|
|
|
|
$acltags = tags_get_user_module_and_tags ($config["id_user"], 'AR', $strict_user);
|
|
|
|
|
|
|
|
$agent_filter = array("id" => $agent["id_agente"]);
|
|
|
|
$strict_data['normal_count'] = (int) groups_get_normal_monitors ($agent['id_grupo'], $agent_filter, array(), $strict_user, $acltags);
|
|
|
|
$strict_data['warning_count'] = (int) groups_get_warning_monitors ($agent['id_grupo'], $agent_filter, array(), $strict_user, $acltags);
|
|
|
|
$strict_data['critical_count'] = (int) groups_get_critical_monitors ($agent['id_grupo'], $agent_filter, array(), $strict_user, $acltags);
|
|
|
|
$strict_data['unknown_count'] = (int) groups_get_unknown_monitors ($agent['id_grupo'], $agent_filter, array(), $strict_user, $acltags);
|
|
|
|
$strict_data['notinit_count'] = (int) groups_get_not_init_monitors ($agent['id_grupo'], $agent_filter, array(), $strict_user, $acltags);
|
|
|
|
$strict_data['total_count'] = (int) groups_get_total_monitors ($agent['id_grupo'], $agent_filter, array(), $strict_user, $acltags);
|
2015-01-23 08:59:42 +01:00
|
|
|
$status = agents_get_status_from_counts($strict_data);
|
|
|
|
} else {
|
|
|
|
$status = agents_get_status_from_counts($agent);
|
|
|
|
}
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2013-05-30 17:48:22 +02:00
|
|
|
if (defined('METACONSOLE')) {
|
2014-05-29 11:36:06 +02:00
|
|
|
$server_data = db_get_row('tmetaconsole_setup', 'id',
|
|
|
|
$agent['id_server']);
|
2013-05-30 17:48:22 +02:00
|
|
|
}
|
|
|
|
|
2013-07-16 11:09:50 +02:00
|
|
|
if (empty($server_data)) {
|
2013-05-30 17:48:22 +02:00
|
|
|
$server_name = '';
|
|
|
|
$server_id = '';
|
|
|
|
$url_hash = '';
|
|
|
|
$console_url = '';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$server_name = $server_data['server_name'];
|
|
|
|
$server_id = $server_data['id'];
|
|
|
|
$console_url = $server_data['server_url'] . '/';
|
|
|
|
$url_hash = metaconsole_get_servers_url_hash($server_data);
|
|
|
|
}
|
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Set node status
|
2012-10-09 17:51:33 +02:00
|
|
|
switch ($status) {
|
2013-07-16 11:09:50 +02:00
|
|
|
case AGENT_STATUS_NORMAL:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_NORMAL;
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
2013-07-16 11:09:50 +02:00
|
|
|
case AGENT_STATUS_CRITICAL:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_CRITICAL;
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
2013-07-16 11:09:50 +02:00
|
|
|
case AGENT_STATUS_WARNING:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_WARNING;
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
2013-07-16 11:09:50 +02:00
|
|
|
case AGENT_STATUS_ALERT_FIRED:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_ALERTFIRED;
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
2014-05-05 11:21:43 +02:00
|
|
|
# Juanma (05/05/2014) Fix: Correct color for not init agents!
|
|
|
|
case AGENT_STATUS_NOT_INIT:
|
|
|
|
$status_color = COL_NOTINIT;
|
|
|
|
break;
|
2010-07-23 14:14:07 +02:00
|
|
|
default:
|
2013-07-16 11:09:50 +02:00
|
|
|
//Unknown monitor
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_UNKNOWN;
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
|
|
|
}
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Short name
|
2011-08-23 13:11:28 +02:00
|
|
|
$name = io_safe_output($agent["nombre"]);
|
2011-08-23 12:54:04 +02:00
|
|
|
if ((strlen ($name) > 16) && ($cut_names)) {
|
2013-01-10 15:07:52 +01:00
|
|
|
$name = ui_print_truncate_text($name, 16, false, true, false);
|
2011-07-14 17:47:29 +02:00
|
|
|
}
|
2012-04-17 15:08:08 +02:00
|
|
|
|
2012-10-09 17:51:33 +02:00
|
|
|
if ($simple == 0) {
|
2013-07-03 10:50:50 +02:00
|
|
|
if ($hack_networkmap_mobile) {
|
|
|
|
$img_node = ui_print_os_icon($agent['id_os'], false, true, true, true, true, true);
|
|
|
|
|
|
|
|
$img_node = $config['homedir'] . '/' . $img_node;
|
|
|
|
$img_node = '<img src="' . $img_node . '" />';
|
2012-04-17 15:08:08 +02:00
|
|
|
}
|
|
|
|
else {
|
2013-07-03 10:50:50 +02:00
|
|
|
// Set node icon
|
|
|
|
$img_node = ui_print_os_icon ($agent['id_os'], false, true, true, true, true, $relative);
|
|
|
|
$img_node = str_replace($config['homeurl'] . '/', '', $img_node);
|
|
|
|
$img_node = str_replace($config['homeurl'], '', $img_node);
|
|
|
|
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
$img_node = str_replace('../../', '', $img_node);
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($relative) {
|
|
|
|
$img_node = html_print_image($img_node, true, false, false, true);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$img_node = html_print_image($img_node, true, false, false, false);
|
|
|
|
}
|
2012-04-17 15:08:08 +02:00
|
|
|
}
|
2012-02-28 17:08:30 +01:00
|
|
|
|
2012-10-09 17:51:33 +02:00
|
|
|
if (defined("METACONSOLE")) {
|
2013-05-30 17:48:22 +02:00
|
|
|
if (can_user_access_node ()) {
|
|
|
|
$url = ui_meta_get_url_console_child($id_server,
|
|
|
|
"estado", "operation/agentes/ver_agente&id_agente=" . $agent['id_agente']);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url = '';
|
|
|
|
}
|
2012-10-09 17:51:33 +02:00
|
|
|
$url_tooltip = '../../ajax.php?' .
|
|
|
|
'page=operation/agentes/ver_agente&' .
|
|
|
|
'get_agent_status_tooltip=1&' .
|
|
|
|
'id_agent='.$agent['id_agente'] . '&' .
|
|
|
|
'metaconsole=1&' .
|
|
|
|
'id_server=' . $agent['id_server'];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$agent['id_agente'];
|
|
|
|
$url_tooltip = 'ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent='.$agent['id_agente'];
|
|
|
|
}
|
|
|
|
|
2015-01-23 08:59:42 +01:00
|
|
|
$node = "\n" . $agent['id_node'].' [ color="'.$status_color.'", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.40, height=0.40, label=<<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD>' . $img_node . '</TD></TR>
|
2012-04-23 16:21:54 +02:00
|
|
|
<TR><TD>'.io_safe_output($name).'</TD></TR></TABLE>>,
|
2012-10-09 17:51:33 +02:00
|
|
|
shape="doublecircle", URL="'.$url.'",
|
|
|
|
tooltip="' . $url_tooltip . '"];' . "\n";
|
2011-08-22 13:30:43 +02:00
|
|
|
}
|
|
|
|
else {
|
2013-05-30 17:48:22 +02:00
|
|
|
$ajax_prefix = '';
|
|
|
|
$meta_params = '';
|
|
|
|
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
$ajax_prefix = '../../';
|
|
|
|
$meta_params = '&metaconsole=1&id_server=' . $id_server;
|
|
|
|
}
|
2013-07-16 11:09:50 +02:00
|
|
|
|
2013-05-30 17:48:22 +02:00
|
|
|
if (can_user_access_node ()) {
|
|
|
|
$url_node_link = ', URL="' . $console_url . 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $agent['id_agente'] . $url_hash . '"';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url_node_link = '';
|
|
|
|
}
|
|
|
|
$node = $agent['id_node'] . ' [ color="' . $status_color . '", fontsize=' . $font_size . ', shape="doublecircle"' . $url_node_link . ', style="filled", fixedsize=true, width=0.20, height=0.20, label="", tooltip="' . $ajax_prefix . 'ajax.php?page=operation/agentes/ver_agente&get_agent_status_tooltip=1&id_agent=' . $agent['id_agente'] . $meta_params . '"];' . "\n";
|
2010-07-23 14:14:07 +02:00
|
|
|
}
|
2012-02-28 17:08:30 +01:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
return $node;
|
|
|
|
}
|
|
|
|
|
2012-11-13 17:06:21 +01:00
|
|
|
function networkmap_create_module_group_node ($module_group, $simple = 0, $font_size = 10, $metaconsole = false, $id_server = null) {
|
2013-07-03 10:50:50 +02:00
|
|
|
global $config;
|
|
|
|
global $hack_networkmap_mobile;
|
|
|
|
|
2012-11-13 17:06:21 +01:00
|
|
|
|
|
|
|
// Set node status
|
|
|
|
switch ($module_group['status']) {
|
2013-07-03 10:50:50 +02:00
|
|
|
case 0:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_NORMAL; // Normal monitor
|
2012-11-13 17:06:21 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_CRITICAL; // Critical monitor
|
2012-11-13 17:06:21 +01:00
|
|
|
break;
|
|
|
|
case 2:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_WARNING; // Warning monitor
|
2012-11-13 17:06:21 +01:00
|
|
|
break;
|
|
|
|
case 4:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_ALERTFIRED; // Alert fired
|
2012-11-13 17:06:21 +01:00
|
|
|
break;
|
|
|
|
default:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_UNKNOWN; // Unknown monitor
|
2012-11-13 17:06:21 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($simple == 0) {
|
|
|
|
if (defined("METACONSOLE")) {
|
|
|
|
$url = '';
|
|
|
|
$url_tooltip = '';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url = '';
|
|
|
|
$url_tooltip = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
$node = $module_group['id_node'].' [ color="' . $status_color .
|
|
|
|
'", fontsize='.$font_size.', style="filled", ' .
|
|
|
|
'fixedsize=true, width=0.30, height=0.30, ' .
|
2016-04-13 18:00:24 +02:00
|
|
|
'label=<<TABLE data-status="' . $module_group['status'] . '" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD>' .
|
2012-11-13 17:06:21 +01:00
|
|
|
io_safe_output($module_group['name']) . '</TD></TR></TABLE>>,
|
|
|
|
shape="square", URL="' . $url . '",
|
|
|
|
tooltip="' . $url_tooltip . '"];';
|
|
|
|
}
|
|
|
|
else {
|
2013-07-03 10:50:50 +02:00
|
|
|
if ($hack_networkmap_mobile) {
|
|
|
|
$img_node = ui_print_moduletype_icon($module['id_tipo_modulo'], true, true, false, true);
|
|
|
|
|
|
|
|
$img_node = $config['homedir'] . '/' . $img_node;
|
|
|
|
$img_node = '<img src="' . $img_node . '" />';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$img_node = ui_print_moduletype_icon ($module['id_tipo_modulo'], true, true, false);
|
|
|
|
}
|
2012-11-13 17:06:21 +01:00
|
|
|
if (defined("METACONSOLE")) {
|
|
|
|
$url = '';
|
|
|
|
$url_tooltip = '';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url = '';
|
|
|
|
$url_tooltip = '';
|
|
|
|
}
|
|
|
|
|
|
|
|
$node = $module_group['id_node'] . ' [ color="'.$status_color .
|
|
|
|
'", fontsize='.$font_size.', shape="square", URL="' . $url . '", ' .
|
|
|
|
'style="filled", fixedsize=true, width=0.20, ' .
|
|
|
|
'height=0.20, label="", tooltip="' . $url_tooltip . '"];';
|
|
|
|
}
|
|
|
|
return $node;
|
|
|
|
}
|
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Returns a module node definition
|
2012-10-25 10:53:44 +02:00
|
|
|
function networkmap_create_module_node ($module, $simple = 0, $font_size = 10, $metaconsole = false, $id_server = null) {
|
2013-07-03 10:50:50 +02:00
|
|
|
global $config;
|
|
|
|
global $hack_networkmap_mobile;
|
2012-10-25 10:53:44 +02:00
|
|
|
|
2013-07-03 10:50:50 +02:00
|
|
|
if (isset($module['status'])) {
|
2012-11-28 19:29:24 +01:00
|
|
|
$status = $module['status'];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$status = modules_get_agentmodule_status($module['id_agente_modulo'],
|
|
|
|
false, $metaconsole, $id_server);
|
|
|
|
}
|
2012-07-13 Miguel de Dios <miguel.dedios@artica.es>
* godmode/snmpconsole/snmp_alert.php,
godmode/servers/manage_recontask_form.php,
include/functions_filemanager.php, include/functions_networkmap.php,
include/constants.php, include/graphs/functions_gd.php,
include/graphs/functions_pchart.php,
operation/events/events_list.php, operation/agentes/graphs.php,
operation/agentes/networkmap.php, operation/agentes/stat_win.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
operation/gis_maps/render_view.php: cleaned source code style and
change magic numbers for time constants.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6769 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-13 12:59:40 +02:00
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
// Set node status
|
2012-11-13 17:06:21 +01:00
|
|
|
switch ($status) {
|
2014-04-16 15:43:28 +02:00
|
|
|
case AGENT_MODULE_STATUS_NORMAL:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_NORMAL; // Normal monitor
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
2014-04-16 15:43:28 +02:00
|
|
|
case AGENT_MODULE_STATUS_CRITICAL_BAD:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_CRITICAL; // Critical monitor
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
2014-04-16 15:43:28 +02:00
|
|
|
case AGENT_MODULE_STATUS_WARNING:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_WARNING; // Warning monitor
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
2014-04-16 15:43:28 +02:00
|
|
|
case AGENT_STATUS_ALERT_FIRED:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_ALERTFIRED; // Alert fired
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
|
|
|
default:
|
2014-04-16 16:42:28 +02:00
|
|
|
$status_color = COL_UNKNOWN; // Unknown monitor
|
2010-07-23 14:14:07 +02:00
|
|
|
break;
|
|
|
|
}
|
2012-07-13 Miguel de Dios <miguel.dedios@artica.es>
* godmode/snmpconsole/snmp_alert.php,
godmode/servers/manage_recontask_form.php,
include/functions_filemanager.php, include/functions_networkmap.php,
include/constants.php, include/graphs/functions_gd.php,
include/graphs/functions_pchart.php,
operation/events/events_list.php, operation/agentes/graphs.php,
operation/agentes/networkmap.php, operation/agentes/stat_win.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
operation/gis_maps/render_view.php: cleaned source code style and
change magic numbers for time constants.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6769 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-13 12:59:40 +02:00
|
|
|
|
2013-07-03 10:50:50 +02:00
|
|
|
if ($hack_networkmap_mobile) {
|
|
|
|
$img_node = ui_print_moduletype_icon($module['id_tipo_modulo'], true, true, false, true);
|
|
|
|
|
|
|
|
$img_node = $config['homedir'] . '/' . $img_node;
|
|
|
|
$img_node = '<img src="' . $img_node . '" />';
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$img_node = ui_print_moduletype_icon ($module['id_tipo_modulo'], true, true, false);
|
|
|
|
}
|
|
|
|
|
2010-07-23 14:14:07 +02:00
|
|
|
|
2012-10-25 10:53:44 +02:00
|
|
|
if ($simple == 0) {
|
|
|
|
if (defined("METACONSOLE")) {
|
2012-10-25 13:02:22 +02:00
|
|
|
$url = '';
|
2012-10-25 10:53:44 +02:00
|
|
|
$url_tooltip = '../../ajax.php?' .
|
|
|
|
'page=operation/agentes/ver_agente&' .
|
|
|
|
'get_agentmodule_status_tooltip=1&' .
|
|
|
|
'id_module='.$module['id_agente_modulo'] .
|
|
|
|
'&metaconsole=1' .
|
|
|
|
'&id_server=' . $module['id_server'];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$module['id_agente'];
|
|
|
|
$url_tooltip = 'ajax.php?page=operation/agentes/ver_agente&get_agentmodule_status_tooltip=1&id_module='.$module['id_agente_modulo'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$node = $module['id_node'].' [ color="' . $status_color .
|
|
|
|
'", fontsize='.$font_size.', style="filled", ' .
|
|
|
|
'fixedsize=true, width=0.30, height=0.30, ' .
|
|
|
|
'label=<<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR><TD>' .
|
2013-07-03 10:50:50 +02:00
|
|
|
$img_node . '</TD></TR>
|
2012-10-25 10:53:44 +02:00
|
|
|
<TR><TD>' . io_safe_output($module['nombre']) . '</TD></TR></TABLE>>,
|
|
|
|
shape="circle", URL="' . $url . '",
|
|
|
|
tooltip="' . $url_tooltip . '"];';
|
2011-08-22 13:30:43 +02:00
|
|
|
}
|
|
|
|
else {
|
2012-10-25 10:53:44 +02:00
|
|
|
if (defined("METACONSOLE")) {
|
|
|
|
$url = 'TODO';
|
|
|
|
$url_tooltip = '../../ajax.php?page=operation/agentes/ver_agente' .
|
|
|
|
'&get_agentmodule_status_tooltip=1' .
|
|
|
|
'&id_module=' . $module['id_agente_modulo'] .
|
|
|
|
'&metaconsole=1' .
|
|
|
|
'&id_server=' . $module['id_server'];
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url = 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$module['id_agente'];
|
|
|
|
$url_tooltip = 'ajax.php?page=operation/agentes/ver_agente&get_agentmodule_status_tooltip=1&id_module='.$module['id_agente_modulo'];
|
|
|
|
}
|
|
|
|
|
2014-04-16 15:43:28 +02:00
|
|
|
$node = $module['id_node'] . ' [ ' .
|
|
|
|
'color="' . $status_color .'", ' .
|
|
|
|
'fontsize='.$font_size.', ' .
|
|
|
|
'shape="circle", ' .
|
|
|
|
'URL="' . $url . '", ' .
|
|
|
|
'style="filled", ' .
|
|
|
|
'fixedsize=true, ' .
|
|
|
|
'width=0.20, ' .
|
|
|
|
'height=0.20, ' .
|
|
|
|
'label="", ' .
|
2014-06-02 19:36:00 +02:00
|
|
|
'tooltip="' . $url_tooltip . '"' .
|
2014-04-16 15:43:28 +02:00
|
|
|
'];';
|
2010-07-23 14:14:07 +02:00
|
|
|
}
|
|
|
|
return $node;
|
|
|
|
}
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
// Returns the definition of the central module
|
2012-04-23 16:21:54 +02:00
|
|
|
function networkmap_create_pandora_node ($name, $font_size = 10, $simple = 0, $stats = array()) {
|
2013-07-03 10:50:50 +02:00
|
|
|
global $hack_networkmap_mobile;
|
|
|
|
global $config;
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2015-09-11 10:57:36 +02:00
|
|
|
//$stats_json = base64_encode(json_encode($stats));
|
|
|
|
$summary = array();
|
|
|
|
if (isset($stats['policies'])) {
|
|
|
|
$summary['policies'] = count($stats['policies']);
|
|
|
|
}
|
|
|
|
if (isset($stats['groups'])) {
|
|
|
|
// TODO: GET STATUS OF THE GROUPS AND ADD IT TO SUMMARY
|
|
|
|
$summary['groups'] = count($stats['groups']);
|
|
|
|
}
|
|
|
|
if (isset($stats['agents'])) {
|
|
|
|
// TODO: GET STATUS OF THE AGENTS AND ADD IT TO SUMMARY
|
|
|
|
$summary['agents'] = count($stats['agents']);
|
|
|
|
}
|
|
|
|
if (isset($stats['modules'])) {
|
|
|
|
// TODO: GET STATUS OF THE MODULES AND ADD IT TO SUMMARY
|
|
|
|
$summary['modules'] = count($stats['modules']) ;
|
|
|
|
}
|
|
|
|
$stats_json = base64_encode(json_encode($summary));
|
2012-10-09 17:51:33 +02:00
|
|
|
|
|
|
|
$img_src = "images/networkmap/pandora_node.png";
|
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
|
|
|
|
$url_tooltip = '../../ajax.php?' .
|
|
|
|
'page=include/ajax/networkmap.ajax&' .
|
|
|
|
'action=get_networkmap_summary&' .
|
|
|
|
'stats='.$stats_json . '&' .
|
|
|
|
'metaconsole=1';
|
2013-06-12 16:43:08 +02:00
|
|
|
$url = '';
|
2015-09-11 10:57:36 +02:00
|
|
|
$color = '#052938';
|
2012-10-09 17:51:33 +02:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$url_tooltip = 'ajax.php?page=include/ajax/networkmap.ajax&action=get_networkmap_summary&stats='.$stats_json.'", URL="index.php?sec=estado&sec2=operation/agentes/group_view';
|
|
|
|
$url = 'index.php?sec=estado&sec2=operation/agentes/group_view';
|
2015-09-11 10:57:36 +02:00
|
|
|
$color = '#373737';
|
2012-10-09 17:51:33 +02:00
|
|
|
}
|
|
|
|
|
2013-07-03 10:50:50 +02:00
|
|
|
if ($hack_networkmap_mobile) {
|
|
|
|
$img = '<TR><TD>' .
|
|
|
|
"<img src='" . $config['homedir'] . '/' . "images/networkmap/pandora_node.png' />" .
|
|
|
|
'</TD></TR>';
|
|
|
|
}
|
|
|
|
else {
|
2015-09-11 10:57:36 +02:00
|
|
|
$image = html_print_image("images/networkmap/pandora_node.png", true, false, false, true);
|
|
|
|
$image = str_replace('"',"'",$image);
|
|
|
|
$img = '<TR><TD>' . $image . '</TD></TR>';
|
2013-07-03 10:50:50 +02:00
|
|
|
}
|
2015-09-11 10:57:36 +02:00
|
|
|
$name = "<TR><TD BGCOLOR='#FFFFFF'>" . $name . '</TD></TR>';
|
|
|
|
$label = "<TABLE BORDER='0'>" . $img.$name . '</TABLE>';
|
2012-10-09 17:51:33 +02:00
|
|
|
if ($simple == 1) {
|
2009-07-16 18:15:10 +02:00
|
|
|
$label = '';
|
|
|
|
}
|
2012-05-03 11:35:30 +02:00
|
|
|
|
2013-06-12 16:43:08 +02:00
|
|
|
$node = '0 [ color="' . $color . '", fontsize='.$font_size.', style="filled", fixedsize=true, width=0.8, height=0.6, label=<'.$label.'>,
|
2012-10-09 17:51:33 +02:00
|
|
|
shape="ellipse", tooltip="' . $url_tooltip . '", URL="' . $url . '" ];';
|
2012-07-13 Miguel de Dios <miguel.dedios@artica.es>
* godmode/snmpconsole/snmp_alert.php,
godmode/servers/manage_recontask_form.php,
include/functions_filemanager.php, include/functions_networkmap.php,
include/constants.php, include/graphs/functions_gd.php,
include/graphs/functions_pchart.php,
operation/events/events_list.php, operation/agentes/graphs.php,
operation/agentes/networkmap.php, operation/agentes/stat_win.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
operation/gis_maps/render_view.php: cleaned source code style and
change magic numbers for time constants.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6769 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-07-13 12:59:40 +02:00
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
return $node;
|
|
|
|
}
|
|
|
|
|
2014-06-25 12:49:11 +02:00
|
|
|
function networkmap_create_transparent_node($count = 0) {
|
|
|
|
|
|
|
|
$node = 'transp_' .$count . ' [ color="#00000000", style="filled", fixedsize=true, width=0.8, height=0.6, label=<>,
|
|
|
|
shape="ellipse"];';
|
|
|
|
|
|
|
|
return $node;
|
|
|
|
}
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
// Opens a group definition
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
function networkmap_open_group ($id) {
|
2011-04-27 15:43:31 +02:00
|
|
|
$img = 'images/'.groups_get_icon ($id).'.png';
|
|
|
|
$name = groups_get_name ($id);
|
2009-07-16 18:15:10 +02:00
|
|
|
|
|
|
|
$group = 'subgraph cluster_' . $id .
|
2015-09-11 10:57:36 +02:00
|
|
|
' { style=filled; color=darkolivegreen3; label=<<TABLE BORDER=\'0\'>
|
2011-04-27 15:43:31 +02:00
|
|
|
<TR><TD>' . html_print_image($img, true) . '</TD><TD>'.$name.'</TD></TR>
|
2009-07-16 18:15:10 +02:00
|
|
|
</TABLE>>; tooltip="'.$name.'";
|
|
|
|
URL="index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id='
|
|
|
|
. $id . '";';
|
|
|
|
|
|
|
|
return $group;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Closes a group definition
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
function networkmap_close_group () {
|
2009-07-16 18:15:10 +02:00
|
|
|
return '}';
|
|
|
|
}
|
|
|
|
|
|
|
|
// Opens a graph definition
|
2015-08-10 19:44:28 +02:00
|
|
|
function networkmap_open_graph ($layout, $nooverlap, $pure, $zoom,
|
|
|
|
$ranksep, $font_size, $size_canvas) {
|
|
|
|
|
2014-06-24 15:17:14 +02:00
|
|
|
global $config;
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
$overlap = 'compress';
|
2014-06-24 15:17:14 +02:00
|
|
|
|
|
|
|
if (isset($config['networkmap_max_width'])) {
|
|
|
|
$size_x = $config['networkmap_max_width'] / 100;
|
|
|
|
$size_y = $size_x * 0.8;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$size_x = 8;
|
|
|
|
$size_y = 5.4;
|
|
|
|
$size = '';
|
|
|
|
}
|
2010-07-30 11:03:23 +02:00
|
|
|
|
2012-07-10 13:03:00 +02:00
|
|
|
|
2010-07-30 11:03:23 +02:00
|
|
|
if ($layout == 'radial') {
|
2009-07-16 18:15:10 +02:00
|
|
|
$overlap = 'true';
|
2010-07-30 11:03:23 +02:00
|
|
|
}
|
2009-07-16 18:15:10 +02:00
|
|
|
|
2010-07-30 11:03:23 +02:00
|
|
|
if ($layout == 'flat' || $layout == 'radial' || $layout == 'spring1' || $layout == "spring2") {
|
|
|
|
if ($nooverlap != '') {
|
2009-07-16 18:15:10 +02:00
|
|
|
$overlap = 'scalexy';
|
2010-07-30 11:03:23 +02:00
|
|
|
}
|
|
|
|
}
|
2012-07-10 13:03:00 +02:00
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
if ($zoom > 0) {
|
|
|
|
$size_x *= $zoom;
|
|
|
|
$size_y *= $zoom;
|
|
|
|
}
|
|
|
|
$size = $size_x . ',' . $size_y;
|
|
|
|
|
2015-08-10 19:44:28 +02:00
|
|
|
if (!is_null($size_canvas)) {
|
|
|
|
$size = ($size_canvas['x'] / 100) . "," . ($size_canvas['y'] / 100);
|
|
|
|
}
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
// BEWARE: graphwiz DONT use single ('), you need double (")
|
2015-08-10 19:44:28 +02:00
|
|
|
$head = "graph networkmap { dpi=100; bgcolor=\"transparent\"; labeljust=l; margin=0; pad=\"0.75,0.75\";";
|
2009-07-16 18:15:10 +02:00
|
|
|
if ($nooverlap != '') {
|
|
|
|
$head .= "overlap=\"$overlap\";";
|
|
|
|
$head .= "ranksep=\"$ranksep\";";
|
|
|
|
$head .= "outputorder=edgesfirst;";
|
2015-03-31 14:11:17 +02:00
|
|
|
}
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
$head .= "ratio=fill;";
|
|
|
|
$head .= "root=0;";
|
|
|
|
$head .= "size=\"$size\";";
|
2012-07-10 13:03:00 +02:00
|
|
|
|
2015-08-10 19:44:28 +02:00
|
|
|
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
return $head;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Closes a graph definition
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
function networkmap_close_graph () {
|
2009-07-16 18:15:10 +02:00
|
|
|
return '}';
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns the filter used to achieve the desired layout
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
function networkmap_get_filter ($layout) {
|
2012-07-10 13:03:00 +02:00
|
|
|
switch ($layout) {
|
|
|
|
case 'flat':
|
|
|
|
return 'dot';
|
|
|
|
break;
|
|
|
|
case 'radial':
|
|
|
|
return 'twopi';
|
|
|
|
break;
|
|
|
|
case 'circular':
|
|
|
|
return 'circo';
|
|
|
|
break;
|
|
|
|
case 'spring1':
|
|
|
|
return 'neato';
|
|
|
|
break;
|
|
|
|
case 'spring2':
|
|
|
|
return 'fdp';
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return 'twopi';
|
|
|
|
break;
|
2009-07-16 18:15:10 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-07-30 11:03:23 +02:00
|
|
|
/**
|
|
|
|
* Creates a networkmap.
|
|
|
|
*
|
|
|
|
* @param string Network map name.
|
|
|
|
* @param string Network map type (topology, groups or policies).
|
|
|
|
* @param layout Network map layout (circular, flat, radial, spring1 or spring2).
|
|
|
|
* @param bool overlapping activate flag.
|
|
|
|
* @param bool simple view activate flag.
|
|
|
|
* @param bool regenerate file activate flag.
|
|
|
|
* @param int font size.
|
|
|
|
* @param int group id filter (0 for all).
|
|
|
|
* @param int module group id filter (0 for all).
|
|
|
|
* @param int policy id filter (0 for all).
|
|
|
|
* @param string depth level.
|
|
|
|
* @param bool only modules with alerts flag.
|
|
|
|
* @param bool hide policy modules flag
|
|
|
|
* @param float zoom factor
|
|
|
|
*
|
|
|
|
* @return mixed New networkmap id if created. False if it could not be created.
|
|
|
|
*/
|
2015-03-31 12:23:40 +02:00
|
|
|
function networkmap_create_networkmap ($values) {
|
2010-07-30 11:03:23 +02:00
|
|
|
global $config;
|
|
|
|
|
2015-03-31 12:23:40 +02:00
|
|
|
// The name is required
|
|
|
|
if (! isset($values['name']))
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// Set defaults for the empty values
|
|
|
|
set_unless_defined ($values['type'], 'topology');
|
|
|
|
set_unless_defined ($values['layout'], 'radial');
|
|
|
|
set_unless_defined ($values['nooverlap'], true);
|
|
|
|
set_unless_defined ($values['simple'], false);
|
|
|
|
set_unless_defined ($values['regenerate'], true);
|
|
|
|
set_unless_defined ($values['font_size'], 12);
|
|
|
|
set_unless_defined ($values['store_group'], 0);
|
|
|
|
set_unless_defined ($values['id_group'], 0);
|
|
|
|
set_unless_defined ($values['regenerate'], true);
|
|
|
|
set_unless_defined ($values['id_module_group'], 0);
|
|
|
|
set_unless_defined ($values['depth'], 'all');
|
|
|
|
set_unless_defined ($values['only_modules_with_alerts'], false);
|
|
|
|
set_unless_defined ($values['hide_policy_modules'], false);
|
|
|
|
set_unless_defined ($values['zoom'], 1);
|
|
|
|
set_unless_defined ($values['distance_nodes'], 2.5);
|
|
|
|
set_unless_defined ($values['center'], 0);
|
|
|
|
set_unless_defined ($values['id_user'], $config['id_user']);
|
|
|
|
set_unless_defined ($values['text_filter'], '');
|
|
|
|
set_unless_defined ($values['regenerate'], true);
|
|
|
|
set_unless_defined ($values['dont_show_subgroups'], 0);
|
|
|
|
set_unless_defined ($values['show_groups'], false);
|
|
|
|
set_unless_defined ($values['pandoras_children'], false);
|
|
|
|
set_unless_defined ($values['show_modules'], false);
|
|
|
|
set_unless_defined ($values['show_snmp_modules'], 0);
|
|
|
|
set_unless_defined ($values['l2_network'], 0);
|
|
|
|
set_unless_defined ($values['server_name'], '');
|
2014-07-31 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_networkmap.php, include/functions_graph.php,
include/db/postgresql.php, include/db/oracle.php,
include/functions_api.php, extensions/agents_alerts.php,
operation/search_main.php, operation/search_agents.getdata.php,
operation/agentes/status_monitor.php,
operation/agentes/networkmap.topology.php,
operation/agentes/ver_agente.php,
operation/search_modules.getdata.php, operation/search_results.php,
operation/events/events_list.php,
godmode/alerts/alert_list.builder.php,
godmode/alerts/configure_alert_template.php,
godmode/modules/manage_network_components_form.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php: tiny fixes for the improve the
support of postgreSQL databases.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10368 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-07-31 16:27:43 +02:00
|
|
|
|
|
|
|
return @db_process_sql_insert('tnetwork_map', $values);
|
2010-07-30 11:03:23 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a network map report.
|
|
|
|
*
|
|
|
|
* @param int Networkmap id to get.
|
|
|
|
* @param array Extra filter.
|
|
|
|
* @param array Fields to get.
|
2011-07-28 18:26:26 +02:00
|
|
|
* @param bool Get only the map if is of the user ($config['id_user'])
|
2010-07-30 11:03:23 +02:00
|
|
|
*
|
|
|
|
* @return Networkmap with the given id. False if not available or readable.
|
|
|
|
*/
|
2011-07-28 18:26:26 +02:00
|
|
|
function networkmap_get_networkmap ($id_networkmap, $filter = false, $fields = false, $check_user = true) {
|
2010-07-30 11:03:23 +02:00
|
|
|
global $config;
|
|
|
|
|
|
|
|
$id_networkmap = safe_int ($id_networkmap);
|
|
|
|
if (empty ($id_networkmap))
|
|
|
|
return false;
|
|
|
|
if (! is_array ($filter))
|
|
|
|
$filter = array ();
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
|
2010-07-30 11:03:23 +02:00
|
|
|
$filter['id_networkmap'] = $id_networkmap;
|
2011-07-28 18:26:26 +02:00
|
|
|
|
2013-05-16 12:16:16 +02:00
|
|
|
if ($check_user) {
|
2012-07-24 12:09:25 +02:00
|
|
|
//If hte user has admin flag don't filter by user
|
|
|
|
$user_info = users_get_user_by_id($config['id_user']);
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
|
2012-07-24 12:09:25 +02:00
|
|
|
if (!$user_info['is_admin']) {
|
2013-06-10 18:15:36 +02:00
|
|
|
//$filter['id_user'] = $config['id_user'];
|
2012-07-24 12:09:25 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
* include/functions_graph.php
include/functions_html.php
include/functions_messages.php
include/db/postgresql.php
include/db/mysql.php
include/db/oracle.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_gis.php
include/auth/ldap.php
include/auth/mysql.php
include/functions_networkmap.php
include/functions_network_components.php
include/ajax/skins.ajax.php
include/ajax/reporting.ajax.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/help/en/help_timesource.php
include/help/es/help_timesource.php
include/help/ja/help_timesource.php
include/config_process.php
include/functions_ui.php
include/functions_custom_graphs.php
include/fgraph.php
include/functions_incidents.php
include/api.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/system_info.php
extensions/extension_uploader.php
extensions/pandora_logs.php
extensions/agents_modules.php
extensions/update_manager.php
extensions/ssh_console.php
extensions/dbmanager.php
extensions/vnc_view.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/users_connected.php
extensions/module_groups.php
extensions/update_manager/load_updatemanager.php
extensions/update_manager/lib/libupdate_manager_client.php
extensions/update_manager/lib/libupdate_manager.php
extensions/update_manager/lib/libupdate_manager_components.php
extensions/update_manager/lib/libupdate_manager_updates.php
extensions/update_manager/settings.php
extensions/update_manager/main.php
extensions/plugin_registration.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident_statistics.php
operation/search_modules.php
operation/visual_console/render_view.php
operation/visual_console/index.php
operation/extensions.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/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/exportdata.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/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/search_graphs.php
operation/snmpconsole/snmp_view.php
operation/users/user_edit.php
operation/gis_maps/render_view.php
operation/gis_maps/ajax.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident_statistics.php
operation/events/event_statistics.php
operation/events/events_rss.php
operation/events/export_csv.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/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/graph_viewer.php
operation/search_reports.php
operation/search_maps.php
operation/search_users.php
extras/pandora_diag.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
mobile/index.php
general/error_authconfig.php
general/links_menu.php
general/logon_ok.php
general/error_dbconfig.php
general/ui/agents_list.php
general/header.php
godmode/groups/modu_group_list.php
godmode/groups/configure_group.php
godmode/groups/configure_modu_group.php
godmode/groups/group_list.php
godmode/admin_access_logs.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/extensions.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/fields_manager.php
godmode/agentes/agent_conf_gis.php
godmode/agentes/module_manager_editor_prediction.php
godmode/agentes/module_manager.php
godmode/agentes/modificar_agente.php
godmode/agentes/configurar_agente.php
godmode/agentes/configure_field.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/recon_script.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/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/snmpconsole/snmp_alert.php
godmode/snmpconsole/snmp_filters.php
godmode/users/user_list.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/visual_console_builder.wizard.php
godmode/reporting/graph_builder.main.php
godmode/reporting/reporting_builder.list_items.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/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/map_builder.php
godmode/reporting/graphs.php
godmode/reporting/graph_builder.preview.php
include/functions_db.php: Added some includes and functions of this code have "db_" prefix.
* include/functions.php: Moved function check_login(), check_acl(),
dame_nombre_pluginid(), get_os_name() from functions_db.php to functions.php.
* include/functions_groups.php: Moved functions get_childrens(), safe_acl_group()
and get_parents(), give_disabled_group(), isAllGroups(), get_group_icon(), get_all_groups(),
get_id_groups_recursive(), get_user_groups_tree_recursive(), get_group_status(),
get_group_name(), get_group_users() from functions_db.php to this code.
* include/functions_profile.php: New library with profile functions. Moved functions
get_profile_name(), get_profiles(), create_user_profile(), delete_user_profile(),
delete_profile() from functions_db.php to this code. Added new parameter in function
get_profile() to retrieve profiles with filter conditions applied.
* include/functions_users.php: New library with users functions. Moved functions
get_users_info(), get_all_model_groups(), get_user_groups(), get_user_groups_tree(),
get_user_first_group(), user_access_to_agent() from funtions_db.php to this code.
* godmode/users/configure_user.php: Changed get_profile_filter() function to get_profile().
* include/functions_agents.php: Moved functions get_group_agents(), get_agent_modules(),
get_agent_module_id(), get_agent_id(), get_agent_name(), get_agent_modules_data_count(),
check_alert_fired(), get_agent_interval(), get_agent_os(), give_agentmodule_flag(),
agent_add_address(), agent_delete_address(), get_agent_address(), get_agent_with_ip(),
get_agent_addresses(), get_agent_status(), delete_agent(), get_agentmodule_group(),
get_agent_group() from functions_db.php to this code.
* include/functions_modules.php: Moved functions get_agentmodule(), get_agentmodule_id(),
get_agentmodule_is_init(), get_agent_modules_count(), get_module_type_name(),
get_module_type_icon(), get_agentmodule_agent(), get_agentmodule_agent_name(),
get_agentmodule_name(), get_agentmodule_type(), get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(), get_monitors_in_group(),
get_monitors_in_agent(), get_monitors_down(), get_moduletype_name(),
get_moduletype_description(), get_moduletypes(), get_module_interval(), show_icon_type(),
give_modulecategory_name(),
give_agent_id_from_module_id(), get_module_status(), get_agent_module_last_value(),
get_previous_data(), get_agentmodule_modulegroup(), get_modulegroups(),
get_modulegroup_name() from functions_db.php to this code.
* include/functions_alerts.php: Moved functions get_alert_type(), get_agent_alert_fired(),
get_module_alert_fired(), get_alert_fires_in_period(), get_group_alerts(), get_alerts_fired(),
get_alert_last_fire_timestamp_in_period(), get_agentmodule_status(),
get_agentmodule_last_status() from functions_db.php to this code.
* include/functions_exportserver.php: Moved function dame_nombre_servidorexportacion()
from functions_db.php to this code.
* include/functions_events.php: Moved functions get_group_events(), get_agent_events(),
get_module_events() from functions_db.php to this code.
* include/functions_servers.php: Moved functions get_server_name(), show_server_type(),
check_server_status(), server_status() from functions_db.php to this code.
* include/functions_network_profiles.php: Moved function get_networkprofile_name()
from functions_db.php to this code.
* include/functions_visual_map.php: Moved functions get_layoutdata_x(), get_layoutdata_y()
from fucntions_db.php to this code.
* include/functions_io.php: Moved function __() from functions_db.php to this code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4258 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-19 20:42:49 +02:00
|
|
|
$networkmap = db_get_row_filter ('tnetwork_map', $filter, $fields);
|
2012-09-24 Miguel de Dios <miguel.dedios@artica.es>
* pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql: added the fields
"text_filter" and "dont_show_subgroups" for to new filters to
generate the networkmap.
* operation/agentes/networkmap.topology.php,
operation/agentes/networkmap.groups.php,
include/functions_networkmap.php, include/functions_servers.php:
added the new filters for free text for agents and hidden the
subgroups of any group in the group networkmap.
* extensions/resource_registration.php,
operation/agentes/networkmap.php, general/header.php,
godmode/netflow/nf_report_form.php,
godmode/agentes/module_manager.php, include/functions_groups.php,
include/auth/ldap.php, operation/agentes/estado_ultimopaquete.php,
include/functions.php, include/functions_db.php: cleaned source code
style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6995 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2012-09-24 13:59:05 +02:00
|
|
|
|
2010-07-30 11:03:23 +02:00
|
|
|
return $networkmap;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a user networkmaps.
|
|
|
|
*
|
|
|
|
* @param int Networkmap id to get.
|
|
|
|
* @param array Extra filter.
|
|
|
|
* @param array Fields to get.
|
|
|
|
*
|
|
|
|
* @return Networkmap with the given id. False if not available or readable.
|
|
|
|
*/
|
2015-01-23 08:59:42 +01:00
|
|
|
function networkmap_get_networkmaps ($id_user = '', $type = '', $optgrouped = true, $strict_user = false) {
|
2010-07-30 11:03:23 +02:00
|
|
|
global $config;
|
|
|
|
|
2013-05-16 12:16:16 +02:00
|
|
|
if ($id_user == '') {
|
2010-07-30 11:03:23 +02:00
|
|
|
$id_user = $config['id_user'];
|
|
|
|
}
|
2015-06-08 13:13:09 +02:00
|
|
|
|
2013-10-07 12:52:24 +02:00
|
|
|
// Configure filters
|
2015-06-08 13:13:09 +02:00
|
|
|
$where = array ();
|
2013-10-07 12:52:24 +02:00
|
|
|
$where['id_group'] = array_keys (users_get_groups($id_user));
|
2015-06-08 13:13:09 +02:00
|
|
|
if ($type != '') {
|
2013-10-07 12:52:24 +02:00
|
|
|
$where['type'] = $type;
|
2011-04-11 19:05:20 +02:00
|
|
|
}
|
2015-06-08 13:13:09 +02:00
|
|
|
|
2013-10-07 12:52:24 +02:00
|
|
|
$where['order'][0]['field'] = 'type';
|
|
|
|
$where['order'][0]['order'] = 'DESC';
|
|
|
|
$where['order'][1]['field'] = 'name';
|
|
|
|
$where['order'][1]['order'] = 'ASC';
|
2015-06-08 13:13:09 +02:00
|
|
|
|
2013-10-07 12:52:24 +02:00
|
|
|
$networkmaps_raw = db_get_all_rows_filter('tnetwork_map', $where);
|
2013-07-03 10:50:50 +02:00
|
|
|
if ($networkmaps_raw === false) {
|
2010-07-30 11:03:23 +02:00
|
|
|
return false;
|
|
|
|
}
|
2015-06-08 13:13:09 +02:00
|
|
|
|
2010-07-30 11:03:23 +02:00
|
|
|
$networkmaps = array();
|
2013-05-16 12:16:16 +02:00
|
|
|
foreach ($networkmaps_raw as $key => $networkmapitem) {
|
|
|
|
if ($optgrouped) {
|
2015-01-23 08:59:42 +01:00
|
|
|
if ((($networkmapitem['type'] == 'policies') || ($networkmapitem['type'] == 'radial_dynamic')) && ($strict_user)) {
|
|
|
|
continue;
|
|
|
|
}
|
2012-03-22 13:14:15 +01:00
|
|
|
$networkmaps[$networkmapitem['id_networkmap']] =
|
|
|
|
array('name' => $networkmapitem['name'],
|
|
|
|
'optgroup' => $networkmapitem['type']);
|
2010-07-30 11:03:23 +02:00
|
|
|
}
|
|
|
|
else {
|
2015-01-23 08:59:42 +01:00
|
|
|
if ((($networkmapitem['type'] == 'policies') || ($networkmapitem['type'] == 'radial_dynamic')) && ($strict_user)) {
|
|
|
|
continue;
|
|
|
|
}
|
2013-07-25 18:52:45 +02:00
|
|
|
$networkmaps[$networkmapitem['id_networkmap']] =
|
|
|
|
$networkmapitem['name'];
|
2010-07-30 11:03:23 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $networkmaps;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deletes a network map.
|
|
|
|
*
|
|
|
|
* @param int Map id to be deleted.
|
|
|
|
*
|
|
|
|
* @return bool True if the map was deleted, false otherwise.
|
|
|
|
*/
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
function networkmap_delete_networkmap ($id_networkmap) {
|
2010-07-30 11:03:23 +02:00
|
|
|
$id_networkmap = safe_int ($id_networkmap);
|
|
|
|
if (empty ($id_networkmap))
|
|
|
|
return false;
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
$networkmap = networkmap_get_networkmap ($id_networkmap);
|
2010-07-30 11:03:23 +02:00
|
|
|
if ($networkmap === false)
|
|
|
|
return false;
|
* include/functions_graph.php
include/functions_html.php
include/functions_messages.php
include/db/postgresql.php
include/db/mysql.php
include/db/oracle.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_gis.php
include/auth/ldap.php
include/auth/mysql.php
include/functions_networkmap.php
include/functions_network_components.php
include/ajax/skins.ajax.php
include/ajax/reporting.ajax.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/help/en/help_timesource.php
include/help/es/help_timesource.php
include/help/ja/help_timesource.php
include/config_process.php
include/functions_ui.php
include/functions_custom_graphs.php
include/fgraph.php
include/functions_incidents.php
include/api.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/system_info.php
extensions/extension_uploader.php
extensions/pandora_logs.php
extensions/agents_modules.php
extensions/update_manager.php
extensions/ssh_console.php
extensions/dbmanager.php
extensions/vnc_view.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/users_connected.php
extensions/module_groups.php
extensions/update_manager/load_updatemanager.php
extensions/update_manager/lib/libupdate_manager_client.php
extensions/update_manager/lib/libupdate_manager.php
extensions/update_manager/lib/libupdate_manager_components.php
extensions/update_manager/lib/libupdate_manager_updates.php
extensions/update_manager/settings.php
extensions/update_manager/main.php
extensions/plugin_registration.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident_statistics.php
operation/search_modules.php
operation/visual_console/render_view.php
operation/visual_console/index.php
operation/extensions.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/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/exportdata.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/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/search_graphs.php
operation/snmpconsole/snmp_view.php
operation/users/user_edit.php
operation/gis_maps/render_view.php
operation/gis_maps/ajax.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident_statistics.php
operation/events/event_statistics.php
operation/events/events_rss.php
operation/events/export_csv.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/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/graph_viewer.php
operation/search_reports.php
operation/search_maps.php
operation/search_users.php
extras/pandora_diag.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
mobile/index.php
general/error_authconfig.php
general/links_menu.php
general/logon_ok.php
general/error_dbconfig.php
general/ui/agents_list.php
general/header.php
godmode/groups/modu_group_list.php
godmode/groups/configure_group.php
godmode/groups/configure_modu_group.php
godmode/groups/group_list.php
godmode/admin_access_logs.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/extensions.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/fields_manager.php
godmode/agentes/agent_conf_gis.php
godmode/agentes/module_manager_editor_prediction.php
godmode/agentes/module_manager.php
godmode/agentes/modificar_agente.php
godmode/agentes/configurar_agente.php
godmode/agentes/configure_field.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/recon_script.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/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/snmpconsole/snmp_alert.php
godmode/snmpconsole/snmp_filters.php
godmode/users/user_list.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/visual_console_builder.wizard.php
godmode/reporting/graph_builder.main.php
godmode/reporting/reporting_builder.list_items.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/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/map_builder.php
godmode/reporting/graphs.php
godmode/reporting/graph_builder.preview.php
include/functions_db.php: Added some includes and functions of this code have "db_" prefix.
* include/functions.php: Moved function check_login(), check_acl(),
dame_nombre_pluginid(), get_os_name() from functions_db.php to functions.php.
* include/functions_groups.php: Moved functions get_childrens(), safe_acl_group()
and get_parents(), give_disabled_group(), isAllGroups(), get_group_icon(), get_all_groups(),
get_id_groups_recursive(), get_user_groups_tree_recursive(), get_group_status(),
get_group_name(), get_group_users() from functions_db.php to this code.
* include/functions_profile.php: New library with profile functions. Moved functions
get_profile_name(), get_profiles(), create_user_profile(), delete_user_profile(),
delete_profile() from functions_db.php to this code. Added new parameter in function
get_profile() to retrieve profiles with filter conditions applied.
* include/functions_users.php: New library with users functions. Moved functions
get_users_info(), get_all_model_groups(), get_user_groups(), get_user_groups_tree(),
get_user_first_group(), user_access_to_agent() from funtions_db.php to this code.
* godmode/users/configure_user.php: Changed get_profile_filter() function to get_profile().
* include/functions_agents.php: Moved functions get_group_agents(), get_agent_modules(),
get_agent_module_id(), get_agent_id(), get_agent_name(), get_agent_modules_data_count(),
check_alert_fired(), get_agent_interval(), get_agent_os(), give_agentmodule_flag(),
agent_add_address(), agent_delete_address(), get_agent_address(), get_agent_with_ip(),
get_agent_addresses(), get_agent_status(), delete_agent(), get_agentmodule_group(),
get_agent_group() from functions_db.php to this code.
* include/functions_modules.php: Moved functions get_agentmodule(), get_agentmodule_id(),
get_agentmodule_is_init(), get_agent_modules_count(), get_module_type_name(),
get_module_type_icon(), get_agentmodule_agent(), get_agentmodule_agent_name(),
get_agentmodule_name(), get_agentmodule_type(), get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(), get_monitors_in_group(),
get_monitors_in_agent(), get_monitors_down(), get_moduletype_name(),
get_moduletype_description(), get_moduletypes(), get_module_interval(), show_icon_type(),
give_modulecategory_name(),
give_agent_id_from_module_id(), get_module_status(), get_agent_module_last_value(),
get_previous_data(), get_agentmodule_modulegroup(), get_modulegroups(),
get_modulegroup_name() from functions_db.php to this code.
* include/functions_alerts.php: Moved functions get_alert_type(), get_agent_alert_fired(),
get_module_alert_fired(), get_alert_fires_in_period(), get_group_alerts(), get_alerts_fired(),
get_alert_last_fire_timestamp_in_period(), get_agentmodule_status(),
get_agentmodule_last_status() from functions_db.php to this code.
* include/functions_exportserver.php: Moved function dame_nombre_servidorexportacion()
from functions_db.php to this code.
* include/functions_events.php: Moved functions get_group_events(), get_agent_events(),
get_module_events() from functions_db.php to this code.
* include/functions_servers.php: Moved functions get_server_name(), show_server_type(),
check_server_status(), server_status() from functions_db.php to this code.
* include/functions_network_profiles.php: Moved function get_networkprofile_name()
from functions_db.php to this code.
* include/functions_visual_map.php: Moved functions get_layoutdata_x(), get_layoutdata_y()
from fucntions_db.php to this code.
* include/functions_io.php: Moved function __() from functions_db.php to this code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4258 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-19 20:42:49 +02:00
|
|
|
return @db_process_sql_delete ('tnetwork_map', array ('id_networkmap' => $id_networkmap));
|
2010-07-30 11:03:23 +02:00
|
|
|
}
|
|
|
|
|
2015-01-15 15:43:08 +01:00
|
|
|
/**
|
|
|
|
* Deletes a network map if the property is that user.
|
|
|
|
*
|
|
|
|
* @param string User id that call this funtion.
|
|
|
|
* @param int Map id to be deleted.
|
|
|
|
*
|
|
|
|
* @return bool True if the map was deleted, false the map is not yours.
|
|
|
|
*/
|
|
|
|
function networkmap_delete_user_networkmap ($id_user = '', $id_networkmap) {
|
|
|
|
if ($id_user == '') {
|
|
|
|
$id_user = $config['id_user'];
|
|
|
|
}
|
|
|
|
$id_networkmap = safe_int ($id_networkmap);
|
|
|
|
if (empty ($id_networkmap))
|
|
|
|
return false;
|
|
|
|
$networkmap = networkmap_get_networkmap ($id_networkmap);
|
|
|
|
if ($networkmap === false)
|
|
|
|
return false;
|
|
|
|
return @db_process_sql_delete ('tnetwork_map', array ('id_networkmap' => $id_networkmap, 'id_user' => $id_user));
|
|
|
|
}
|
|
|
|
|
2010-07-30 11:03:23 +02:00
|
|
|
/**
|
|
|
|
* Updates a network map.
|
|
|
|
*
|
|
|
|
* @param int Map id.
|
|
|
|
* @param array Extra values to be set.
|
|
|
|
*
|
|
|
|
* @return bool True if the map was updated. False otherwise.
|
|
|
|
*/
|
2011-05-09 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* include/functions_graph.php
include/functions_html.php
include/functions_menu.php
include/graphs/fgraph.php
include/functions_messages.php
include/functions_modules.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_networkmap.php
include/functions_servers.php
include/functions_network_profiles.php
include/functions_network_components.php
include/functions_visual_map.php
include/ajax/visual_console_builder.ajax.php
include/ajax/agent.php
include/ajax/alert_list.ajax.php
include/ajax/module.php
include/functions_io.php
include/functions_api.php
include/functions_ui.php
include/fgraph.php
include/functions_incidents.php
include/functions.php
include/functions_agents.php
include/functions_db.php
include/functions_alerts.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/agents_modules.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/module_groups.php
extensions/plugin_registration.php
operation/incidents/incident.incident.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident.download_file.php
operation/incidents/incident.list.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/estado_agente.php
operation/agentes/networkmap.topology.php
operation/agentes/networkmap.groups.php
operation/agentes/sla_view.php
operation/agentes/exportdata.php
operation/agentes/estado_monitores.php
operation/agentes/ver_agente.php
operation/agentes/tactical.php
operation/agentes/group_view.php
operation/agentes/networkmap.php
operation/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/integria_incidents/incident.incident.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident.download_file.php
operation/integria_incidents/incident.list.php
operation/events/events_rss.php
operation/events/events_list.php
operation/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/custom_reporting.php
operation/search_reports.php
operation/search_results.php
mobile/operation/agents/monitor_status.php
mobile/operation/agents/view_agents.php
mobile/operation/agents/tactical.php
mobile/operation/agents/view_alerts.php
mobile/operation/agents/group_view.php
mobile/operation/servers/view_servers.php
general/logon_ok.php
general/header.php
godmode/admin_access_logs.php
godmode/db/db_refine.php
godmode/db/db_info.php
godmode/db/db_purge.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/module_manager.php
godmode/agentes/configurar_agente.php
godmode/agentes/module_manager_editor.php
godmode/agentes/agent_manager.php
godmode/servers/recon_script.php
godmode/servers/plugin.php
godmode/servers/manage_recontask.php
godmode/servers/modificar_server.php
godmode/menu.php
godmode/alerts/alert_list.list.php
godmode/alerts/configure_alert_compound.php
godmode/alerts/configure_alert_action.php
godmode/setup/os.list.php
godmode/setup/links.php
godmode/setup/setup.php
godmode/users/user_list.php
godmode/users/configure_user.php
godmode/massive/massive_add_alerts.php
godmode/massive/massive_delete_profiles.php
godmode/massive/massive_edit_agents.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/modules/manage_network_components_form.php
godmode/modules/manage_nc_groups_form.php
godmode/modules/manage_network_templates.php
godmode/modules/manage_network_components_form_common.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.preview.php
godmode/reporting/graph_builder.graph_editor.php
godmode/reporting/reporting_builder.php
godmode/reporting/reporting_builder.item_editor.php: Functions in
functions_incidents.php, functions_io.php, functions_menu.php, functions_messages.php,
functions_modules.php, functions_network_components.php, functions_network_profiles.php,
functions_networkmap.php, functions_reporting.php, functions_reports.php,
functions_servers.php have "incidents_", "io_", "menu_", "messages_", "modules_",
"network_profiles_", "network_components_", "networkmap_", "reporting_", "reports_",
"servers_" prefixes respectively.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4326 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-05-09 19:30:55 +02:00
|
|
|
function networkmap_update_networkmap ($id_networkmap, $values) {
|
|
|
|
$networkmap = networkmap_get_networkmap ($id_networkmap);
|
2010-07-30 11:03:23 +02:00
|
|
|
if ($networkmap === false)
|
|
|
|
return false;
|
* include/functions_graph.php
include/functions_html.php
include/functions_messages.php
include/db/postgresql.php
include/db/mysql.php
include/db/oracle.php
include/functions_reporting.php
include/functions_filemanager.php
include/functions_gis.php
include/auth/ldap.php
include/auth/mysql.php
include/functions_networkmap.php
include/functions_network_components.php
include/ajax/skins.ajax.php
include/ajax/reporting.ajax.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/help/en/help_timesource.php
include/help/es/help_timesource.php
include/help/ja/help_timesource.php
include/config_process.php
include/functions_ui.php
include/functions_custom_graphs.php
include/fgraph.php
include/functions_incidents.php
include/api.php
include/functions_reports.php
include/functions_ui_renders.php
extensions/insert_data.php
extensions/system_info.php
extensions/extension_uploader.php
extensions/pandora_logs.php
extensions/agents_modules.php
extensions/update_manager.php
extensions/ssh_console.php
extensions/dbmanager.php
extensions/vnc_view.php
extensions/resource_registration.php
extensions/resource_exportation.php
extensions/users_connected.php
extensions/module_groups.php
extensions/update_manager/load_updatemanager.php
extensions/update_manager/lib/libupdate_manager_client.php
extensions/update_manager/lib/libupdate_manager.php
extensions/update_manager/lib/libupdate_manager_components.php
extensions/update_manager/lib/libupdate_manager_updates.php
extensions/update_manager/settings.php
extensions/update_manager/main.php
extensions/plugin_registration.php
operation/incidents/incident.php
operation/incidents/incident_detail.php
operation/incidents/incident_statistics.php
operation/search_modules.php
operation/visual_console/render_view.php
operation/visual_console/index.php
operation/extensions.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/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/exportdata.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/agentes/stat_win.php
operation/servers/view_server.php
operation/servers/view_server_detail.php
operation/menu.php
operation/search_agents.php
operation/search_graphs.php
operation/snmpconsole/snmp_view.php
operation/users/user_edit.php
operation/gis_maps/render_view.php
operation/gis_maps/ajax.php
operation/integria_incidents/incident.php
operation/integria_incidents/incident_detail.php
operation/integria_incidents/incident_statistics.php
operation/events/event_statistics.php
operation/events/events_rss.php
operation/events/export_csv.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/search_alerts.php
operation/messages/message.php
operation/reporting/reporting_xml.php
operation/reporting/reporting_viewer.php
operation/reporting/graph_viewer.php
operation/search_reports.php
operation/search_maps.php
operation/search_users.php
extras/pandora_diag.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
mobile/index.php
general/error_authconfig.php
general/links_menu.php
general/logon_ok.php
general/error_dbconfig.php
general/ui/agents_list.php
general/header.php
godmode/groups/modu_group_list.php
godmode/groups/configure_group.php
godmode/groups/configure_modu_group.php
godmode/groups/group_list.php
godmode/admin_access_logs.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/extensions.php
godmode/agentes/agent_template.php
godmode/agentes/module_manager_editor_common.php
godmode/agentes/fields_manager.php
godmode/agentes/agent_conf_gis.php
godmode/agentes/module_manager_editor_prediction.php
godmode/agentes/module_manager.php
godmode/agentes/modificar_agente.php
godmode/agentes/configurar_agente.php
godmode/agentes/configure_field.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/recon_script.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/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/snmpconsole/snmp_alert.php
godmode/snmpconsole/snmp_filters.php
godmode/users/user_list.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/visual_console_builder.wizard.php
godmode/reporting/graph_builder.main.php
godmode/reporting/reporting_builder.list_items.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/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/map_builder.php
godmode/reporting/graphs.php
godmode/reporting/graph_builder.preview.php
include/functions_db.php: Added some includes and functions of this code have "db_" prefix.
* include/functions.php: Moved function check_login(), check_acl(),
dame_nombre_pluginid(), get_os_name() from functions_db.php to functions.php.
* include/functions_groups.php: Moved functions get_childrens(), safe_acl_group()
and get_parents(), give_disabled_group(), isAllGroups(), get_group_icon(), get_all_groups(),
get_id_groups_recursive(), get_user_groups_tree_recursive(), get_group_status(),
get_group_name(), get_group_users() from functions_db.php to this code.
* include/functions_profile.php: New library with profile functions. Moved functions
get_profile_name(), get_profiles(), create_user_profile(), delete_user_profile(),
delete_profile() from functions_db.php to this code. Added new parameter in function
get_profile() to retrieve profiles with filter conditions applied.
* include/functions_users.php: New library with users functions. Moved functions
get_users_info(), get_all_model_groups(), get_user_groups(), get_user_groups_tree(),
get_user_first_group(), user_access_to_agent() from funtions_db.php to this code.
* godmode/users/configure_user.php: Changed get_profile_filter() function to get_profile().
* include/functions_agents.php: Moved functions get_group_agents(), get_agent_modules(),
get_agent_module_id(), get_agent_id(), get_agent_name(), get_agent_modules_data_count(),
check_alert_fired(), get_agent_interval(), get_agent_os(), give_agentmodule_flag(),
agent_add_address(), agent_delete_address(), get_agent_address(), get_agent_with_ip(),
get_agent_addresses(), get_agent_status(), delete_agent(), get_agentmodule_group(),
get_agent_group() from functions_db.php to this code.
* include/functions_modules.php: Moved functions get_agentmodule(), get_agentmodule_id(),
get_agentmodule_is_init(), get_agent_modules_count(), get_module_type_name(),
get_module_type_icon(), get_agentmodule_agent(), get_agentmodule_agent_name(),
get_agentmodule_name(), get_agentmodule_type(), get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(), get_monitors_in_group(),
get_monitors_in_agent(), get_monitors_down(), get_moduletype_name(),
get_moduletype_description(), get_moduletypes(), get_module_interval(), show_icon_type(),
give_modulecategory_name(),
give_agent_id_from_module_id(), get_module_status(), get_agent_module_last_value(),
get_previous_data(), get_agentmodule_modulegroup(), get_modulegroups(),
get_modulegroup_name() from functions_db.php to this code.
* include/functions_alerts.php: Moved functions get_alert_type(), get_agent_alert_fired(),
get_module_alert_fired(), get_alert_fires_in_period(), get_group_alerts(), get_alerts_fired(),
get_alert_last_fire_timestamp_in_period(), get_agentmodule_status(),
get_agentmodule_last_status() from functions_db.php to this code.
* include/functions_exportserver.php: Moved function dame_nombre_servidorexportacion()
from functions_db.php to this code.
* include/functions_events.php: Moved functions get_group_events(), get_agent_events(),
get_module_events() from functions_db.php to this code.
* include/functions_servers.php: Moved functions get_server_name(), show_server_type(),
check_server_status(), server_status() from functions_db.php to this code.
* include/functions_network_profiles.php: Moved function get_networkprofile_name()
from functions_db.php to this code.
* include/functions_visual_map.php: Moved functions get_layoutdata_x(), get_layoutdata_y()
from fucntions_db.php to this code.
* include/functions_io.php: Moved function __() from functions_db.php to this code.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4258 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2011-04-19 20:42:49 +02:00
|
|
|
return (db_process_sql_update ('tnetwork_map',
|
2010-07-30 11:03:23 +02:00
|
|
|
$values,
|
|
|
|
array ('id_networkmap' => $id_networkmap))) !== false;
|
|
|
|
}
|
|
|
|
|
2012-04-23 13:37:17 +02:00
|
|
|
/**
|
|
|
|
* Get different networkmaps types for creation.
|
|
|
|
*
|
|
|
|
* @return Array Networkmap diferent types.
|
|
|
|
*/
|
2015-01-23 08:59:42 +01:00
|
|
|
function networkmap_get_types ($strict_user = false) {
|
2012-04-23 13:37:17 +02:00
|
|
|
$networkmap_types = array();
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2012-04-23 13:37:17 +02:00
|
|
|
$is_enterprise = enterprise_include_once('include/functions_policies.php');
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2012-04-23 13:37:17 +02:00
|
|
|
$networkmap_types['topology'] = __('Create a new topology map');
|
|
|
|
$networkmap_types['groups'] = __('Create a new group map');
|
2015-05-25 12:55:18 +02:00
|
|
|
$networkmap_types['dynamic'] = __('Create a new dynamic map');
|
2015-01-23 08:59:42 +01:00
|
|
|
if (!$strict_user) {
|
|
|
|
$networkmap_types['radial_dynamic'] = __('Create a new radial dynamic map');
|
|
|
|
}
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2015-01-23 08:59:42 +01:00
|
|
|
if (($is_enterprise !== ENTERPRISE_NOT_HOOK) && (!$strict_user)) {
|
2012-04-23 13:37:17 +02:00
|
|
|
$enterprise_types = enterprise_hook('policies_get_networkmap_types');
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2012-04-23 13:37:17 +02:00
|
|
|
$networkmap_types = array_merge($networkmap_types, $enterprise_types);
|
|
|
|
}
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2012-04-23 13:37:17 +02:00
|
|
|
return $networkmap_types;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get networkmaps types.
|
|
|
|
*
|
|
|
|
* @return Array Networkmap diferent types.
|
|
|
|
*/
|
2015-01-23 08:59:42 +01:00
|
|
|
function networkmap_get_filter_types ($strict_user = false) {
|
2012-04-23 13:37:17 +02:00
|
|
|
$networkmap_types = array();
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2012-04-23 13:37:17 +02:00
|
|
|
$is_enterprise = enterprise_include_once('include/functions_policies.php');
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2012-04-23 13:37:17 +02:00
|
|
|
$networkmap_types['topology'] = __('Topology');
|
|
|
|
$networkmap_types['groups'] = __('Group');
|
2015-05-25 12:55:18 +02:00
|
|
|
$networkmap_types['dynamic'] = __('Dynamic');
|
2015-01-23 08:59:42 +01:00
|
|
|
if (!$strict_user) {
|
|
|
|
$networkmap_types['radial_dynamic'] = __('Radial dynamic');
|
|
|
|
}
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2015-01-23 08:59:42 +01:00
|
|
|
if (($is_enterprise !== ENTERPRISE_NOT_HOOK) && (!$strict_user)) {
|
2012-04-23 13:37:17 +02:00
|
|
|
$enterprise_types = enterprise_hook('policies_get_networkmap_filter_types');
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2012-04-23 13:37:17 +02:00
|
|
|
$networkmap_types = array_merge($networkmap_types, $enterprise_types);
|
|
|
|
}
|
2012-10-09 17:51:33 +02:00
|
|
|
|
2012-04-23 13:37:17 +02:00
|
|
|
return $networkmap_types;
|
|
|
|
}
|
|
|
|
|
2014-05-23 16:42:55 +02:00
|
|
|
function networkmap_cidr_match($ip, $cidr_mask) {
|
|
|
|
//copy from open source code
|
|
|
|
// https://gist.github.com/linickx/1309388
|
|
|
|
|
2014-05-26 16:55:19 +02:00
|
|
|
$chunks = explode("/", $cidr_mask);
|
|
|
|
$subnet = $chunks[0];
|
|
|
|
$bits = $chunks[1];
|
2014-05-23 16:42:55 +02:00
|
|
|
|
|
|
|
$ip = ip2long($ip);
|
|
|
|
$subnet = ip2long($subnet);
|
|
|
|
$mask = -1 << (32 - $bits);
|
|
|
|
$subnet &= $mask; # nb: in case the supplied subnet wasn't correctly aligned
|
|
|
|
|
|
|
|
return ($ip & $mask) == $subnet;
|
|
|
|
}
|
|
|
|
|
2016-04-12 15:00:38 +02:00
|
|
|
function networkmap_get_new_nodes_from_ip_mask($ip_mask,
|
|
|
|
$fields = array(), $strict_user = false) {
|
|
|
|
|
2014-05-23 16:42:55 +02:00
|
|
|
$list_ip_masks = explode(",", $ip_mask);
|
|
|
|
|
|
|
|
$list_address = db_get_all_rows_in_table('taddress');
|
|
|
|
if (empty($address))
|
|
|
|
$address = array();
|
2016-04-12 13:22:56 +02:00
|
|
|
|
2015-01-23 08:59:42 +01:00
|
|
|
if ($strict_user) {
|
|
|
|
$filter['group_by'] = 'tagente.id_agente';
|
|
|
|
$fields = array ('tagente.id_agente');
|
|
|
|
$acltags = tags_get_user_module_and_tags ($config['id_user'],'AR', $strict_user);
|
|
|
|
$user_agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $filter, $fields, false, $strict_user, true);
|
2016-04-12 13:22:56 +02:00
|
|
|
|
2015-01-23 08:59:42 +01:00
|
|
|
foreach ($all_user_agents as $agent) {
|
|
|
|
$user_agents[$agent['id_agente']] = $agent['id_agente'];
|
|
|
|
}
|
|
|
|
}
|
2016-04-12 13:22:56 +02:00
|
|
|
|
2014-05-23 16:42:55 +02:00
|
|
|
$agents = array();
|
|
|
|
foreach ($list_address as $address) {
|
|
|
|
foreach ($list_ip_masks as $ip_mask) {
|
|
|
|
if (networkmap_cidr_match($address['ip'], $ip_mask)) {
|
2016-04-12 13:22:56 +02:00
|
|
|
$id_agent = db_get_value_filter('id_agent', 'taddress_agent',
|
|
|
|
array('id_a' => $address['id_a']));
|
|
|
|
|
|
|
|
if (empty($id_agent)) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2014-05-26 16:55:19 +02:00
|
|
|
if (empty($fields)) {
|
2015-01-23 08:59:42 +01:00
|
|
|
if ($strict_user) {
|
|
|
|
if (array_key_exists($id_agent, $user_agents)) {
|
|
|
|
$agents[] = db_get_value_filter('id_agent', 'taddress_agent', array('id_a' => $address['id_a']));
|
|
|
|
}
|
2016-04-12 13:22:56 +02:00
|
|
|
}
|
|
|
|
else {
|
2015-01-23 08:59:42 +01:00
|
|
|
$agents[] = db_get_value_filter('id_agent', 'taddress_agent', array('id_a' => $address['id_a']));
|
|
|
|
}
|
2016-04-12 13:22:56 +02:00
|
|
|
|
2014-05-26 16:55:19 +02:00
|
|
|
}
|
|
|
|
else {
|
2015-01-23 08:59:42 +01:00
|
|
|
if ($strict_user) {
|
|
|
|
if (array_key_exists($id_agent, $user_agents)) {
|
|
|
|
$agents[] = db_get_row('tagente', 'id_agente', $id_agent, $fields);
|
|
|
|
}
|
2016-04-12 13:22:56 +02:00
|
|
|
}
|
|
|
|
else {
|
2015-01-23 08:59:42 +01:00
|
|
|
$agents[] = db_get_row('tagente', 'id_agente', $id_agent, $fields);
|
|
|
|
}
|
2014-05-26 16:55:19 +02:00
|
|
|
}
|
2014-05-23 16:42:55 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $agents;
|
|
|
|
}
|
|
|
|
|
2009-07-16 18:15:10 +02:00
|
|
|
?>
|
|
|
|
<script language="javascript" type="text/javascript">
|
2013-05-16 12:16:16 +02:00
|
|
|
$(document).ready (function () {
|
2015-03-31 17:30:53 +02:00
|
|
|
// TODO: Implement the jquery tooltip functionality everywhere
|
|
|
|
// and remove the cluetip code.
|
|
|
|
$("area[title!='<?php echo 'Pandora FMS'; ?>']")
|
|
|
|
.each(function (index, element) {
|
|
|
|
// Store the title.
|
|
|
|
// The title stores the url into a data property
|
|
|
|
$(element).data('uri', $(element).prop('title'));
|
|
|
|
})
|
|
|
|
.tooltip({
|
|
|
|
track: true,
|
|
|
|
content: '<?php html_print_image("images/spinner.gif"); ?>',
|
|
|
|
open: function (evt, ui) {
|
|
|
|
var elem = $(this);
|
|
|
|
var uri = elem.data('uri');
|
|
|
|
|
|
|
|
if (typeof uri != 'undefined' && uri.length > 0) {
|
|
|
|
var jqXHR = $.ajax(uri).done(function(data) {
|
|
|
|
elem.tooltip('option', 'content', data);
|
|
|
|
});
|
|
|
|
// Store the connection handler
|
|
|
|
elem.data('jqXHR', jqXHR);
|
|
|
|
}
|
|
|
|
|
2015-03-31 18:10:13 +02:00
|
|
|
$(".ui-tooltip>.ui-tooltip-content:not(.cluetip-default)")
|
|
|
|
.addClass("cluetip-default");
|
2015-03-31 17:30:53 +02:00
|
|
|
},
|
|
|
|
close: function (evt, ui) {
|
|
|
|
var elem = $(this);
|
|
|
|
var jqXHR = elem.data('jqXHR');
|
|
|
|
|
|
|
|
// Close the connection handler
|
|
|
|
if (typeof jqXHR != 'undefined')
|
|
|
|
jqXHR.abort();
|
|
|
|
}
|
|
|
|
});
|
2009-07-16 18:15:10 +02:00
|
|
|
});
|
|
|
|
</script>
|