2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
< ? php
2008-08-22 20:07:32 +02:00
2009-06-08 20:26:14 +02:00
// Pandora FMS - http://pandorafms.com
// ==================================================
2011-03-02 22:56:48 +01:00
// Copyright (c) 2005-2011 Artica Soluciones Tecnologicas
2009-06-08 20:26:14 +02:00
// Please see http://pandorafms.org for full contribution list
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
// This program is free software; you can redistribute it and/or
2009-06-08 20:26:14 +02:00
// modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; version 2
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
// 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.
2009-06-08 20:26:14 +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
/**
2019-01-30 16:18:44 +01: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 Reporting
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
*/
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
2011-04-13 17:11:51 +02:00
global $config ;
2011-05-06 09:12:58 +02:00
2019-01-30 16:18:44 +01:00
// Fix ajax include this file.
2011-05-06 09:12:58 +02:00
global $ajax ;
if ( ! isset ( $ajax )) {
2019-01-30 16:18:44 +01:00
include_once 'functions_graph.php' ;
2011-05-06 09:12:58 +02:00
}
2019-01-30 16:18:44 +01:00
require_once $config [ 'homedir' ] . '/include/functions_agents.php' ;
require_once $config [ 'homedir' ] . '/include/functions_modules.php' ;
require_once $config [ 'homedir' ] . '/include/functions_users.php' ;
require_once $config [ 'homedir' ] . '/include/functions.php' ;
require_once $config [ 'homedir' ] . '/include/graphs/functions_d3.php' ;
2018-09-04 17:23:42 +02:00
enterprise_include_once ( 'include/functions_visual_map.php' );
2011-04-13 17:11:51 +02:00
2019-01-30 16:18:44 +01:00
function visual_map_print_item_toolbox ( $idDiv , $text , $float )
{
if ( $float == 'left' ) {
$margin = 'margin-right' ;
} else {
$margin = 'margin-left' ;
}
echo '<div class="button_toolbox" id="' . $idDiv . ' "
style = " font-weight: bolder; text-align:; float: '. $float .';'. $margin .': 5px; " > ' ;
echo $text ;
echo '</span>' ;
echo '</div>' ;
2012-02-21 15:05:57 +01:00
}
2019-01-30 16:18:44 +01:00
function visual_map_print_user_line_handles ( $layoutData )
{
$id = $layoutData [ 'id' ];
$start_x = $layoutData [ 'pos_x' ];
$start_y = $layoutData [ 'pos_y' ];
$end_x = $layoutData [ 'width' ];
$end_y = $layoutData [ 'height' ];
$z_index = 2 ;
$sizeStyle = '' ;
$radious_handle = ( 12 / 2 );
// Handle of start
echo '<div id="handler_start_' . $id . '" class="item handler_start" ' . 'style="z-index: ' . $z_index . ';' . 'position: absolute; top: ' . ( $start_y - $radious_handle ) . 'px; ' . 'left: ' . ( $start_x - $radious_handle ) . 'px;' . 'text-align: ;' . 'display: inline-block; ' . $sizeStyle . '">' ;
html_print_image ( 'images/dot_red.png' );
echo '</div>' ;
// Handle of end
echo '<div id="handler_end_' . $id . '" class="item handler_end" ' . 'style="z-index: ' . $z_index . ';' . 'position: absolute; top: ' . ( $end_y - $radious_handle ) . 'px; ' . 'left: ' . ( $end_x - $radious_handle ) . 'px;' . 'text-align: ;' . 'display: inline-block; ' . $sizeStyle . '">' ;
html_print_image ( 'images/dot_green.png' );
echo '</div>' ;
2014-11-25 11:52:04 +01:00
}
2019-01-30 16:18:44 +01:00
function visual_map_print_item (
$mode = 'read' ,
$layoutData ,
$proportion = null ,
$show_links = true ,
$isExternalLink = false ,
$graph_javascript = true
) {
global $config ;
include_once $config [ 'homedir' ] . '/include/functions_graph.php' ;
include_once $config [ 'homedir' ] . '/include/functions_custom_graphs.php' ;
// add 60 px for visual console map
$width = $layoutData [ 'width' ];
$height = $layoutData [ 'height' ];
$max_percentile = $layoutData [ 'height' ];
$top = $layoutData [ 'pos_y' ];
$left = $layoutData [ 'pos_x' ];
$id = $layoutData [ 'id' ];
$label = io_safe_output ( $layoutData [ 'label' ]);
$id_module = $layoutData [ 'id_agente_modulo' ];
$type = $layoutData [ 'type' ];
$period = $layoutData [ 'period' ];
$type_graph = $layoutData [ 'type_graph' ];
$border_width = $layoutData [ 'border_width' ];
$border_color = $layoutData [ 'border_color' ];
$fill_color = $layoutData [ 'fill_color' ];
$label_position = $layoutData [ 'label_position' ];
$show_on_top = $layoutData [ 'show_on_top' ];
$clock_animation = $layoutData [ 'clock_animation' ];
$time_format = $layoutData [ 'time_format' ];
$timezone = $layoutData [ 'timezone' ];
if ( $show_on_top ) {
$show_on_top_index = 10 ;
} else {
$show_on_top_index = '' ;
}
$sizeStyle = '' ;
$borderStyle = '' ;
$imageSize = '' ;
if ( ! empty ( $proportion )) {
$top = ( $top * $proportion [ 'proportion_height' ]);
$left = ( $left * $proportion [ 'proportion_width' ]);
}
$text = '<span id="text_' . $id . '" class="text">' . $label . '</span>' ;
if ( $height == 0 ) {
switch ( $type ) {
case 0 :
case 11 :
$tableheight0 = '70' ;
break ;
case 3 :
$tableheight0 = '30' ;
break ;
case 9 :
$tableheight0 = '130' ;
break ;
case 1 :
$tableheight0 = '180' ;
break ;
case SERVICE :
$tableheight0 = '50' ;
break ;
}
} else {
$tableheight0 = $height ;
}
if ( $layoutData [ 'width' ] == 0 ) {
switch ( $type ) {
case 19 :
if ( $layoutData [ 'clock_animation' ] == 'analogic_1' ) {
$himg = '200' ;
$wimg = '200' ;
} else {
$himg = '60' ;
$wimg = '200' ;
}
break ;
}
} else {
switch ( $type ) {
case 19 :
if ( $layoutData [ 'clock_animation' ] == 'analogic_1' ) {
$himg = $width ;
$wimg = $width ;
} else {
$himg = ( $width / 3.9 );
$wimg = $width ;
}
break ;
}
}
if ( $layoutData [ 'width' ] == 0 || $layoutData [ 'height' ] == 0 ) {
switch ( $type ) {
case 0 :
case 11 :
$himg = '70' ;
$wimg = '70' ;
break ;
case 3 :
case 14 :
if ( get_parameter ( 'action' ) == 'edit' ) {
$himg = '30' ;
$wimg = '150' ;
} else {
$himg = '15' ;
$wimg = '150' ;
}
break ;
case 9 :
$himg = '130' ;
$wimg = '130' ;
break ;
case 1 :
$himg = '180' ;
$wimg = '300' ;
break ;
case SERVICE :
$himg = '50' ;
$wimg = '150' ;
break ;
}
} else {
$wimg = $layoutData [ 'width' ];
$himg = $layoutData [ 'height' ];
if ( $type == 3 ) {
if ( get_parameter ( 'action' ) == 'edit' ) {
$himg = '30' ;
} else {
$himg = '15' ;
}
}
if ( $type == 9 ) {
$himg = $wimg ;
}
}
if ( $label_position == 'left' ) {
$text = '<table style="float:left;height:' . $himg . 'px;"><tr><td></td></tr><tr><td><span id="text_' . $id . '" class="text">' . $label . '</span></td></tr><tr><td></td></tr></table>' ;
} else if ( $label_position == 'right' ) {
$text = '<table style="float:right;height:' . $himg . 'px;"><tr><td></td></tr><tr><td><span style="" id="text_' . $id . '" class="text">' . $label . '</span></td></tr><tr><td></td></tr></table>' ;
} else {
$text = '<table style="text-align:center ;width:' . $wimg . 'px;"><tr><td></td></tr><tr><td><span style="" id="text_' . $id . '" class="text">' . $label . '</span></td></tr><tr><td></td></tr></table>' ;
}
if ( ! isset ( $layoutData [ 'status_calculated' ])) {
$layoutData [ 'status_calculated' ] = visual_map_get_status_element ( $layoutData );
}
$status = $layoutData [ 'status_calculated' ];
switch ( $status ) {
case VISUAL_MAP_STATUS_CRITICAL_BAD :
// Critical (BAD)
$colorStatus = COL_CRITICAL ;
break ;
case VISUAL_MAP_STATUS_CRITICAL_ALERT :
// Critical (ALERT)
$colorStatus = COL_ALERTFIRED ;
break ;
case VISUAL_MAP_STATUS_NORMAL :
// Normal (OK)
$colorStatus = COL_NORMAL ;
break ;
case VISUAL_MAP_STATUS_WARNING :
// Warning
$colorStatus = COL_WARNING ;
break ;
case VISUAL_MAP_STATUS_UNKNOWN :
default :
// Unknown
// Default is Blue (Other)
$colorStatus = COL_UNKNOWN ;
break ;
}
$element_enterprise = [];
if ( enterprise_installed ()) {
$element_enterprise = enterprise_visual_map_print_item (
$mode ,
$layoutData ,
$proportion ,
$show_links ,
$isExternalLink
);
}
$link = false ;
$url = '#' ;
if ( $show_links && ( $mode == 'read' )) {
switch ( $type ) {
case STATIC_GRAPH :
case GROUP_ITEM :
if ( $layoutData [ 'enable_link' ]
&& can_user_access_node ()
) {
$link = true ;
}
break ;
case LABEL :
if ( $layoutData [ 'id_layout_linked' ] != 0 ) {
$link = true ;
}
break ;
case ICON :
if ( $layoutData [ 'id_layout_linked' ] > 0 ) {
$link = true ;
} else if ( preg_match ( '/<a.*href=["\'](.*)["\']>/' , $layoutData [ 'label' ], $matches )) {
// Link to an URL
if ( $layoutData [ 'enable_link' ]) {
$link = true ;
}
} else if ( preg_match ( '/^.*(http:\/\/)((.)+).*$/i' , $layoutData [ 'label' ])) {
// Link to an URL
if ( $layoutData [ 'enable_link' ]) {
$link = true ;
}
}
break ;
case SIMPLE_VALUE :
case SIMPLE_VALUE_MAX :
case SIMPLE_VALUE_MIN :
case SIMPLE_VALUE_AVG :
// Extract id service if it is a prediction module.
$id_service = db_get_value_filter (
'custom_integer_1' ,
'tagente_modulo' ,
[
'id_agente_modulo' => $layoutData [ 'id_agente_modulo' ],
'prediction_module' => 1 ,
]
);
if ( ! empty ( $id_service ) && can_user_access_node ()) {
if ( $layoutData [ 'enable_link' ]) {
$link = true ;
}
} else if ( $layoutData [ 'id_layout_linked' ] > 0 ) {
$link = true ;
} else if ( $layoutData [ 'enable_link' ] && can_user_access_node ()) {
$link = true ;
}
break ;
case PERCENTILE_BAR :
case PERCENTILE_BUBBLE :
case CIRCULAR_PROGRESS_BAR :
case CIRCULAR_INTERIOR_PROGRESS_BAR :
if ( ! empty ( $layoutData [ 'id_agent' ])
&& empty ( $layoutData [ 'id_layout_linked' ])
) {
if ( $layoutData [ 'enable_link' ]
&& can_user_access_node ()
) {
// Extract id service if it is a prediction module.
$id_service = db_get_value_filter (
'custom_integer_1' ,
'tagente_modulo' ,
[
'id_agente_modulo' => $layoutData [ 'id_agente_modulo' ],
'prediction_module' => 1 ,
]
);
if ( ! empty ( $id_service )) {
// Link to an service page
$link = true ;
} else if ( $layoutData [ 'id_agente_modulo' ] != 0 ) {
// Link to an module
$link = true ;
} else {
// Link to an agent
$link = true ;
}
}
} else if ( $layoutData [ 'id_layout_linked' ] > 0 ) {
// Link to a map
$link = true ;
}
break ;
case MODULE_GRAPH :
if ((( $layoutData [ 'id_layout_linked' ] == '' )
|| ( $layoutData [ 'id_layout_linked' ] == 0 ))
&& can_user_access_node ()
) {
if ( $layoutData [ 'enable_link' ]) {
// Extract id service if it is a prediction module.
$id_service = db_get_value_filter (
'custom_integer_1' ,
'tagente_modulo' ,
[
'id_agente_modulo' => $layoutData [ 'id_agente_modulo' ],
'prediction_module' => 1 ,
]
);
if ( $id_service === false ) {
$id_service = 0 ;
}
if ( $id_service != 0 ) {
// Link to an service page
if ( ! empty ( $layoutData [ 'id_metaconsole' ])) {
$link = true ;
} else {
$link = true ;
}
} else {
$link = true ;
}
}
} else {
// Link to a map
$link = true ;
}
break ;
case BARS_GRAPH :
$link = true ;
break ;
case AUTO_SLA_GRAPH :
$link = true ;
break ;
case DONUT_GRAPH :
$link = true ;
break ;
default :
if ( ! empty ( $element_enterprise )) {
$link = $element_enterprise [ 'link' ];
}
break ;
}
}
if ( $link ) {
switch ( $type ) {
case STATIC_GRAPH :
$is_a_service = false ;
$is_a_link_to_other_visualconsole = false ;
if ( enterprise_installed ()) {
$id_service = services_service_from_module ( $layoutData [ 'id_agente_modulo' ]);
if ( ! empty ( $id_service )) {
$is_a_service = true ;
}
}
if ( $layoutData [ 'id_layout_linked' ] != 0 ) {
$is_a_link_to_other_visualconsole = true ;
}
if ( $is_a_service ) {
if ( empty ( $layoutData [ 'id_metaconsole' ])) {
$url = $config [ 'homeurl' ] . 'index.php?sec=services&sec2=enterprise/operation/services/services&id_service=' . $id_service . '&offset=0' ;
} else {
$server = db_get_row (
'tmetaconsole_setup' ,
'id' ,
$layoutData [ 'id_metaconsole' ]
);
$url = $server [ 'server_url' ] . '/' . 'index.php?sec=services&sec2=enterprise/operation/services/services&id_service=' . $id_service . '&offset=0' ;
}
} else if ( $is_a_link_to_other_visualconsole ) {
if ( ! is_metaconsole ()) {
2019-03-11 13:25:28 +01:00
$url = $config [ 'homeurl' ] . 'index.php?sec=network&sec2=operation/visual_console/render_view&pure=' . $config [ 'pure' ] . '&id=' . $layoutData [ 'id_layout_linked' ];
2019-01-30 16:18:44 +01:00
} else {
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap=' . $layoutData [ 'id_layout_linked' ] . '&refr=0' ;
}
} else {
if ( $layoutData [ 'id_agente_modulo' ] != 0 ) {
// Link to an module
if ( empty ( $layoutData [ 'id_metaconsole' ])) {
$url = $config [ 'homeurl' ] . 'index.php?sec=view&sec2=operation/agentes/status_monitor&id_module=' . $layoutData [ 'id_agente_modulo' ];
} else {
$url = ui_meta_get_url_console_child (
$layoutData [ 'id_metaconsole' ],
'view' ,
'operation/agentes/status_monitor&id_module=' . $layoutData [ 'id_agente_modulo' ],
null ,
null ,
null ,
$isExternalLink
);
}
} else {
// Link to an agent
if ( empty ( $layoutData [ 'id_metaconsole' ])) {
$url = $config [ 'homeurl' ] . 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=' . $layoutData [ 'id_agent' ];
} else {
$url = ui_meta_get_url_console_child (
$layoutData [ 'id_metaconsole' ],
'estado' ,
'operation/agentes/ver_agente&id_agente=' . $layoutData [ 'id_agent' ],
null ,
null ,
null ,
$isExternalLink
);
}
}
}
break ;
case AUTO_SLA_GRAPH :
$e_period = $layoutData [ 'period' ];
$date = get_system_time ();
$datelimit = ( $date - $e_period );
$time_format = 'Y/m/d H:i:s' ;
$timestamp_init = date ( $time_format , $datelimit );
$timestamp_end = date ( $time_format , $date );
$timestamp_init_aux = explode ( ' ' , $timestamp_init );
$timestamp_end_aux = explode ( ' ' , $timestamp_end );
$date_from = $timestamp_init_aux [ 0 ];
$time_from = $timestamp_init_aux [ 1 ];
$date_to = $timestamp_end_aux [ 0 ];
$time_to = $timestamp_end_aux [ 1 ];
if ( empty ( $layout_data [ 'id_metaconsole' ])) {
$url = $config [ 'homeurl' ] . 'index.php?sec=eventos&sec2=operation/events/events&id_agent=' . $layoutData [ 'id_agent' ] . '&module_search_hidden=' . $layoutData [ 'id_agente_modulo' ] . '&date_from=' . $date_from . '&time_from=' . $time_from . '&date_to=' . $date_to . '&time_to=' . $time_to . '&status=-1' ;
} else {
$url = 'index.php?sec=eventos&sec2=operation/events/events&id_agent=' . $layoutData [ 'id_agent' ] . '&module_search_hidden=' . $layoutData [ 'id_agente_modulo' ] . '&date_from=' . $date_from . '&time_from=' . $time_from . '&date_to=' . $date_to . '&time_to=' . $time_to . '&status=-1' ;
}
break ;
case DONUT_GRAPH :
if ( empty ( $layout_data [ 'id_metaconsole' ])) {
$url = $config [ 'homeurl' ] . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=' . $layoutData [ 'id_agent' ] . '&tab=module&edit_module=1&id_agent_module=' . $layoutData [ 'id_agente_modulo' ];
} else {
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=' . $layoutData [ 'id_agent' ] . '&tab=module&edit_module=1&id_agent_module=' . $layoutData [ 'id_agente_modulo' ];
}
break ;
case BARS_GRAPH :
if ( empty ( $layout_data [ 'id_metaconsole' ])) {
$url = $config [ 'homeurl' ] . 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=' . $layoutData [ 'id_agent' ] . '&tab=module&edit_module=1&id_agent_module=' . $layoutData [ 'id_agente_modulo' ];
} else {
$url = 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente=' . $layoutData [ 'id_agent' ] . '&tab=module&edit_module=1&id_agent_module=' . $layoutData [ 'id_agente_modulo' ];
}
break ;
case GROUP_ITEM :
$is_a_link_to_other_visualconsole = false ;
if ( $layoutData [ 'id_layout_linked' ] != 0 ) {
$is_a_link_to_other_visualconsole = true ;
}
if ( $is_a_link_to_other_visualconsole ) {
if ( METACONSOLE == 1 ) {
$url = $config [ 'homeurl' ] . 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=0&id_visualmap=' . $layoutData [ 'id_layout_linked' ] . '&refr=300' ;
} else {
2019-03-11 13:25:28 +01:00
$url = $config [ 'homeurl' ] . 'index.php?sec=network&sec2=operation/visual_console/render_view&pure=' . $config [ 'pure' ] . '&id=' . $layoutData [ 'id_layout_linked' ];
2019-01-30 16:18:44 +01:00
}
} else {
if ( METACONSOLE == 1 ) {
$url = $config [ 'homeurl' ] . 'index.php?sec=estado&sec2=operation/agentes/status_monitor&refr=0&ag_group=' . $layoutData [ 'id_group' ] . '&ag_freestring=&module_option=1&ag_modulename=&moduletype=&datatype=&status=-1&sort_field=&sort=none&pure=' ;
} else {
$url = $config [ 'homeurl' ] . 'index.php?sec=estado&sec2=operation/agentes/estado_agente&group_id=' . $layoutData [ 'id_group' ];
}
}
break ;
case LABEL :
if ( $layoutData [ 'id_layout_linked' ] != 0 ) {
// Link to a map
2019-03-11 13:25:28 +01:00
$url = $config [ 'homeurl' ] . 'index.php?sec=network&sec2=operation/visual_console/render_view&pure=' . $config [ 'pure' ] . '&id=' . $layoutData [ 'id_layout_linked' ];
2019-01-30 16:18:44 +01:00
}
break ;
case ICON :
$url_icon = '' ;
if ( $layoutData [ 'id_layout_linked' ] != 0 ) {
// Link to a map
if ( empty ( $layoutData [ 'id_metaconsole' ])) {
2019-03-11 13:25:28 +01:00
$url = 'index.php?sec=network&sec2=operation/visual_console/render_view&pure=' . $config [ 'pure' ] . '&id=' . $layoutData [ 'id_layout_linked' ];
2019-01-30 16:18:44 +01:00
} else {
$pure = get_parameter ( 'pure' , 0 );
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '&id_visualmap=' . $layoutData [ 'id_layout_linked' ] . '&refr=0' ;
}
} else if ( preg_match ( '/<a.*href=["\'](.*)["\']>/' , $layoutData [ 'label' ], $matches )) {
// Link to an URL
if ( $layoutData [ 'enable_link' ]) {
$url = strip_tags ( $matches [ 1 ]);
}
} else if ( preg_match ( '/^.*(http:\/\/)((.)+).*$/i' , $layoutData [ 'label' ])) {
// Link to an URL
if ( $layoutData [ 'enable_link' ]) {
$url = strip_tags ( $layoutData [ 'label' ]);
}
}
break ;
case SIMPLE_VALUE :
case SIMPLE_VALUE_MAX :
case SIMPLE_VALUE_MIN :
case SIMPLE_VALUE_AVG :
// Extract id service if it is a prediction module.
$id_service = db_get_value_filter (
'custom_integer_1' ,
'tagente_modulo' ,
[
'id_agente_modulo' => $layoutData [ 'id_agente_modulo' ],
'prediction_module' => 1 ,
]
);
if ( ! empty ( $id_service ) && can_user_access_node ()) {
// Link to an service page
if ( ! empty ( $layoutData [ 'id_metaconsole' ])) {
$server = db_get_row (
'tmetaconsole_setup' ,
'id' ,
$layoutData [ 'id_metaconsole' ]
);
$url = $server [ 'server_url' ] . '/' . 'index.php?sec=services&sec2=enterprise/operation/services/services&id_service=' . $id_service . '&offset=0' ;
} else {
$url = 'index.php?sec=services&sec2=enterprise/operation/services/services&id_service=' . $id_service . '&offset=0' ;
}
} else if ( $layoutData [ 'id_layout_linked' ] > 0 ) {
// Link to a map
if ( empty ( $layoutData [ 'id_metaconsole' ])) {
2019-03-11 13:25:28 +01:00
$url = 'index.php?sec=network&sec2=operation/visual_console/render_view&pure=' . $config [ 'pure' ] . '&id=' . $layoutData [ 'id_layout_linked' ];
2019-01-30 16:18:44 +01:00
} else {
$pure = get_parameter ( 'pure' , 0 );
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '&id_visualmap=' . $layoutData [ 'id_layout_linked' ] . '&refr=0' ;
}
} else if ( $layoutData [ 'id_agente_modulo' ] != 0 ) {
// Link to an module
if ( empty ( $layoutData [ 'id_metaconsole' ])) {
$url = $config [ 'homeurl' ] . 'index.php?sec=view&sec2=operation/agentes/status_monitor&id_module=' . $layoutData [ 'id_agente_modulo' ];
} else {
$url = ui_meta_get_url_console_child (
$layoutData [ 'id_metaconsole' ],
'estado' ,
'operation/agentes/ver_agente&id_agente=' . $layoutData [ 'id_agent' ],
null ,
null ,
null ,
$isExternalLink
);
}
}
break ;
case PERCENTILE_BAR :
case PERCENTILE_BUBBLE :
case CIRCULAR_PROGRESS_BAR :
case CIRCULAR_INTERIOR_PROGRESS_BAR :
if ( ! empty ( $layoutData [ 'id_agent' ])) {
// Extract id service if it is a prediction module.
$id_service = db_get_value_filter (
'custom_integer_1' ,
'tagente_modulo' ,
[
'id_agente_modulo' => $layoutData [ 'id_agente_modulo' ],
'prediction_module' => 1 ,
]
);
if ( ! empty ( $id_service )) {
// Link to an service page
if ( ! empty ( $layoutData [ 'id_metaconsole' ])) {
$server = db_get_row (
'tmetaconsole_setup' ,
'id' ,
$layoutData [ 'id_metaconsole' ]
);
$url = $server [ 'server_url' ] . '/' . 'index.php?sec=services&sec2=enterprise/operation/services/services&id_service=' . $id_service . '&offset=0' ;
} else {
$url = 'index.php?sec=services&sec2=enterprise/operation/services/services&id_service=' . $id_service . '&offset=0' ;
}
} else if ( $layoutData [ 'id_agente_modulo' ] != 0 ) {
// Link to an module
if ( ! empty ( $layoutData [ 'id_metaconsole' ])) {
$server = db_get_row (
'tmetaconsole_setup' ,
'id' ,
$layoutData [ 'id_metaconsole' ]
);
$url = $server [ 'server_url' ] . '/index.php?sec=view&sec2=operation/agentes/status_monitor&id_module=' . $layoutData [ 'id_agente_modulo' ];
} else {
$url = $config [ 'homeurl' ] . '/index.php?sec=view&sec2=operation/agentes/status_monitor&id_module=' . $layoutData [ 'id_agente_modulo' ];
}
} else {
// Link to an agent
if ( empty ( $layoutData [ 'id_metaconsole' ])) {
$url = $config [ 'homeurl' ] . 'index.php?' . 'sec=estado&' . 'sec2=operation/agentes/ver_agente&id_agente=' . $layoutData [ 'id_agent' ];
} else {
$url = ui_meta_get_url_console_child (
$layoutData [ 'id_metaconsole' ],
'estado' ,
'operation/agentes/ver_agente&id_agente=' . $layoutData [ 'id_agent' ],
null ,
null ,
null ,
$isExternalLink
);
}
}
} else if ( $layoutData [ 'id_layout_linked' ] > 0 ) {
// Link to a map
if ( empty ( $layoutData [ 'id_metaconsole' ])) {
$url = 'index.php?sec=reporting&sec2=operation/visual_console/render_view&pure=' . $config [ 'pure' ] . '&id=' . $layoutData [ 'id_layout_linked' ];
} else {
$pure = get_parameter ( 'pure' , 0 );
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '&id_visualmap=' . $layoutData [ 'id_layout_linked' ] . '&refr=0' ;
}
}
break ;
case MODULE_GRAPH :
if ((( $layoutData [ 'id_layout_linked' ] == '' )
|| ( $layoutData [ 'id_layout_linked' ] == 0 ))
&& can_user_access_node ()
) {
if ( $layoutData [ 'enable_link' ]) {
// Extract id service if it is a prediction module.
$id_service = db_get_value_filter (
'custom_integer_1' ,
'tagente_modulo' ,
[
'id_agente_modulo' => $layoutData [ 'id_agente_modulo' ],
'prediction_module' => 1 ,
]
);
if ( ! empty ( $id_service )) {
// Link to an service page
if ( ! empty ( $layoutData [ 'id_metaconsole' ])) {
$server = db_get_row (
'tmetaconsole_setup' ,
'id' ,
$layoutData [ 'id_metaconsole' ]
);
$url = $server [ 'server_url' ] . '/index.php?sec=services&sec2=enterprise/operation/services/services&id_service=' . $id_service . '&offset=0' ;
} else {
$url = $config [ 'homeurl' ] . '/index.php?sec=services&sec2=enterprise/operation/services/services&id_service=' . $id_service . '&offset=0' ;
}
} else {
if ( empty ( $layoutData [ 'id_metaconsole' ])) {
$url = $config [ 'homeurl' ] . '/index.php?sec=view&sec2=operation/agentes/status_monitor&id_module=' . $layoutData [ 'id_agente_modulo' ];
} else {
$url = ui_meta_get_url_console_child (
$layoutData [ 'id_metaconsole' ],
'estado' ,
'operation/agentes/ver_agente&id_agente=' . $layoutData [ 'id_agent' ] . '&tab=data' ,
null ,
null ,
null ,
$isExternalLink
);
}
}
}
} else {
// Link to a map
if ( empty ( $layoutData [ 'id_metaconsole' ])) {
$url = $config [ 'homeurl' ] . '/index.php?sec=reporting&sec2=operation/visual_console/render_view&pure=' . $config [ 'pure' ] . '&id=' . $layoutData [ 'id_layout_linked' ];
} else {
$pure = get_parameter ( 'pure' , 0 );
$url = $config [ 'homeurl' ] . '/index.php?sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '&id_visualmap=' . $layoutData [ 'id_layout_linked' ] . '&refr=0' ;
}
}
break ;
default :
if ( ! empty ( $element_enterprise )) {
$url = $element_enterprise [ 'url' ];
}
break ;
}
// Override url
if ( is_metaconsole ()
&& ! empty ( $layoutData [ 'id_layout_linked' ])
&& ! empty ( $layoutData [ 'linked_layout_node_id' ])
) {
$url = ui_meta_get_url_console_child (
$layoutData [ 'linked_layout_node_id' ],
'network' ,
'operation/visual_console/render_view&id=' . ( int ) $layoutData [ 'id_layout_linked' ]
);
}
}
// + 1 for to avoid the box and lines items are on the top of
// others
$z_index = ( 1 + 1 );
switch ( $type ) {
case STATIC_GRAPH :
case GROUP_ITEM :
if ( $layoutData [ 'image' ] != null ) {
$img = visual_map_get_image_status_element (
$layoutData ,
$layoutData [ 'status_calculated' ]
);
if ( substr ( $img , 0 , 1 ) == '4' ) {
$borderStyle = 'border: 2px solid ' . COL_ALERTFIRED . ';' ;
$img = substr_replace ( $img , '' , 0 , 1 );
}
}
if ( $status == VISUAL_MAP_STATUS_CRITICAL_BAD ) {
$z_index = ( 3 + 1 );
} else if ( $status == VISUAL_MAP_STATUS_WARNING ) {
$z_index = ( 2 + 1 );
} else if ( $status == VISUAL_MAP_STATUS_CRITICAL_ALERT ) {
$z_index = ( 4 + 1 );
} else {
$z_index = ( 1 + 1 );
}
break ;
case ICON :
if ( $layoutData [ 'image' ] != null ) {
$img = visual_map_get_image_status_element (
$layoutData ,
$layoutData [ 'status_calculated' ]
);
}
if (( $width != 0 ) && ( $height != 0 )) {
$sizeStyle = 'width: ' . $width . 'px; height: ' . $height . 'px;' ;
$imageSize = 'width="' . $width . '" height="' . $height . '"' ;
}
$z_index = ( 4 + 1 );
break ;
case PERCENTILE_BAR :
case PERCENTILE_BUBBLE :
case CIRCULAR_PROGRESS_BAR :
case CIRCULAR_INTERIOR_PROGRESS_BAR :
// Metaconsole db connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$connection = db_get_row_filter (
'tmetaconsole_setup' ,
[ 'id' => $layoutData [ 'id_metaconsole' ]]
);
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
// ui_print_error_message ("Error connecting to ".$server_name);
continue ;
}
}
// data
$module_value = db_get_sql (
' SELECT datos
FROM tagente_estado
WHERE id_agente_modulo = ' . $id_module
);
// state
$module_status = db_get_sql (
' SELECT estado
FROM tagente_estado
WHERE id_agente_modulo = ' . $id_module
);
if ( empty ( $module_value ) || $module_value == 0 ) {
$colorStatus = COL_UNKNOWN ;
} else {
switch ( $module_status ) {
case 0 :
// Normal
$colorStatus = COL_NORMAL ;
break ;
case 1 :
// Critical
$colorStatus = COL_CRITICAL ;
break ;
case 2 :
// Warning
$colorStatus = COL_WARNING ;
break ;
case 4 :
// Not_INIT
$colorStatus = COL_NOTINIT ;
break ;
case 3 :
// Unknown
default :
$colorStatus = COL_UNKNOWN ;
break ;
}
}
$value_text = false ;
if ( $layoutData [ 'image' ] == 'percent' ) {
$value_text = false ;
} else if ( $layoutData [ 'image' ] == 'value' ) {
$unit_text = db_get_sql (
' SELECT unit
FROM tagente_modulo
WHERE id_agente_modulo = ' . $id_module
);
$unit_text = trim ( io_safe_output ( $unit_text ));
$value_text = format_for_graph ( $module_value , 2 );
if ( $value_text <= 0 ) {
$value_text = remove_right_zeros ( number_format ( $module_value , $config [ 'graph_precision' ]));
}
if ( ! empty ( $unit_text )) {
$value_text .= ' ' . $unit_text ;
}
}
// Restore db connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
metaconsole_restore_db ();
}
if ( $max_percentile > 0 ) {
$percentile = format_numeric (( $module_value / $max_percentile * 100 ), 0 );
} else {
$percentile = 100 ;
}
break ;
case MODULE_GRAPH :
$imgpos = '' ;
if ( $layoutData [ 'label_position' ] == 'left' ) {
$imgpos = 'float:right' ;
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
$imgpos = 'float:left' ;
}
if ( ! empty ( $proportion )) {
$width = (( integer ) ( $proportion [ 'proportion_width' ] * $width ));
$height = (( integer ) ( $proportion [ 'proportion_height' ] * $height ));
}
// Metaconsole db connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$connection = db_get_row_filter (
'tmetaconsole_setup' ,
[ 'id' => $layoutData [ 'id_metaconsole' ]]
);
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
// ui_print_error_message ("Error connecting to ".$server_name);
continue ;
}
}
$only_image = ! $graph_javascript && $isExternalLink ;
if ( $layoutData [ 'id_custom_graph' ] != 0 ) {
// Show only avg on the visual console
if ( get_parameter ( 'action' ) == 'edit' ) {
if ( $width == 0 || $height == 0 ) {
$img = '<img src="images/console/signes/custom_graph.png" style="width:300px;height:180px;' . $imgpos . '">' ;
} else {
$img = '<img src="images/console/signes/custom_graph.png" style="width:' . $width . 'px;height:' . $height . 'px;' . $imgpos . '">' ;
}
} else {
if ( $width == 0 ) {
$width = 180 ;
}
if ( $height == 0 ) {
$height = 480 ;
}
$graphs = db_get_all_rows_field_filter ( 'tgraph' , 'id_graph' , $layoutData [ 'id_custom_graph' ]);
$params = [
'period' => $period ,
'width' => $width ,
'height' => $height ,
'title' => '' ,
'unit_name' => null ,
'show_alerts' => false ,
'only_image' => $only_image ,
'vconsole' => true ,
'backgroundColor' => $layoutData [ 'image' ],
];
$params_combined = [
'id_graph' => $layoutData [ 'id_custom_graph' ],
'stacked' => $graphs [ 0 ][ 'stacked' ],
'summatory' => $graphs [ 0 ][ 'summatory_series' ],
'average' => $graphs [ 0 ][ 'average_series' ],
'modules_series' => $graphs [ 0 ][ 'modules_series' ],
];
if ( $layoutData [ 'label_position' ] == 'left' ) {
$img = '<div style="z-index:' . $show_on_top_index . ';float:right;height:' . $himg . 'px;">' . graphic_combined_module (
false ,
$params ,
$params_combined
) . '</div>' ;
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
$img = '<div style="z-index:' . $show_on_top_index . ';float:left;height:' . $himg . 'px;">' . graphic_combined_module (
false ,
$params ,
$params_combined
) . '</div>' ;
} else {
$img = graphic_combined_module (
false ,
$params ,
$params_combined
);
}
}
} else {
if ( $isExternalLink ) {
$homeurl = $config [ 'homeurl' ];
} else {
$homeurl = '' ;
}
if (( get_parameter ( 'action' ) == 'edit' ) || ( get_parameter ( 'operation' ) == 'edit_visualmap' )) {
if ( $width == 0 || $height == 0 ) {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="../../images/console/signes/module_graph.png" style="width:300px;height:180px;' . $imgpos . '">' ;
} else {
$img = '<img src="images/console/signes/module_graph.png" style="width:300px;height:180px;' . $imgpos . '">' ;
}
} else {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="../../images/console/signes/module_graph.png" style="width:' . $width . 'px;height:' . $height . 'px;' . $imgpos . '">' ;
} else {
$img = '<img src="images/console/signes/module_graph.png" style="width:' . $width . 'px;height:' . $height . 'px;' . $imgpos . '">' ;
}
}
} else {
if ( $width == 0 || $height == 0 ) {
$width = 300 ;
$height = 180 ;
}
$params = [
'agent_module_id' => $id_module ,
'period' => $period ,
'show_events' => false ,
'width' => $width ,
'height' => $height ,
'title' => modules_get_agentmodule_name ( $id_module ),
'unit' => modules_get_unit ( $id_module ),
'only_image' => $only_image ,
'menu' => false ,
'backgroundColor' => $layoutData [ 'image' ],
'type_graph' => $type_graph ,
'vconsole' => true ,
];
if ( $layoutData [ 'label_position' ] == 'left' ) {
$img = '<div style="z-index:' . $show_on_top_index . ';float:right;height:' . $himg . 'px;">' . grafico_modulo_sparse ( $params ) . '</div>' ;
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
$img = '<div style="z-index:' . $show_on_top_index . ';float:left;height:' . $himg . 'px;">' . grafico_modulo_sparse ( $params ) . '</div>' ;
} else {
$img = grafico_modulo_sparse ( $params );
}
}
}
// Restore db connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
metaconsole_restore_db ();
}
break ;
case BARS_GRAPH :
$imgpos = '' ;
if ( $layoutData [ 'label_position' ] == 'left' ) {
$imgpos = 'float:right' ;
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
$imgpos = 'float:left' ;
}
if ( ! empty ( $proportion )) {
$width = (( integer ) ( $proportion [ 'proportion_width' ] * $width ));
$height = (( integer ) ( $proportion [ 'proportion_height' ] * $height ));
}
// Metaconsole db connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$connection = db_get_row_filter (
'tmetaconsole_setup' ,
[ 'id' => $layoutData [ 'id_metaconsole' ]]
);
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
continue ;
}
}
if ( $isExternalLink ) {
$homeurl = $config [ 'homeurl' ];
} else {
$homeurl = '' ;
}
$is_string = db_get_value_filter (
'id_tipo_modulo' ,
'tagente_modulo' ,
[
'id_agente' => $layoutData [ 'id_agent' ],
'id_agente_modulo' => $id_module ,
]
);
if (( get_parameter ( 'action' ) == 'edit' ) || ( get_parameter ( 'operation' ) == 'edit_visualmap' )) {
if ( $width == 0 ) {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="../../images/console/signes/barras.png" style="width:400px;height:400px;' . $imgpos . '">' ;
} else {
$img = '<img src="images/console/signes/barras.png" style="width:400px;height:400px;' . $imgpos . '">' ;
}
} else {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="../../images/console/signes/barras.png" style="width:' . $width . 'px;height:' . $height . 'px;' . $imgpos . '">' ;
} else {
$img = '<img src="images/console/signes/barras.png" style="width:' . $width . 'px;height:' . $height . 'px;' . $imgpos . '">' ;
}
}
} else {
$color = [];
$color [ 0 ] = [
'border' => '#000000' ,
'color' => $config [ 'graph_color1' ],
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 1 ] = [
'border' => '#000000' ,
'color' => $config [ 'graph_color2' ],
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 2 ] = [
'border' => '#000000' ,
'color' => $config [ 'graph_color3' ],
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 3 ] = [
'border' => '#000000' ,
'color' => $config [ 'graph_color4' ],
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 4 ] = [
'border' => '#000000' ,
'color' => $config [ 'graph_color5' ],
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 5 ] = [
'border' => '#000000' ,
'color' => $config [ 'graph_color6' ],
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 6 ] = [
'border' => '#000000' ,
'color' => $config [ 'graph_color7' ],
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 7 ] = [
'border' => '#000000' ,
'color' => $config [ 'graph_color8' ],
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 8 ] = [
'border' => '#000000' ,
'color' => $config [ 'graph_color9' ],
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 9 ] = [
'border' => '#000000' ,
'color' => $config [ 'graph_color10' ],
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 11 ] = [
'border' => '#000000' ,
'color' => COL_GRAPH9 ,
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 12 ] = [
'border' => '#000000' ,
'color' => COL_GRAPH10 ,
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 13 ] = [
'border' => '#000000' ,
'color' => COL_GRAPH11 ,
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 14 ] = [
'border' => '#000000' ,
'color' => COL_GRAPH12 ,
'alpha' => CHART_DEFAULT_ALPHA ,
];
$color [ 15 ] = [
'border' => '#000000' ,
'color' => COL_GRAPH13 ,
'alpha' => CHART_DEFAULT_ALPHA ,
];
$module_data = get_bars_module_data ( $id_module );
$water_mark = [
'file' => '/var/www/html/pandora_console/images/logo_vertical_water.png' ,
'url' => 'http://localhost/pandora_console/images/logo_vertical_water.png' ,
];
if ( $width == 0 && $height == 0 ) {
if ( $layoutData [ 'label_position' ] == 'left' ) {
if ( $layoutData [ 'type_graph' ] == 'horizontal' ) {
$img = '<div style="float:right;height:' . $himg . 'px;">' . hbar_graph (
$module_data ,
400 ,
400 ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
$layoutData [ 'border_color' ]
) . '</div>' ;
} else {
$img = '<div style="float:right;height:' . $himg . 'px;">' . vbar_graph (
$module_data ,
400 ,
400 ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
true ,
false ,
$layoutData [ 'border_color' ]
) . '</div>' ;
}
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
if ( $layoutData [ 'type_graph' ] == 'horizontal' ) {
$img = '<div style="float:left;height:' . $himg . 'px;">' . hbar_graph (
$module_data ,
400 ,
400 ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
$layoutData [ 'border_color' ]
) . '</div>' ;
} else {
$img = '<div style="float:left;height:' . $himg . 'px;">' . vbar_graph (
$module_data ,
400 ,
400 ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
true ,
false ,
$layoutData [ 'border_color' ]
) . '</div>' ;
}
} else {
if ( $layoutData [ 'type_graph' ] == 'horizontal' ) {
$img = hbar_graph (
$module_data ,
400 ,
400 ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
$layoutData [ 'border_color' ]
);
} else {
$img = vbar_graph (
$module_data ,
400 ,
400 ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
true ,
false ,
$layoutData [ 'border_color' ]
);
}
}
} else {
if ( $layoutData [ 'label_position' ] == 'left' ) {
if ( $layoutData [ 'type_graph' ] == 'horizontal' ) {
$img = '<div style="float:right;height:' . $himg . 'px;">' . hbar_graph (
$module_data ,
$width ,
$height ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
$layoutData [ 'border_color' ]
) . '</div>' ;
} else {
$img = '<div style="float:right;height:' . $himg . 'px;">' . vbar_graph (
$module_data ,
$width ,
$height ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
true ,
false ,
$layoutData [ 'border_color' ]
) . '</div>' ;
}
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
if ( $layoutData [ 'type_graph' ] == 'horizontal' ) {
$img = '<div style="float:left;height:' . $himg . 'px;">' . hbar_graph (
$module_data ,
$width ,
$height ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
$layoutData [ 'border_color' ]
) . '</div>' ;
} else {
$img = '<div style="float:left;height:' . $himg . 'px;">' . vbar_graph (
$module_data ,
$width ,
$height ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
true ,
false ,
$layoutData [ 'border_color' ]
) . '</div>' ;
}
} else {
if ( $layoutData [ 'type_graph' ] == 'horizontal' ) {
$img = hbar_graph (
$module_data ,
$width ,
$height ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
$layoutData [ 'border_color' ]
);
} else {
$img = vbar_graph (
$module_data ,
$width ,
$height ,
$color ,
[],
[],
ui_get_full_url ( 'images/image_problem_area.png' , false , false , false ),
'' ,
'' ,
$water_mark ,
$config [ 'fontpath' ],
6 ,
'' ,
0 ,
$config [ 'homeurl' ],
$layoutData [ 'image' ],
true ,
false ,
$layoutData [ 'border_color' ]
);
}
}
}
}
// Restore db connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
metaconsole_restore_db ();
}
break ;
case DONUT_GRAPH :
if ( ! empty ( $id_metaconsole )) {
$connection = db_get_row_filter ( 'tmetaconsole_setup' , $id_metaconsole );
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
continue ;
}
}
$is_string = db_get_value_filter (
'id_tipo_modulo' ,
'tagente_modulo' ,
[
'id_agente' => $layoutData [ 'id_agent' ],
'id_agente_modulo' => $id_module ,
]
);
if ( ! empty ( $id_metaconsole )) {
metaconsole_restore_db ();
}
if (( $is_string == 17 ) || ( $is_string == 23 ) || ( $is_string == 3 )
|| ( $is_string == 10 ) || ( $is_string == 33 )
) {
$no_data = false ;
} else {
$no_data = true ;
}
if ( $no_data ) {
if ( $width == 0 ) {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="../../images/console/signes/wrong_donut_graph.png">' ;
} else {
$img = '<img src="images/console/signes/wrong_donut_graph.png">' ;
}
} else {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="../../images/console/signes/wrong_donut_graph.png" style="width:' . $width . 'px;height:' . $height . 'px;">' ;
} else {
$img = '<img src="images/console/signes/wrong_donut_graph.png" style="width:' . $width . 'px;height:' . $height . 'px;">' ;
}
}
} else {
$donut_data = get_donut_module_data ( $layoutData [ 'id_agente_modulo' ]);
if (( get_parameter ( 'action' ) == 'edit' ) || ( get_parameter ( 'operation' ) == 'edit_visualmap' )) {
if ( $width == 0 ) {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="../../images/console/signes/donut-graph.png">' ;
} else {
$img = '<img src="images/console/signes/donut-graph.png">' ;
}
} else {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="../../images/console/signes/donut-graph.png" style="width:' . $width . 'px;height:' . $height . 'px;">' ;
} else {
$img = '<img src="images/console/signes/donut-graph.png" style="width:' . $width . 'px;height:' . $height . 'px;">' ;
}
}
} else {
if ( $width == 0 ) {
$img = d3_donut_graph ( $layoutData [ 'id' ], 300 , 300 , $donut_data , $layoutData [ 'border_color' ]);
} else {
$img = d3_donut_graph ( $layoutData [ 'id' ], $width , $width , $donut_data , $layoutData [ 'border_color' ]);
}
}
}
// Restore db connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
metaconsole_restore_db ();
}
$z_index = ( 2 + 1 );
break ;
case LABEL :
$z_index = ( 4 + 1 );
break ;
case BOX_ITEM :
$z_index = 1 ;
break ;
case CLOCK :
if (( get_parameter ( 'action' ) == 'edit' ) || ( get_parameter ( 'operation' ) == 'edit_visualmap' )) {
if ( $width == 0 ) {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
if ( $layoutData [ 'clock_animation' ] == 'analogic_1' ) {
$img = '<img src="../../images/console/signes/clock.png" style="width:200px;height:240px;">' ;
} else {
if ( $layoutData [ 'time_format' ] = 'time' ) {
$img = '<img src="../../images/console/signes/digital-clock.png" style="width:200px;height:71px;">' ;
} else {
$img = '<img src="../../images/console/signes/digital-clock.png" style="width:200px;height:91px;">' ;
}
}
} else {
if ( $layoutData [ 'clock_animation' ] == 'analogic_1' ) {
$img = '<img src="images/console/signes/clock.png" style="width:200px;height:240px;">' ;
} else {
if ( $layoutData [ 'time_format' ] == 'time' ) {
$img = '<img src="images/console/signes/digital-clock.png" style="width:200px;height:71px">' ;
} else {
$img = '<img src="images/console/signes/digital-clock.png" style="width:200px;height:91px">' ;
}
}
}
} else {
$image_prefix = ( $layoutData [ 'id_metaconsole' ] != 0 ) ? '../../' : '' ;
if ( $layoutData [ 'clock_animation' ] == 'analogic_1' ) {
$img = '<img src="' . $image_prefix . 'images/console/signes/clock.png" style="width:' . $width . 'px;height:' . ( $width + 40 ) . 'px;">' ;
} else {
$height_offset = ( $layoutData [ 'time_format' ] == 'time' ) ? 20 : 40 ;
$img = '<img src="' . $image_prefix . 'images/console/signes/digital-clock.png" style="width:' . $width . 'px;height:' . (( $width / 3.9 ) + $height_offset ) . 'px;">' ;
}
}
} else {
if ( $layoutData [ 'clock_animation' ] == 'analogic_1' ) {
if ( $layoutData [ 'label_position' ] == 'left' ) {
$img = '<div id="clock_' . $layoutData [ 'id' ] . '" style="z-index:' . $show_on_top_index . ';float:right;height:' . $himg . 'px;margin-bottom:15px;">' . print_clock_analogic_1 ( $layoutData [ 'time_format' ], $layoutData [ 'timezone' ], $layoutData [ 'clock_animation' ], $layoutData [ 'width' ], $layoutData [ 'height' ], $layoutData [ 'id' ], $layoutData [ 'fill_color' ]) . '</div>' ;
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
$img = '<div id="clock_' . $layoutData [ 'id' ] . '" style="z-index:' . $show_on_top_index . ';float:left;height:' . $himg . 'px;margin-bottom:15px;">' . print_clock_analogic_1 ( $layoutData [ 'time_format' ], $layoutData [ 'timezone' ], $layoutData [ 'clock_animation' ], $layoutData [ 'width' ], $layoutData [ 'height' ], $layoutData [ 'id' ], $layoutData [ 'fill_color' ]) . '</div>' ;
} else {
$img = '<div id="clock_' . $layoutData [ 'id' ] . '" style="z-index:' . $show_on_top_index . ';height:' . $himg . 'px;margin-bottom:15px;">' . print_clock_analogic_1 ( $layoutData [ 'time_format' ], $layoutData [ 'timezone' ], $layoutData [ 'clock_animation' ], $layoutData [ 'width' ], $layoutData [ 'height' ], $layoutData [ 'id' ], $layoutData [ 'fill_color' ]) . '</div>' ;
}
} else if ( $layoutData [ 'clock_animation' ] == 'digital_1' ) {
if ( $layoutData [ 'label_position' ] == 'left' ) {
$img = '<div id="clock_' . $layoutData [ 'id' ] . '" style="z-index:' . $show_on_top_index . ';float:right;height:' . $himg . 'px;">' . print_clock_digital_1 ( $layoutData [ 'time_format' ], $layoutData [ 'timezone' ], $layoutData [ 'clock_animation' ], $layoutData [ 'width' ], $layoutData [ 'height' ], $layoutData [ 'id' ], $layoutData [ 'fill_color' ]) . '</div>' ;
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
$img = '<div id="clock_' . $layoutData [ 'id' ] . '" style="z-index:' . $show_on_top_index . ';float:left;height:' . $himg . 'px;">' . print_clock_digital_1 ( $layoutData [ 'time_format' ], $layoutData [ 'timezone' ], $layoutData [ 'clock_animation' ], $layoutData [ 'width' ], $layoutData [ 'height' ], $layoutData [ 'id' ], $layoutData [ 'fill_color' ]) . '</div>' ;
} else {
$img = '<div id="clock_' . $layoutData [ 'id' ] . '" style="z-index:' . $show_on_top_index . ';height:' . $himg . 'px;">' . print_clock_digital_1 ( $layoutData [ 'time_format' ], $layoutData [ 'timezone' ], $layoutData [ 'clock_animation' ], $layoutData [ 'width' ], $layoutData [ 'height' ], $layoutData [ 'id' ], $layoutData [ 'fill_color' ]) . '</div>' ;
}
}
}
break ;
case AUTO_SLA_GRAPH :
if (( get_parameter ( 'action' ) == 'edit' ) || ( get_parameter ( 'operation' ) == 'edit_visualmap' )) {
if ( $width == 0 || $height == 0 ) {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="../../images/console/signes/module-events.png">' ;
} else {
$img = '<img src="images/console/signes/module-events.png">' ;
}
} else {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="../../images/console/signes/module-events.png" style="width:' . $width . 'px;height:' . $height . 'px;">' ;
} else {
$img = '<img src="images/console/signes/module-events.png" style="width:' . $width . 'px;height:' . $height . 'px;">' ;
}
}
} else {
if ( $width == 0 || $height == 0 ) {
if ( $layoutData [ 'label_position' ] == 'left' ) {
$img = '<div style="z-index:' . $show_on_top_index . ';float:left;height:' . $himg . 'px;width:500px;">' . graph_graphic_moduleevents ( $layoutData [ 'id_agent' ], $layoutData [ 'id_agente_modulo' ], 500 , 50 , $layoutData [ 'period' ], '' , true ) . '</div>' ;
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
$img = '<div style="z-index:' . $show_on_top_index . ';float:right;height:' . $himg . 'px;width:500px;">' . graph_graphic_moduleevents ( $layoutData [ 'id_agent' ], $layoutData [ 'id_agente_modulo' ], 500 , 50 , $layoutData [ 'period' ], '' , true ) . '</div>' ;
} else {
$img = '<div style="width:500px;">' . graph_graphic_moduleevents ( $layoutData [ 'id_agent' ], $layoutData [ 'id_agente_modulo' ], 500 , 50 , $layoutData [ 'period' ], '' , true ) . '</div>' ;
}
} else {
if ( $layoutData [ 'label_position' ] == 'left' ) {
$img = '<div style="z-index:' . $show_on_top_index . ';float:left;height:' . $himg . 'px;width:500px;">' . graph_graphic_moduleevents ( $layoutData [ 'id_agent' ], $layoutData [ 'id_agente_modulo' ], $width , $height , $layoutData [ 'period' ], '' , true ) . '</div>' ;
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
$img = '<div style="z-index:' . $show_on_top_index . ';float:right;height:' . $himg . 'px;width:500px;">' . graph_graphic_moduleevents ( $layoutData [ 'id_agent' ], $layoutData [ 'id_agente_modulo' ], $width , $height , $layoutData [ 'period' ], '' , true ) . '</div>' ;
} else {
$img = '<div style="width:500px;">' . graph_graphic_moduleevents ( $layoutData [ 'id_agent' ], $layoutData [ 'id_agente_modulo' ], $width , $height , $layoutData [ 'period' ], '' , true ) . '</div>' ;
}
}
}
// Restore db connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
metaconsole_restore_db ();
}
$z_index = ( 2 + 1 );
break ;
}
$class = 'item ' ;
switch ( $type ) {
case STATIC_GRAPH :
$class .= 'static_graph' ;
break ;
case AUTO_SLA_GRAPH :
$class .= 'auto_sla_graph' ;
break ;
case GROUP_ITEM :
$class .= 'group_item' ;
break ;
case DONUT_GRAPH :
$class .= 'donut_graph' ;
break ;
case PERCENTILE_BAR :
case PERCENTILE_BUBBLE :
case CIRCULAR_PROGRESS_BAR :
case CIRCULAR_INTERIOR_PROGRESS_BAR :
$class .= 'percentile_item' ;
break ;
case MODULE_GRAPH :
$class .= 'module_graph' ;
break ;
case BARS_GRAPH :
$class .= 'bars_graph' ;
break ;
case SIMPLE_VALUE :
case SIMPLE_VALUE_MAX :
case SIMPLE_VALUE_MIN :
case SIMPLE_VALUE_AVG :
$class .= 'simple_value' ;
break ;
case LABEL :
$class .= 'label' ;
break ;
case ICON :
$class .= 'icon' ;
break ;
case CLOCK :
$class .= 'clock' ;
break ;
case BOX_ITEM :
$class .= 'box_item' ;
break ;
case COLOR_CLOUD :
$class .= 'color_cloud' ;
break ;
default :
if ( ! empty ( $element_enterprise )) {
$class .= $element_enterprise [ 'class' ];
}
break ;
}
if ( $show_on_top ) {
$z_index = 10 ;
}
echo '<div id="' . $id . '" class="' . $class . '" ' . 'style="z-index: ' . $z_index . ';' . 'position: absolute; ' . 'top: ' . $top . 'px; ' . 'left: ' . $left . 'px;' . 'display: inline-block; ' . $sizeStyle . '">' ;
if ( $link ) {
echo " <a href= \" $url\ " > " ;
}
// for clean link text from bbdd only edit_visualmap
2017-11-20 10:37:07 +01:00
if ( get_parameter ( 'action' ) == 'edit' || get_parameter ( 'operation' ) == 'edit_visualmap' ) {
2019-01-30 16:18:44 +01:00
$text = preg_replace ( '/<\/*a.*?>/' , '' , $text );
2017-11-20 10:37:07 +01:00
}
2019-01-30 16:18:44 +01:00
switch ( $type ) {
case BOX_ITEM :
if ( $width == 0 || $width == 0 ) {
$style = '' ;
$style .= 'width: 300px; ' ;
$style .= 'height: 180px; ' ;
$style .= 'border-style: solid; ' ;
$style .= 'border-width: ' . $border_width . 'px; ' ;
$style .= 'border-color: ' . $border_color . '; ' ;
$style .= 'background-color: ' . $fill_color . '; ' ;
echo " <div style='z-index: " . $show_on_top_index . ';' . $style . " '></div> " ;
} else {
if ( ! empty ( $proportion )) {
$style = '' ;
$style .= 'width: ' . ( $width * $proportion [ 'proportion_width' ]) . 'px; ' ;
$style .= 'height: ' . ( $height * $proportion [ 'proportion_height' ]) . 'px; ' ;
$style .= 'border-style: solid; ' ;
$style .= 'border-width: ' . $border_width . 'px; ' ;
$style .= 'border-color: ' . $border_color . '; ' ;
$style .= 'background-color: ' . $fill_color . '; ' ;
echo " <div style='z-index: " . $show_on_top_index . ';' . $style . " '></div> " ;
} else {
$style = '' ;
$style .= 'width: ' . $width . 'px; ' ;
$style .= 'height: ' . $height . 'px; ' ;
$style .= 'border-style: solid; ' ;
$style .= 'border-width: ' . $border_width . 'px; ' ;
$style .= 'border-color: ' . $border_color . '; ' ;
$style .= 'background-color: ' . $fill_color . '; ' ;
echo " <div style='z-index: " . $show_on_top_index . ';' . $style . " '></div> " ;
}
}
break ;
case STATIC_GRAPH :
case GROUP_ITEM :
if (( $layoutData [ 'image' ] != null && $layoutData [ 'image' ] != 'none' ) || $layoutData [ 'show_statistics' ] == 1 ) {
$img_style_title = strip_tags ( $label );
if ( $layoutData [ 'type' ] == STATIC_GRAPH ) {
if ( $layoutData [ 'id_agente_modulo' ] != 0 ) {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
// Metaconsole db connection
$connection = db_get_row_filter (
'tmetaconsole_setup' ,
[ 'id' => $layoutData [ 'id_metaconsole' ]]
);
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
continue ;
}
}
$unit_text = trim (
io_safe_output (
modules_get_unit ( $layoutData [ 'id_agente_modulo' ])
)
);
$value = modules_get_last_value (
$layoutData [ 'id_agente_modulo' ]
);
if ( ! is_string ( $value )) {
$value = format_for_graph ( $value , 2 );
}
// Hide value on boolean modules
if ( $layoutData [ 'show_last_value' ] != 2 ) {
if (( ! modules_is_boolean ( $layoutData [ 'id_agente_modulo' ]))
|| ( modules_is_boolean ( $layoutData [ 'id_agente_modulo' ]) && $layoutData [ 'show_last_value' ] != 0 )
) {
if ( is_numeric ( $value )) {
$img_style_title .= ' <br>' . __ ( 'Last value: ' ) . remove_right_zeros ( number_format ( $value , $config [ 'graph_precision' ]));
} else {
$img_style_title .= ' <br>' . __ ( 'Last value: ' ) . $value ;
}
}
}
if ( ! empty ( $unit_text )) {
$img_style_title .= ' ' . $unit_text ;
}
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
// Restore db connection
metaconsole_restore_db ();
}
}
if ( get_parameter ( 'action' ) == 'edit' ) {
$img_style_title = '' ;
}
}
if ( ! empty ( $proportion )) {
if ( is_file ( $config [ 'homedir' ] . '/' . $img )) {
$infoImage = getimagesize ( $config [ 'homedir' ] . '/' . $img );
}
if ( $height == 0 || $height == 0 ) {
$height = '70px' ;
$width = '70px' ;
} else {
$height = ( integer ) ( $proportion [ 'proportion_height' ] * $height );
$width = ( integer ) ( $proportion [ 'proportion_width' ] * $width );
}
}
$imgpos = '' ;
if ( $layoutData [ 'label_position' ] == 'up' ) {
echo io_safe_output ( $text );
}
if ( $layoutData [ 'label_position' ] == 'left' ) {
$imgpos = 'float:right' ;
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
$imgpos = 'float:left' ;
}
$varsize = getimagesize ( $config [ 'homedir' ] . '/' . $img );
if ( $layoutData [ 'show_statistics' ] == 1 ) {
if ( get_parameter ( 'action' ) == 'edit' ) {
if ( $width == 0 || $height == 0 ) {
echo '<img id="image_' . $id . '" src="images/console/signes/group_status.png" style="width:520px;height:80px;' . $imgpos . '">' ;
} else {
echo '<img id="image_' . $id . '" src="images/console/signes/group_status.png" style="width:' . $width . 'px;height:' . $height . 'px;' . $imgpos . '">' ;
}
} else {
$agents_critical = agents_get_agents (
[
'disabled' => 0 ,
'id_grupo' => $layoutData [ 'id_group' ],
'status' => AGENT_STATUS_CRITICAL ,
],
[ 'COUNT(*) as total' ],
'AR' ,
false
);
$agents_warning = agents_get_agents (
[
'disabled' => 0 ,
'id_grupo' => $layoutData [ 'id_group' ],
'status' => AGENT_STATUS_WARNING ,
],
[ 'COUNT(*) as total' ],
'AR' ,
false
);
$agents_unknown = agents_get_agents (
[
'disabled' => 0 ,
'id_grupo' => $layoutData [ 'id_group' ],
'status' => AGENT_STATUS_UNKNOWN ,
],
[ 'COUNT(*) as total' ],
'AR' ,
false
);
$agents_ok = agents_get_agents (
[
'disabled' => 0 ,
'id_grupo' => $layoutData [ 'id_group' ],
'status' => AGENT_STATUS_OK ,
],
[ 'COUNT(*) as total' ],
'AR' ,
false
);
$total_agents = ( $agents_critical [ 0 ][ 'total' ] + $agents_warning [ 0 ][ 'total' ] + $agents_unknown [ 0 ][ 'total' ] + $agents_ok [ 0 ][ 'total' ]);
$stat_agent_ok = ( $agents_ok [ 0 ][ 'total' ] / $total_agents * 100 );
$stat_agent_wa = ( $agents_warning [ 0 ][ 'total' ] / $total_agents * 100 );
$stat_agent_cr = ( $agents_critical [ 0 ][ 'total' ] / $total_agents * 100 );
$stat_agent_un = ( $agents_unknown [ 0 ][ 'total' ] / $total_agents * 100 );
if ( $width == 0 || $height == 0 ) {
$dyn_width = 520 ;
$dyn_height = 80 ;
} else {
$dyn_width = $width ;
$dyn_height = $height ;
}
echo '<table cellpadding="0" cellspacing="0" border="0" class="databox" style="width:' . $dyn_width . 'px;height:' . $dyn_height . 'px;text-align:center;' ;
if ( $layoutData [ 'label_position' ] == 'left' ) {
echo 'float:right;' ;
} else if ( $layoutData [ 'label_position' ] == 'right' ) {
echo 'float:left;' ;
}
echo '">' ;
echo " <tr style='height:10%;'> " ;
echo " <th style='text-align:center;background-color:#9d9ea0;color:black;font-weight:bold;'> " . groups_get_name ( $layoutData [ 'id_group' ], true ) . '</th>' ;
echo '</tr>' ;
echo " <tr style='background-color:whitesmoke;height:90%;'> " ;
echo '<td>' ;
echo " <div style='margin-left:2%;color: #FFF;font-size: 12px;display:inline;background-color:#FC4444;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'> " . remove_right_zeros ( number_format ( $stat_agent_cr , 2 )) . '%</div>' ;
echo " <div style='background-color:white;color: black ;font-size: 12px;display:inline;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'>Critical</div> " ;
echo " <div style='margin-left:2%;color: #FFF;font-size: 12px;display:inline;background-color:#f8db3f;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'> " . remove_right_zeros ( number_format ( $stat_agent_wa , 2 )) . '%</div>' ;
echo " <div style='background-color:white;color: black ;font-size: 12px;display:inline;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'>Warning</div> " ;
echo " <div style='margin-left:2%;color: #FFF;font-size: 12px;display:inline;background-color:#84b83c;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'> " . remove_right_zeros ( number_format ( $stat_agent_ok , 2 )) . '%</div>' ;
echo " <div style='background-color:white;color: black ;font-size: 12px;display:inline;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'>Normal</div> " ;
echo " <div style='margin-left:2%;color: #FFF;font-size: 12px;display:inline;background-color:#9d9ea0;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'> " . remove_right_zeros ( number_format ( $stat_agent_un , 2 )) . '%</div>' ;
echo " <div style='background-color:white;color: black ;font-size: 12px;display:inline;position:relative;height:80%;width:9.4%;height:80%;border-radius:2px;text-align:center;padding:5px;'>Unknown</div> " ;
echo '</td>' ;
echo '</tr>' ;
echo '</table>' ;
}
} else {
$options = [
'class' => 'image' ,
'id' => 'image_' . $id ,
'title' => $img_style_title ,
'style' => $borderStyle . $imgpos ,
];
if ( $width == 0 || $height == 0 ) {
if ( $varsize [ 0 ] > 150 || $varsize [ 1 ] > 150 ) {
$options [ 'width' ] = '70px' ;
$options [ 'height' ] = '70px' ;
}
} else {
$options [ 'width' ] = $width ;
$options [ 'height' ] = $height ;
}
echo html_print_image (
$img ,
true ,
$options ,
false ,
false ,
false ,
$isExternalLink
);
}
}
if ( $layoutData [ 'label_position' ] != 'up' ) {
echo io_safe_output ( $text );
}
if ( is_metaconsole ()) {
metaconsole_restore_db ();
}
break ;
case PERCENTILE_BAR :
if (( $layoutData [ 'image' ] == 'value' ) && ( $value_text !== false )) {
$unit_text = db_get_sql (
' SELECT unit
FROM tagente_modulo
WHERE id_agente_modulo = ' . $id_module
);
$unit_text = trim ( io_safe_output ( $unit_text ));
$percentile = $value_text ;
} else {
$unit_text = '%' ;
}
if ( get_parameter ( 'action' ) == 'edit' || ( get_parameter ( 'operation' ) == 'edit_visualmap' )) {
if ( $width == 0 ) {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="' . '../../' . 'images/console/signes/percentil.png" style="width:130px;height:30px;' . $imgpos . '">' ;
} else {
$img = '<img src="images/console/signes/percentil.png" style="width:130px;height:30px;' . $imgpos . '">' ;
}
} else {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="' . '../../' . '/images/console/signes/percentil.png" style="width:' . $width . 'px;height:30px;' . $imgpos . '">' ;
} else {
$img = '<img src="images/console/signes/percentil.png" style="width:' . $width . 'px;height:30px;' . $imgpos . '">' ;
}
}
} else {
$img = d3_progress_bar ( $id , $percentile , $width , 50 , $border_color , $unit_text , io_safe_output ( $label ), $fill_color );
}
echo $img ;
if ( get_parameter ( 'tab' ) == 'editor' ) {
echo " <span style='color: " . $fill_color . " ;'> " . io_safe_output ( $text ) . '</span>' ;
}
break ;
case PERCENTILE_BUBBLE :
if (( $layoutData [ 'image' ] == 'value' ) && ( $value_text !== false )) {
$unit_text = db_get_sql (
' SELECT unit
FROM tagente_modulo
WHERE id_agente_modulo = ' . $id_module
);
$unit_text = trim ( io_safe_output ( $unit_text ));
$percentile = $value_text ;
} else {
$unit_text = '%' ;
}
if ( get_parameter ( 'action' ) == 'edit' || ( get_parameter ( 'operation' ) == 'edit_visualmap' )) {
if ( $width == 0 ) {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="' . '../../' . 'images/console/signes/percentil_bubble.png">' ;
} else {
$img = '<img src="images/console/signes/percentil_bubble.png">' ;
}
} else {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="' . '../../' . '/images/console/signes/percentil_bubble.png" style="width:' . $width . 'px;height:' . $width . 'px;' . $imgpos . '">' ;
} else {
$img = '<img src="images/console/signes/percentil_bubble.png" style="width:' . $width . 'px;height:' . $width . 'px;' . $imgpos . '">' ;
}
}
} else {
if ( $width == 0 ) {
$img = d3_progress_bubble ( $id , $percentile , 200 , 200 , $border_color , $unit_text , io_safe_output ( $label ), $fill_color );
} else {
$img = d3_progress_bubble ( $id , $percentile , $width , $width , $border_color , $unit_text , io_safe_output ( $label ), $fill_color );
}
}
echo $img ;
if ( get_parameter ( 'tab' ) == 'editor' ) {
echo " <span style='color: " . $fill_color . " ;'> " . io_safe_output ( $text ) . '</span>' ;
}
break ;
case CIRCULAR_PROGRESS_BAR :
if ( get_parameter ( 'action' ) == 'edit' || ( get_parameter ( 'operation' ) == 'edit_visualmap' )) {
if ( $width == 0 ) {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="' . '../../' . 'images/console/signes/circular-progress-bar.png">' ;
} else {
$img = '<img src="images/console/signes/circular-progress-bar.png">' ;
}
} else {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="' . '../../' . '/images/console/signes/circular-progress-bar.png" style="width:' . $width . 'px;height:' . $width . 'px;' . $imgpos . '">' ;
} else {
$img = '<img src="images/console/signes/circular-progress-bar.png" style="width:' . $width . 'px;height:' . $width . 'px;' . $imgpos . '">' ;
}
}
} else {
if (( $layoutData [ 'image' ] == 'value' ) && ( $value_text !== false )) {
$unit_text = db_get_sql (
' SELECT unit
FROM tagente_modulo
WHERE id_agente_modulo = ' . $id_module
);
$unit_text = trim ( io_safe_output ( $unit_text ));
$percentile = $value_text ;
} else {
$unit_text = '%' ;
}
if ( $width == 0 ) {
$img = progress_circular_bar ( $id , $percentile , 200 , 200 , $border_color , $unit_text , io_safe_output ( $label ), $fill_color );
} else {
$img = progress_circular_bar ( $id , $percentile , $width , $width , $border_color , $unit_text , io_safe_output ( $label ), $fill_color );
}
}
echo $img ;
if ( get_parameter ( 'tab' ) == 'editor' ) {
echo " <span style='color: " . $fill_color . " ;'> " . io_safe_output ( $text ) . '</span>' ;
}
break ;
case CIRCULAR_INTERIOR_PROGRESS_BAR :
if ( get_parameter ( 'action' ) == 'edit' || ( get_parameter ( 'operation' ) == 'edit_visualmap' )) {
if ( $width == 0 ) {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="' . '../../' . 'images/console/signes/circular-progress-bar-interior.png">' ;
} else {
$img = '<img src="images/console/signes/circular-progress-bar-interior.png">' ;
}
} else {
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$img = '<img src="' . '../../' . '/images/console/signes/circular-progress-bar-interior.png" style="width:' . $width . 'px;height:' . $width . 'px;' . $imgpos . '">' ;
} else {
$img = '<img src="images/console/signes/circular-progress-bar-interior.png" style="width:' . $width . 'px;height:' . $width . 'px;' . $imgpos . '">' ;
}
}
} else {
if (( $layoutData [ 'image' ] == 'value' ) && ( $value_text !== false )) {
$unit_text = db_get_sql (
' SELECT unit
FROM tagente_modulo
WHERE id_agente_modulo = ' . $id_module
);
$unit_text = trim ( io_safe_output ( $unit_text ));
$percentile = $value_text ;
} else {
$unit_text = '%' ;
}
if ( $width == 0 ) {
$img = progress_circular_bar_interior ( $id , $percentile , 200 , 200 , $border_color , $unit_text , io_safe_output ( $label ), $fill_color );
} else {
$img = progress_circular_bar_interior ( $id , $percentile , $width , $width , $border_color , $unit_text , io_safe_output ( $label ), $fill_color );
}
}
echo $img ;
if ( get_parameter ( 'tab' ) == 'editor' ) {
echo " <span style='color: " . $fill_color . " ;'> " . io_safe_output ( $text ) . '</span>' ;
}
break ;
case MODULE_GRAPH :
if ( $layoutData [ 'label_position' ] == 'up' ) {
echo io_safe_output ( $text );
}
echo $img ;
if ( $layoutData [ 'label_position' ] == 'down' ) {
echo io_safe_output ( $text );
} else if ( $layoutData [ 'label_position' ] == 'left' || $layoutData [ 'label_position' ] == 'right' ) {
echo io_safe_output ( $text );
}
break ;
case CLOCK :
if ( $layoutData [ 'label_position' ] == 'up' ) {
echo io_safe_output ( $text );
}
echo $img ;
if ( $layoutData [ 'label_position' ] == 'down' ) {
echo io_safe_output ( $text );
} else if ( $layoutData [ 'label_position' ] == 'left' || $layoutData [ 'label_position' ] == 'right' ) {
echo io_safe_output ( $text );
}
break ;
case BARS_GRAPH :
if ( $layoutData [ 'label_position' ] == 'up' ) {
echo io_safe_output ( $text );
}
echo $img ;
if ( $layoutData [ 'label_position' ] == 'down' ) {
echo io_safe_output ( $text );
} else if ( $layoutData [ 'label_position' ] == 'left' || $layoutData [ 'label_position' ] == 'right' ) {
echo io_safe_output ( $text );
}
break ;
case AUTO_SLA_GRAPH :
if ( $layoutData [ 'label_position' ] == 'up' ) {
echo io_safe_output ( $text );
}
echo $img ;
if ( $layoutData [ 'label_position' ] == 'down' ) {
echo io_safe_output ( $text );
} else if ( $layoutData [ 'label_position' ] == 'left' || $layoutData [ 'label_position' ] == 'right' ) {
echo io_safe_output ( $text );
}
break ;
case DONUT_GRAPH :
echo $img ;
break ;
case SIMPLE_VALUE :
case SIMPLE_VALUE_MAX :
case SIMPLE_VALUE_MIN :
case SIMPLE_VALUE_AVG :
$io_safe_output_text = io_safe_output ( $text );
// Metaconsole db connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
$connection = db_get_row_filter (
'tmetaconsole_setup' ,
[ 'id' => $layoutData [ 'id_metaconsole' ]]
);
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
// ui_print_error_message ("Error connecting to ".$server_name);
continue ;
}
}
$unit_text = db_get_sql (
' SELECT unit
FROM tagente_modulo
WHERE id_agente_modulo = '.$layoutData[' id_agente_modulo ' ]
);
$unit_text = trim ( io_safe_output ( $unit_text ));
// $value = db_get_value ('datos',
// 'tagente_estado', 'id_agente_modulo', $layoutData['id_agente_modulo']);
$value = visual_map_get_simple_value (
$type ,
$layoutData [ 'id_agente_modulo' ],
$period
);
global $config ;
$is_image = get_if_module_is_image ( $layoutData [ 'id_agente_modulo' ]);
if ( get_parameter ( 'action' ) == 'edit' ) {
if ( ! $is_image ) {
echo $io_safe_output_text ;
} else {
echo " <img style='width: " . $layoutData [ 'width' ] . " px;' src='images/console/signes/data_image.png'> " ;
}
} else {
if ( ! $is_image ) {
$new_text = str_replace ([ '(_VALUE_)' , '(_value_)' ], $value , $io_safe_output_text );
$new_text = str_replace ([ '_VALUE_' , '_value_' ], $value , $new_text );
echo $new_text ;
} else {
$simple_value_img = str_replace ( '>' , ' style="width:' . $layoutData [ 'width' ] . 'px">' , $value );
echo $simple_value_img ;
}
}
// Restore db connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
metaconsole_restore_db ();
}
break ;
case LABEL :
echo io_safe_output ( $text );
break ;
case ICON :
if ( $layoutData [ 'image' ] != null ) {
// If match with protocol://direction
if ( preg_match ( '/^(http:\/\/)((.)+)$/i' , $text )) {
echo '<a href="' . $label . '">' . '</a>' . '<br />' ;
}
if ( ! empty ( $proportion )) {
if ( is_file ( $config [ 'homedir' ] . '/' . $img )) {
$infoImage = getimagesize ( $config [ 'homedir' ] . '/' . $img );
}
if ( $width != 0 ) {
$width = ( integer ) ( $proportion [ 'proportion_width' ] * $width );
} else {
$width = ( integer ) ( $proportion [ 'proportion_width' ] * $infoImage [ 0 ]);
}
if ( $height != 0 ) {
$height = ( integer ) ( $proportion [ 'proportion_height' ] * $height );
} else {
$height = ( integer ) ( $proportion [ 'proportion_height' ] * $infoImage [ 1 ]);
}
}
$varsize = getimagesize ( $img );
if (( $width != 0 ) && ( $height != 0 )) {
echo html_print_image (
$img ,
true ,
[
'class' => 'image' ,
'id' => 'image_' . $id ,
'width' => " $width " ,
'height' => " $height " ,
],
false ,
false ,
false ,
$isExternalLink
);
} else {
if ( $varsize [ 0 ] > 150 || $varsize [ 0 ] > 150 ) {
echo html_print_image (
$img ,
true ,
[
'class' => 'image' ,
'id' => 'image_' . $id ,
'width' => '70px' ,
'70px' => " $height " ,
],
false ,
false ,
false ,
$isExternalLink
);
} else {
echo html_print_image (
$img ,
true ,
[
'class' => 'image' ,
'id' => 'image_' . $id ,
],
false ,
false ,
false ,
$isExternalLink
);
}
}
}
break ;
case COLOR_CLOUD :
echo visual_map_get_color_cloud_element ( $layoutData );
break ;
default :
if ( ! empty ( $element_enterprise )) {
echo $element_enterprise [ 'item' ];
}
break ;
}
if ( $link ) {
echo '</a>' ;
}
echo '</div>' ;
// Add the line between elements.
if ( $layoutData [ 'parent_item' ] != 0 ) {
$parent = db_get_row_filter (
'tlayout_data' ,
[ 'id' => $layoutData [ 'parent_item' ]]
);
echo '<script type="text/javascript">' ;
echo 'lines.push({"id": "' . $id . '" , "node_begin":"' . $layoutData [ 'parent_item' ] . '","node_end":"' . $id . '","color":"' . visual_map_get_color_line_status ( $parent ) . '","thickness":"' . ( empty ( $config [ 'vc_line_thickness' ]) ? 2 : $config [ 'vc_line_thickness' ]) . '"});' ;
echo '</script>' ;
}
2010-03-31 11:13:54 +02:00
}
2019-01-30 16:18:44 +01:00
function get_if_module_is_image ( $id_module )
{
$sql = 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ' . $id_module ;
$result = db_get_sql ( $sql );
$image = strpos ( $result , 'data:image' );
if ( $image === false ) {
return false ;
} else {
return true ;
}
2017-11-07 10:26:26 +01:00
}
2019-01-30 16:18:44 +01:00
function get_bars_module_data ( $id_module )
{
// This charts is only serialize graphs.
// In other string show image no data to show.
$mod_values = db_get_value_filter (
'datos' ,
'tagente_estado' ,
[ 'id_agente_modulo' => $id_module ]
);
$values = false ;
// avoid showing the image type modules. WUX
if ( strpos ( $mod_values , 'data:image/png;base64' ) !== 0 ) {
if ( preg_match ( " / \r \n / " , $mod_values )) {
$values = explode ( " \r \n " , $mod_values );
} else if ( preg_match ( " / \n / " , $mod_values )) {
$values = explode ( " \n " , $mod_values );
}
}
$values_to_return = [];
$index = 0 ;
$color_index = 0 ;
$total = 0 ;
if ( ! $values ) {
return false ;
}
foreach ( $values as $val ) {
$data = explode ( ',' , $val );
$values_to_return [ $data [ 0 ]] = [ 'g' => $data [ 1 ]];
}
return $values_to_return ;
2017-10-26 16:13:27 +02:00
}
2012-04-13 13:15:14 +02:00
/**
* The function to get simple value type from the value of process type in the form
2019-01-30 16:18:44 +01:00
*
2012-04-13 13:15:14 +02:00
* @ param int process simple value from form
2019-01-30 16:18:44 +01:00
*
* @ return integer type among the constants :
2012-04-13 13:15:14 +02:00
* SIMPLE_VALUE , SIMPLE_VALUE_MAX , SIMPLE_VALUE_MIN , SIMPLE_VALUE_AVG
*/
2019-01-30 16:18:44 +01:00
function visual_map_get_simple_value_type ( $process_simple_value )
{
switch ( $process_simple_value ) {
case PROCESS_VALUE_NONE :
return SIMPLE_VALUE ;
break ;
case PROCESS_VALUE_MIN :
return SIMPLE_VALUE_MIN ;
break ;
case PROCESS_VALUE_MAX :
return SIMPLE_VALUE_MAX ;
break ;
case PROCESS_VALUE_AVG :
return SIMPLE_VALUE_AVG ;
break ;
}
2012-04-13 13:15:14 +02:00
}
2019-01-30 16:18:44 +01:00
2012-04-13 13:15:14 +02:00
/**
2019-01-30 16:18:44 +01:00
* The function to get the simple value of a module
*
2012-04-13 13:15:14 +02:00
* @ param int type of the retrieving choosed among the constants :
* SIMPLE_VALUE , SIMPLE_VALUE_MAX , SIMPLE_VALUE_MIN , SIMPLE_VALUE_AVG
* @ param int id agent module
2012-06-11 21:13:20 +02:00
* @ param int period The period in seconds for calculate the avg or min or max value .
2019-01-30 16:18:44 +01:00
*
2012-04-13 13:15:14 +02:00
* @ return string value retrieved with units
*/
2019-01-30 16:18:44 +01:00
function visual_map_get_simple_value ( $type , $id_module , $period = SECONDS_1DAY )
{
global $config ;
$unit_text = db_get_sql (
' SELECT unit
FROM tagente_modulo WHERE id_agente_modulo = ' . $id_module
);
$unit_text = trim ( io_safe_output ( $unit_text ));
switch ( $type ) {
case SIMPLE_VALUE :
$value = db_get_value (
'datos' ,
'tagente_estado' ,
'id_agente_modulo' ,
$id_module
);
if ( $value === false ) {
$value = __ ( 'Unknown' );
$value = preg_replace ( '/\n/i' , '<br>' , $value );
$value = preg_replace ( '/\s/i' , ' ' , $value );
} else {
if ( strpos ( $value , 'data:image' ) !== false ) {
$value = '<img class="b64img" src="' . $value . '">' ;
} else {
if ( is_numeric ( $value )) {
if ( $config [ 'simple_module_value' ]) {
$value = remove_right_zeros ( number_format ( $value , $config [ 'graph_precision' ]));
}
}
if ( ! empty ( $unit_text )) {
$value .= ' ' . $unit_text ;
}
$value = preg_replace ( '/\n/i' , '<br>' , $value );
$value = preg_replace ( '/\s/i' , ' ' , $value );
}
}
return $value ;
break ;
case SIMPLE_VALUE_MAX :
$value = reporting_get_agentmodule_data_max ( $id_module , $period , 0 );
if ( $value === false ) {
$value = __ ( 'Unknown' );
} else {
if ( is_numeric ( $value )) {
if ( $config [ 'simple_module_value' ]) {
$value = format_for_graph ( $value , $config [ 'graph_precision' ]);
}
}
if ( ! empty ( $unit_text )) {
$value .= ' ' . $unit_text ;
}
}
return $value ;
break ;
case SIMPLE_VALUE_MIN :
$value = reporting_get_agentmodule_data_min ( $id_module , $period , 0 );
if ( $value === false ) {
$value = __ ( 'Unknown' );
} else {
if ( is_numeric ( $value )) {
if ( $config [ 'simple_module_value' ]) {
$value = format_for_graph ( $value , $config [ 'graph_precision' ]);
}
}
if ( ! empty ( $unit_text )) {
$value .= ' ' . $unit_text ;
}
}
return $value ;
break ;
case SIMPLE_VALUE_AVG :
$value = reporting_get_agentmodule_data_average ( $id_module , $period , 0 );
if ( $value === false ) {
$value = __ ( 'Unknown' );
} else {
if ( is_numeric ( $value )) {
if ( $config [ 'simple_module_value' ]) {
$value = format_for_graph ( $value , $config [ 'graph_precision' ]);
}
}
if ( ! empty ( $unit_text )) {
$value .= ' ' . $unit_text ;
}
}
return $value ;
break ;
}
2012-04-13 13:15:14 +02:00
}
2019-01-30 16:18:44 +01:00
2010-03-31 11:13:54 +02:00
/**
* The function to save the new elements of agents make as wizard .
2019-01-30 16:18:44 +01:00
*
* @ param array $id_agents The list of id of agents .
* @ param string $image The image to set the elements .
2010-03-31 11:13:54 +02:00
* @ param integer $id_layout The id of visual console to insert the elements .
2019-01-30 16:18:44 +01:00
* @ param integer $range The distance between elements .
* @ param integer $width Width of image .
* @ param integer $height Height of image .
*
2010-03-31 11:13:54 +02:00
* @ return string Return the message status to insert DB .
*/
2019-01-30 16:18:44 +01:00
function visual_map_process_wizard_add (
$id_agents ,
$image ,
$id_layout ,
$range ,
$width = 0 ,
$height = 0 ,
$period ,
$process_value ,
$percentileitem_width ,
$max_value ,
$type_percentile ,
$value_show ,
$type
) {
if ( empty ( $id_agents )) {
print_error_message ( __ ( 'No agents selected' ));
return false ;
}
$id_agents = ( array ) $id_agents ;
$error = false ;
$pos_y = 10 ;
$pos_x = 10 ;
foreach ( $id_agents as $id_agent ) {
if ( $pos_x > 600 ) {
$pos_x = 10 ;
$pos_y = ( $pos_y + $range );
}
$value_height = $height ;
$value_image = $image ;
$value_type = $type ;
switch ( $type ) {
case PERCENTILE_BAR :
case PERCENTILE_BUBBLE :
case CIRCULAR_PROGRESS_BAR :
case CIRCULAR_INTERIOR_PROGRESS_BAR :
$value_height = $max_value ;
$value_image = $value_show ;
if ( $type_percentile == 'percentile' ) {
$value_type = PERCENTILE_BAR ;
} else if ( $type_percentile == 'interior_circular_progress_bar' ) {
$value_type = CIRCULAR_INTERIOR_PROGRESS_BAR ;
} else if ( $type_percentile == 'circular_progress_bar' ) {
$value_type = CIRCULAR_PROGRESS_BAR ;
} else {
$value_type = PERCENTILE_BUBBLE ;
}
break ;
case SIMPLE_VALUE :
$value_type = $process_value ;
break ;
}
$label = agents_get_alias ( $id_agent );
$value_label = '(_VALUE_)' ;
if ( $type === SIMPLE_VALUE ) {
$label .= ' ' . $value_label ;
}
$values = [
'type' => $value_type ,
'id_layout' => $id_layout ,
'pos_x' => $pos_x ,
'pos_y' => $pos_y ,
'label' => $label ,
'image' => $value_image ,
'id_agent' => $id_agent ,
'width' => $width ,
'period' => $period ,
'height' => $value_height ,
];
db_process_sql_insert ( 'tlayout_data' , $values );
$pos_x = ( $pos_x + $range );
}
$return = ui_print_success_message ( __ ( 'Agent successfully added to layout' ), '' , true );
return $return ;
2010-03-30 19:39:32 +02:00
}
2019-01-30 16:18:44 +01:00
2010-03-31 11:13:54 +02:00
/**
* The function to save the new elements of modules make as wizard .
2019-01-30 16:18:44 +01:00
*
* @ param array $id_modules The list of id of modules .
* @ param string $image The image to set the elements .
* @ param integer $id_layout The id of visual console to insert the elements .
* @ param integer $range The distance between elements .
* @ param integer $width Width of image .
* @ param integer $height Height of image .
*
2010-03-31 11:13:54 +02:00
* @ return string Return the message status to insert DB .
*/
2019-01-30 16:18:44 +01:00
function visual_map_process_wizard_add_modules (
$id_modules ,
$image ,
$id_layout ,
$range ,
$width = 0 ,
$height = 0 ,
$period ,
$process_value ,
$percentileitem_width ,
$max_value ,
$type_percentile ,
$value_show ,
$label_type ,
$type ,
$enable_link = true ,
$id_server = 0 ,
$kind_relationship = VISUAL_MAP_WIZARD_PARENTS_NONE ,
$item_in_the_map = 0 ,
$fontf = 'arial' ,
$fonts = '12pt'
) {
if ( empty ( $id_modules )) {
$return = ui_print_error_message (
__ ( 'No modules selected' ),
'' ,
true
);
return $return ;
}
$id_modules = ( array ) $id_modules ;
$error = false ;
$pos_y = 10 ;
$pos_x = 10 ;
foreach ( $id_modules as $id_module ) {
if ( $pos_x > 600 ) {
$pos_x = 10 ;
$pos_y = ( $pos_y + $range );
}
if ( $id_server != 0 ) {
$connection = db_get_row_filter (
'tmetaconsole_setup' ,
[ 'id' => $id_server ]
);
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
$return = ui_print_error_message (
'Error connecting to ' . $server_name ,
'' ,
true
);
return $return ;
}
}
$id_agent = modules_get_agentmodule_agent ( $id_module );
switch ( $label_type ) {
case 'agent_module' :
default :
$agent_label = agents_get_alias ( $id_agent );
$module_label = modules_get_agentmodule_name ( $id_module );
$label = '<p><span class="visual_font_size_' . $fonts . '" style="font-family:' . $fontf . ';">' . $agent_label . ' - ' . $module_label . '</span></p>' ;
break ;
case 'module' :
$module_label = modules_get_agentmodule_name ( $id_module );
$label = '<p><span class="visual_font_size_' . $fonts . '" style="font-family:' . $fontf . ';">' . $module_label . '</span></p>' ;
break ;
case 'agent' :
$agent_label = agents_get_alias ( $id_agent );
$label = '<p><span class="visual_font_size_' . $fonts . '" style="font-family:' . $fontf . ';">' . $agent_label . '</span></p>' ;
break ;
case 'none' :
$label = '' ;
break ;
}
$label = io_safe_input ( $label );
// Restore db connection
if ( $id_server != 0 ) {
metaconsole_restore_db ();
}
$value_height = $height ;
$value_image = $image ;
$value_type = $type ;
$value_width = $width ;
switch ( $type ) {
case PERCENTILE_BAR :
case PERCENTILE_BUBBLE :
case CIRCULAR_PROGRESS_BAR :
case CIRCULAR_INTERIOR_PROGRESS_BAR :
$value_height = $max_value ;
$value_width = $percentileitem_width ;
$value_image = $value_show ;
if ( $type_percentile == 'percentile' ) {
$value_type = PERCENTILE_BAR ;
} else if ( $type_percentile == 'interior_circular_progress_bar' ) {
$value_type = CIRCULAR_INTERIOR_PROGRESS_BAR ;
} else if ( $type_percentile == 'circular_progress_bar' ) {
$value_type = CIRCULAR_PROGRESS_BAR ;
} else {
$value_type = PERCENTILE_BUBBLE ;
}
break ;
case SIMPLE_VALUE :
$label = ! empty ( $label ) ? $label . ' (_VALUE_)' : '(_VALUE_)' ;
$value_image = '' ;
switch ( $process_value ) {
case PROCESS_VALUE_NONE :
$value_type = SIMPLE_VALUE ;
break ;
case PROCESS_VALUE_MIN :
$value_type = SIMPLE_VALUE_MIN ;
break ;
case PROCESS_VALUE_MAX :
$value_type = SIMPLE_VALUE_MAX ;
break ;
case PROCESS_VALUE_AVG :
$value_type = SIMPLE_VALUE_AVG ;
break ;
}
break ;
}
$parent_item = 0 ;
switch ( $kind_relationship ) {
case VISUAL_MAP_WIZARD_PARENTS_ITEM_MAP :
$parent_item = $item_in_the_map ;
break ;
}
$values = [
'type' => $value_type ,
'id_layout' => $id_layout ,
'pos_x' => $pos_x ,
'pos_y' => $pos_y ,
'label' => $label ,
'image' => $value_image ,
'id_agent' => $id_agent ,
'id_agente_modulo' => $id_module ,
'width' => $value_width ,
'period' => $period ,
'height' => $value_height ,
'enable_link' => $enable_link ,
'id_metaconsole' => $id_server ,
'parent_item' => $parent_item ,
];
db_process_sql_insert ( 'tlayout_data' , $values );
$pos_x = ( $pos_x + $range );
}
$return = ui_print_success_message ( __ ( 'Modules successfully added to layout' ), '' , true );
return $return ;
2010-03-30 19:39:32 +02:00
}
2019-01-30 16:18:44 +01:00
function get_donut_module_data ( $id_module )
{
$mod_values = db_get_value_filter ( 'datos' , 'tagente_estado' , [ 'id_agente_modulo' => $id_module ]);
$no_data_to_show = false ;
if ( preg_match ( " / \r \n / " , $mod_values )) {
$values = explode ( " \r \n " , $mod_values );
} else if ( preg_match ( " / \n / " , $mod_values )) {
$values = explode ( " \n " , $mod_values );
} else {
$values = [ __ ( 'No data to show' ) . ',1' ];
$no_data_to_show = true ;
}
$colors = [];
$colors [] = '#aa3333' ;
$colors [] = '#045FB4' ;
$colors [] = '#8181F7' ;
$colors [] = '#F78181' ;
$colors [] = '#D0A9F5' ;
$colors [] = '#BDBDBD' ;
$colors [] = '#6AB277' ;
$max_elements = 6 ;
$values_to_return = [];
$index = 0 ;
$total = 0 ;
foreach ( $values as $val ) {
if ( $index < $max_elements ) {
$data = explode ( ',' , $val );
if ( $data [ 1 ] == 0 ) {
$data [ 1 ] = __ ( 'No data' );
}
if ( $no_data_to_show ) {
$values_to_return [ $index ][ 'tag_name' ] = $data [ 0 ];
} else {
$values_to_return [ $index ][ 'tag_name' ] = $data [ 0 ] . ': ' . $data [ 1 ];
}
$values_to_return [ $index ][ 'color' ] = $colors [ $index ];
$values_to_return [ $index ][ 'value' ] = ( int ) $data [ 1 ];
$total += ( int ) $data [ 1 ];
$index ++ ;
} else {
if ( $data [ 1 ] == 0 ) {
$data [ 1 ] = __ ( 'No data' );
}
$data = explode ( ',' , $val );
$values_to_return [ $index ][ 'tag_name' ] = __ ( 'Others' ) . ': ' . $data [ 1 ];
$values_to_return [ $index ][ 'color' ] = $colors [ $index ];
$values_to_return [ $index ][ 'value' ] += ( int ) $data [ 1 ];
$total += ( int ) $data [ 1 ];
}
}
foreach ( $values_to_return as $ind => $donut_data ) {
$values_to_return [ $ind ][ 'percent' ] = (( $donut_data [ 'value' ] * 100 ) / $total );
}
$new_values_to_return = [];
while ( ! empty ( $values_to_return )) {
$first = true ;
$max_elem = 0 ;
$max_elem_array = [];
$index_to_del = 0 ;
foreach ( $values_to_return as $i => $val ) {
if ( $first ) {
$max_elem = $val [ 'value' ];
$max_elem_array = $val ;
$index_to_del = $i ;
$first = false ;
} else {
if ( $val [ 'value' ] > $max_elem ) {
$max_elem = $val [ 'value' ];
$max_elem_array = $val ;
$index_to_del = $i ;
}
}
}
$new_values_to_return [] = $max_elem_array ;
unset ( $values_to_return [ $index_to_del ]);
}
$values_to_return = $new_values_to_return ;
return $values_to_return ;
2017-10-27 10:40:58 +02:00
}
2012-06-25 17:30:05 +02:00
/**
* The function to save the new elements of agents make as wizard .
2019-01-30 16:18:44 +01:00
*
* @ param array $id_agents The list of id of agents .
* @ param string $image The image to set the elements .
2012-06-25 17:30:05 +02:00
* @ param integer $id_layout The id of visual console to insert the elements .
2019-01-30 16:18:44 +01:00
* @ param integer $range The distance between elements .
* @ param integer $width Width of image .
* @ param integer $height Height of image .
*
2012-06-25 17:30:05 +02:00
* @ return string Return the message status to insert DB .
*/
2019-01-30 16:18:44 +01:00
function visual_map_process_wizard_add_agents (
$id_agents ,
$image ,
$id_layout ,
$range ,
$width = 0 ,
$height = 0 ,
$period ,
$process_value ,
$percentileitem_width ,
$max_value ,
$type_percentile ,
$value_show ,
$label_type ,
$type ,
$enable_link = 1 ,
$id_server = 0 ,
$kind_relationship = VISUAL_MAP_WIZARD_PARENTS_NONE ,
$item_in_the_map = 0 ,
$fontf = 'arial' ,
$fonts = '12pt'
) {
global $config ;
if ( empty ( $id_agents )) {
$return = ui_print_error_message (
__ ( 'No agents selected' ),
'' ,
true
);
return $return ;
}
$id_agents = ( array ) $id_agents ;
$error = false ;
$pos_y = 10 ;
$pos_x = 10 ;
$relationship = true ;
$relationships_agents = [];
// Check if the set a none relationship
if (( $kind_relationship == VISUAL_MAP_WIZARD_PARENTS_NONE )
|| ( $kind_relationship == VISUAL_MAP_WIZARD_PARENTS_AGENT_RELANTIONSHIP
&& $item_in_the_map = 0 )
) {
$relationship = false ;
}
foreach ( $id_agents as $id_agent ) {
if ( is_array ( $id_agent )) {
$id_a = $id_agent [ 'id_agent' ];
$id_server = $id_agent [ 'id_server' ];
$id_agent = $id_a ;
}
if ( $pos_x > 600 ) {
$pos_x = 10 ;
$pos_y = ( $pos_y + $range );
}
$value_height = $height ;
$value_image = $image ;
$value_type = $type ;
$value_width = $width ;
switch ( $type ) {
case PERCENTILE_BAR :
case PERCENTILE_BUBBLE :
case CIRCULAR_PROGRESS_BAR :
case CIRCULAR_INTERIOR_PROGRESS_BAR :
$value_height = $max_value ;
$value_width = $percentileitem_width ;
$value_image = $value_show ;
if ( $type_percentile == 'percentile' ) {
$value_type = PERCENTILE_BAR ;
} else if ( $type_percentile == 'interior_circular_progress_bar' ) {
$value_type = CIRCULAR_INTERIOR_PROGRESS_BAR ;
} else if ( $type_percentile == 'circular_progress_bar' ) {
$value_type = CIRCULAR_PROGRESS_BAR ;
} else {
$value_type = PERCENTILE_BUBBLE ;
}
break ;
case SIMPLE_VALUE :
$value_image = '' ;
switch ( $process_value ) {
case PROCESS_VALUE_NONE :
$value_type = SIMPLE_VALUE ;
break ;
case PROCESS_VALUE_MIN :
$value_type = SIMPLE_VALUE_MIN ;
break ;
case PROCESS_VALUE_MAX :
$value_type = SIMPLE_VALUE_MAX ;
break ;
case PROCESS_VALUE_AVG :
$value_type = SIMPLE_VALUE_AVG ;
break ;
}
break ;
}
if ( $id_server != 0 ) {
$connection = db_get_row_filter (
'tmetaconsole_setup' ,
[ 'id' => $id_server ]
);
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
$return = ui_print_error_message (
'Error connecting to ' . $server_name ,
'' ,
true
);
return $return ;
}
}
switch ( $label_type ) {
case 'agent' :
$label = agents_get_alias ( $id_agent );
break ;
case 'none' :
$label = '' ;
break ;
}
$label = io_safe_input ( $label );
if ( $type === SIMPLE_VALUE ) {
$label = ! empty ( $label ) ? $label . ' (_VALUE_)' : '(_VALUE_)' ;
}
// Restore db connection
if ( $id_server != 0 ) {
metaconsole_restore_db ();
}
$parent_item = 0 ;
if ( $relationship ) {
switch ( $kind_relationship ) {
case VISUAL_MAP_WIZARD_PARENTS_ITEM_MAP :
$parent_item = $item_in_the_map ;
break ;
}
}
$values = [
'type' => $value_type ,
'id_layout' => $id_layout ,
'pos_x' => $pos_x ,
'pos_y' => $pos_y ,
'label' => $label ,
'image' => $value_image ,
'id_agent' => $id_agent ,
'id_agente_modulo' => 0 ,
'width' => $value_width ,
'period' => $period ,
'height' => $value_height ,
'enable_link' => $enable_link ,
'id_metaconsole' => $id_server ,
'parent_item' => $parent_item ,
];
$id_item = db_process_sql_insert ( 'tlayout_data' , $values );
if ( $relationship ) {
switch ( $kind_relationship ) {
case VISUAL_MAP_WIZARD_PARENTS_AGENT_RELANTIONSHIP :
if ( ! isset ( $relationships_agents [ $id_agent ])) {
$relationships_agents [ $id_agent ][ 'id_layout_data_parent' ] = $id_item ;
$relationships_agents [ $id_agent ][ 'id_layout_data_children' ] = [];
} else {
$relationships_agents [ $id_agent ][ 'id_layout_data_parent' ] = $id_item ;
}
$agent_id_parent = db_get_value (
'id_parent' ,
'tagente' ,
'id_agente' ,
$id_agent
);
// Check in the group of new items is the father
if ( array_search ( $agent_id_parent , $id_agents ) !== false ) {
if ( isset ( $relationships_agents [ $agent_id_parent ])) {
$relationships_agents [ $agent_id_parent ][ 'id_layout_data_children' ][] = $id_item ;
} else {
$relationships_agents [ $agent_id_parent ] = [];
$relationships_agents [ $agent_id_parent ][ 'id_layout_data_parent' ] = null ;
$relationships_agents [ $agent_id_parent ][ 'id_layout_data_children' ] = [];
$relationships_agents [ $agent_id_parent ][ 'id_layout_data_children' ][] = $id_item ;
}
}
break ;
}
}
$pos_x = ( $pos_x + $range );
}
foreach ( $relationships_agents as $relationship_item ) {
foreach ( $relationship_item [ 'id_layout_data_children' ] as $children ) {
db_process_sql_update (
'tlayout_data' ,
[ 'parent_item' => $relationship_item [ 'id_layout_data_parent' ]],
[ 'id' => $children ]
);
}
}
$return = ui_print_success_message (
__ ( 'Agents successfully added to layout' ),
'' ,
true
);
return $return ;
2012-06-25 17:30:05 +02:00
}
2010-03-31 11:13:54 +02:00
/**
* Get the color of line between elements in the visual map .
2019-01-30 16:18:44 +01:00
*
2010-03-31 11:13:54 +02:00
* @ param array $layoutData The row of element in DB .
2019-01-30 16:18:44 +01:00
*
2010-03-31 11:13:54 +02:00
* @ return string The color as hexadecimal color in html .
*/
2019-01-30 16:18:44 +01:00
function visual_map_get_color_line_status ( $layoutData )
{
if (( $layoutData [ 'type' ] == 5 ) || ( $layoutData [ 'type' ] == 4 )) {
// ICON ELEMENT OR LABEL ELEMENT
$color = '#cccccc' ;
} else {
switch ( visual_map_get_status_element ( $layoutData )) {
case 3 :
$color = '#cccccc' ;
// Gray
break ;
case 2 :
$color = '#20f6f6' ;
// Yellow
break ;
case 0 :
$color = '#00ff00' ;
// Green
break ;
case 4 :
case 1 :
$color = '#ff0000' ;
// Red
break ;
}
}
return $color ;
2010-03-25 17:18:05 +01:00
}
2019-01-30 16:18:44 +01:00
2010-03-31 11:13:54 +02:00
/**
* Get image of element in the visual console with status .
2019-01-30 16:18:44 +01:00
*
2010-03-31 11:13:54 +02:00
* @ param array $layoutData The row of element in DB .
2019-01-30 16:18:44 +01:00
*
2010-03-31 11:13:54 +02:00
* @ return string The image with the relative path to pandora console directory .
*/
2019-01-30 16:18:44 +01:00
function visual_map_get_image_status_element ( $layoutData , $status = false )
{
$img = 'images/console/icons/' . $layoutData [ 'image' ];
if ( $layoutData [ 'type' ] == 5 ) {
// ICON ELEMENT
$img .= '.png' ;
} else {
if ( $status === false ) {
$status = visual_map_get_status_element ( $layoutData );
}
switch ( $status ) {
case 1 :
// Critical (BAD)
$img .= '_bad.png' ;
break ;
case 4 :
// Critical (ALERT)
$img = '4' . $img . '_bad.png' ;
break ;
case 0 :
// Normal (OK)
$img .= '_ok.png' ;
break ;
case 2 :
// Warning
$img .= '_warning.png' ;
break ;
case 10 :
// Warning (ALERT)
$img = '4' . $img . '_warning.png' ;
break ;
case 3 :
// Unknown
default :
$img .= '.png' ;
// Default is Grey (Other)
}
}
return $img ;
2010-03-23 18:46:08 +01:00
}
2019-01-30 16:18:44 +01:00
2010-03-31 11:13:54 +02:00
/**
* Get the status of element in visual console . Check the agent state or
* module or layout linked .
2019-01-30 16:18:44 +01:00
*
2010-03-31 11:13:54 +02:00
* @ param array $layoutData The row of element in DB .
2019-01-30 16:18:44 +01:00
*
* @ return integer
2010-03-31 11:13:54 +02:00
*/
2019-01-30 16:18:44 +01:00
function visual_map_get_status_element ( $layoutData )
{
global $config ;
enterprise_include_once ( 'include/functions_visual_map.php' );
if ( enterprise_installed ()) {
$status = enterprise_visual_map_get_status_element ( $layoutData );
// The function return value.
if ( $status !== false ) {
// Return this value as call of open function.
return $status ;
}
}
$module_value = db_get_sql (
' SELECT datos
FROM tagente_estado
WHERE id_agente_modulo = '.$layoutData[' id_agente_modulo ' ]
);
// Linked to other layout ?? - Only if not module defined
if ( ! empty ( $layoutData [ 'id_layout_linked' ])) {
if ( ! empty ( $layoutData [ 'linked_layout_node_id' ])) {
// Metaconsole db connection
$connection = db_get_row_filter (
'tmetaconsole_setup' ,
[ 'id' => $layoutData [ 'linked_layout_node_id' ]]
);
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
return VISUAL_MAP_STATUS_UNKNOWN ;
}
}
$status = visual_map_get_layout_status ( $layoutData [ 'id_layout_linked' ], $layoutData );
if ( ! empty ( $layoutData [ 'linked_layout_node_id' ])) {
// Restore db connection
metaconsole_restore_db ();
}
return $status ;
} else {
switch ( $layoutData [ 'type' ]) {
case STATIC_GRAPH :
// Open metaconsole connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
// Metaconsole db connection
$connection = db_get_row_filter (
'tmetaconsole_setup' ,
[ 'id' => $layoutData [ 'id_metaconsole' ]]
);
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
// ui_print_error_message ("Error connecting to ".$server_name);
continue ;
}
}
// Enter the correct img if the graph has a module selected or not
// Module
if ( $layoutData [ 'id_agente_modulo' ] != 0 ) {
$module_status = db_get_sql (
' SELECT estado
FROM tagente_estado
WHERE id_agente_modulo = '.$layoutData[' id_agente_modulo ' ]
);
switch ( $module_status ) {
case AGENT_STATUS_NORMAL :
case AGENT_MODULE_STATUS_NORMAL_ALERT :
$layoutData [ 'status_calculated' ] = VISUAL_MAP_STATUS_NORMAL ;
break ;
case AGENT_MODULE_STATUS_WARNING :
case AGENT_MODULE_STATUS_WARNING_ALERT :
$layoutData [ 'status_calculated' ] = VISUAL_MAP_STATUS_WARNING ;
break ;
case AGENT_STATUS_CRITICAL :
case AGENT_MODULE_STATUS_CRITICAL_ALERT :
$layoutData [ 'status_calculated' ] = VISUAL_MAP_STATUS_CRITICAL_BAD ;
break ;
case AGENT_MODULE_STATUS_NO_DATA :
default :
$layoutData [ 'status_calculated' ] = VISUAL_MAP_STATUS_UNKNOWN ;
break ;
}
}
// No module
else if ( $layoutData [ 'id_agent' ] != 0 ) {
$agent = db_get_row ( 'tagente' , 'id_agente' , $layoutData [ 'id_agent' ]);
if ( $agent [ 'total_count' ] == 0 || $agent [ 'total_count' ] == $agent [ 'notinit_count' ]) {
$layoutData [ 'status_calculated' ] = VISUAL_MAP_STATUS_UNKNOWN ;
} else if ( $agent [ 'critical_count' ] > 0 ) {
$layoutData [ 'status_calculated' ] = VISUAL_MAP_STATUS_CRITICAL_BAD ;
} else if ( $agent [ 'warning_count' ] > 0 ) {
$layoutData [ 'status_calculated' ] = VISUAL_MAP_STATUS_WARNING ;
} else if ( $agent [ 'unknown_count' ] > 0 ) {
$layoutData [ 'status_calculated' ] = VISUAL_MAP_STATUS_UNKNOWN ;
} else {
$layoutData [ 'status_calculated' ] = VISUAL_MAP_STATUS_NORMAL ;
}
}
// In other case
else {
$layoutData [ 'status_calculated' ] = VISUAL_MAP_STATUS_UNKNOWN ;
}
$status = $layoutData [ 'status_calculated' ];
// Close metaconsole connection
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
// Restore db connection
metaconsole_restore_db ();
}
break ;
case PERCENTILE_BAR :
case PERCENTILE_BUBBLE :
case CIRCULAR_PROGRESS_BAR :
case CIRCULAR_INTERIOR_PROGRESS_BAR :
if ( empty ( $module_value ) || $module_value == '' ) {
return VISUAL_MAP_STATUS_UNKNOWN ;
}
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
// Metaconsole db connection
$connection = db_get_row_filter (
'tmetaconsole_setup' ,
[ 'id' => $layoutData [ 'id_metaconsole' ]]
);
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
// ui_print_error_message ("Error connecting to ".$server_name);
continue ;
}
}
// Status for a simple module
if ( $layoutData [ 'id_agente_modulo' ] != 0 ) {
$status = modules_get_agentmodule_status ( $layoutData [ 'id_agente_modulo' ]);
// We need to get the diference between warning and critical alerts!!!
$real_status = db_get_row ( 'tagente_estado' , 'id_agente_modulo' , $layoutData [ 'id_agente_modulo' ]);
// Status for a whole agent, if agente_modulo was == 0
} else if ( $layoutData [ 'id_agent' ] != 0 ) {
// --------------------------------------------------
// ADDED NO CHECK ACL FOR AVOID CHECK TAGS THAT
// MAKE VERY SLOW THE VISUALMAPS WITH ACL TAGS
// --------------------------------------------------
$status = agents_get_status ( $layoutData [ 'id_agent' ], true );
if ( $status == - 1 ) {
// agents_get_status return -1 for unknown!
$status = VISUAL_MAP_STATUS_UNKNOWN ;
}
} else {
$status = VISUAL_MAP_STATUS_UNKNOWN ;
$id_agent = 0 ;
}
if ( $layoutData [ 'id_metaconsole' ] != 0 ) {
// Restore db connection
metaconsole_restore_db ();
}
break ;
case GROUP_ITEM :
$group_status = groups_get_status ( $layoutData [ 'id_group' ]);
switch ( $group_status ) {
case AGENT_STATUS_ALERT_FIRED :
return VISUAL_MAP_STATUS_CRITICAL_ALERT ;
break ;
case AGENT_STATUS_CRITICAL :
return VISUAL_MAP_STATUS_CRITICAL_BAD ;
break ;
case AGENT_STATUS_WARNING :
return VISUAL_MAP_STATUS_WARNING ;
break ;
case AGENT_STATUS_UNKNOWN :
return VISUAL_MAP_STATUS_UNKNOWN ;
break ;
case AGENT_STATUS_NORMAL :
default :
return VISUAL_MAP_STATUS_NORMAL ;
break ;
}
break ;
default :
// If it's a graph, a progress bar or a data tag, ALWAYS report status OK
// (=0) to avoid confussions here.
$status = VISUAL_MAP_STATUS_NORMAL ;
break ;
}
}
switch ( $status ) {
case AGENT_MODULE_STATUS_CRITICAL_ALERT :
$status = VISUAL_MAP_STATUS_CRITICAL_ALERT ;
break ;
case AGENT_MODULE_STATUS_WARNING_ALERT :
$status = VISUAL_MAP_STATUS_WARNING_ALERT ;
break ;
}
return $status ;
2010-03-23 18:46:08 +01:00
}
2019-01-30 16:18:44 +01:00
function visual_map_print_user_lines ( $layout_data , $proportion = null )
{
if ( empty ( $proportion )) {
$line = [];
$line [ 'id' ] = $layout_data [ 'id' ];
$line [ 'start_x' ] = $layout_data [ 'pos_x' ];
$line [ 'start_y' ] = $layout_data [ 'pos_y' ];
$line [ 'end_x' ] = $layout_data [ 'width' ];
$line [ 'end_y' ] = $layout_data [ 'height' ];
$line [ 'line_width' ] = $layout_data [ 'border_width' ];
$line [ 'line_color' ] = $layout_data [ 'border_color' ];
} else {
$proportion_width = $proportion [ 'proportion_width' ];
$proportion_height = $proportion [ 'proportion_height' ];
$proportion_line = $proportion_height ;
if ( $proportion_width > $proportion_height ) {
$proportion_line = $proportion_width ;
}
$line = [];
$line [ 'id' ] = $layout_data [ 'id' ];
$line [ 'start_x' ] = ( $layout_data [ 'pos_x' ] * $proportion_width );
$line [ 'start_y' ] = ( $layout_data [ 'pos_y' ] * $proportion_height );
$line [ 'end_x' ] = ( $layout_data [ 'width' ] * $proportion_width );
$line [ 'end_y' ] = ( $layout_data [ 'height' ] * $proportion_height );
$line [ 'line_width' ] = ( $layout_data [ 'border_width' ] * $proportion_line );
$line [ 'line_color' ] = $layout_data [ 'border_color' ];
}
echo '<script type="text/javascript">' ;
echo 'user_lines.push(' . json_encode ( $line ) . ');' ;
echo '</script>' ;
2014-11-24 17:52:28 +01:00
}
2019-01-30 16:18:44 +01:00
2009-01-08 16:52:13 +01:00
/**
* Prints visual map
*
2019-01-30 16:18:44 +01:00
* @ param integer $id_layout Layout id
* @ param boolean $show_links
* @ param boolean $draw_lines
2009-01-08 16:52:13 +01:00
*/
2019-01-30 16:18:44 +01:00
function visual_map_print_visual_map (
$id_layout ,
$show_links = true ,
$draw_lines = true ,
$width = null ,
$height = null ,
$home_url = '' ,
$isExternalLink = false ,
$graph_javascript = true ,
$keep_aspect_ratio = false
) {
enterprise_include_once ( 'include/functions_visual_map.php' );
global $config ;
$metaconsole_hack = '/' ;
if ( defined ( 'METACONSOLE' )) {
$metaconsole_hack = '../../' ;
}
enterprise_include_once ( 'meta/include/functions_ui_meta.php' );
include_once $config [ 'homedir' ] . '/include/functions_custom_graphs.php' ;
$layout = db_get_row ( 'tlayout' , 'id' , $id_layout );
2013-06-25 11:34:12 +02:00
2019-01-30 16:18:44 +01:00
if ( empty ( $layout )) {
ui_print_error_message ( __ ( 'Cannot load the visualmap' ));
return ;
}
?>
< script language = " javascript " type = " text/javascript " >
/* <![CDATA[ */
var id_layout = < ? php echo $id_layout ; ?> ;
var lines = Array ();
var user_lines = Array ();
//Fixed to wait the load of images.
$ ( window ) . on ( 'load' , function () {
draw_lines ( lines , 'background_' + id_layout );
draw_user_lines_read ( 'background_' + id_layout );
//center_labels();
});
/* ]]> */
</ script >
< ? php
$resizedMap = false ;
$dif_height = 0 ;
$dif_width = 0 ;
$proportion_height = 0 ;
$proportion_width = 0 ;
if ( ! is_null ( $height ) && ! is_null ( $width )) {
$resizedMap = true ;
if ( $keep_aspect_ratio ) {
$ratio = min (( $width / $layout [ 'width' ]), ( $height / $layout [ 'height' ]));
$mapWidth = ( $ratio * $layout [ 'width' ]);
$mapHeight = ( $ratio * $layout [ 'height' ]);
} else {
$mapWidth = $width ;
$mapHeight = $height ;
}
$dif_height = ( $layout [ 'height' ] - $mapHeight );
$dif_width = ( $layout [ 'width' ] - $mapWidth );
$proportion_height = ( $mapHeight / $layout [ 'height' ]);
$proportion_width = ( $mapWidth / $layout [ 'width' ]);
if ( $layout [ 'background' ] != 'None.png' ) {
if ( is_metaconsole ()) {
$backgroundImage = '/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' . $config [ 'homeurl' ] . 'images/console/background/' . $layout [ 'background' ];
} else {
$backgroundImage = '/include/Image/image_functions.php?getFile=1&thumb=1&thumb_size=' . $mapWidth . 'x' . $mapHeight . '&file=' . $config [ 'homedir' ] . '/images/console/background/' . ( $layout [ 'background' ]);
}
}
} else {
$mapWidth = $layout [ 'width' ];
$mapHeight = $layout [ 'height' ];
$backgroundImage = '' ;
if ( $layout [ 'background' ] != 'None.png' ) {
$backgroundImage = $metaconsole_hack . 'images/console/background/' . $layout [ 'background' ];
}
}
if ( defined ( 'METACONSOLE' )) {
echo " <div style='width: 100%; overflow:auto; margin: 0 auto; padding:5px;'> " ;
}
echo '<div id="background_' . $id_layout . ' "
style = " margin:0px auto;text-align:
z - index : 0 ;
position : relative ;
width : '.$mapWidth.' px ;
height : '.$mapHeight.' px ;
background - color : '.$layout[' background_color '].' ; " >';
if ( $layout [ 'background' ] != 'None.png' ) {
echo " <img src=' " . ui_get_full_url ( $backgroundImage ) . " ' width='100%' height='100%' /> " ;
}
$layout_datas = db_get_all_rows_field_filter (
'tlayout_data' ,
'id_layout' ,
$id_layout
);
if ( empty ( $layout_datas )) {
$layout_datas = [];
}
$lines = [];
foreach ( $layout_datas as $layout_data ) {
$layout_group = $layout_data [ 'element_group' ];
if ( ! check_acl ( $config [ 'id_user' ], $layout_group , 'VR' )) {
continue ;
}
// Check the items are from disabled or pending delete modules
if ( $layout_data [ 'id_agente_modulo' ] != 0
&& (( $layout_data [ 'type' ] != LABEL )
|| ( $layout_data [ 'type' ] != ICON )
|| ( $layout_data [ 'type' ] != SERVICE ))
) {
$delete_pending_module = db_get_value (
'delete_pending' ,
'tagente_modulo' ,
'id_agente_modulo' ,
$layout_data [ 'id_agente_modulo' ]
);
$disabled_module = db_get_value (
'disabled' ,
'tagente_modulo' ,
'id_agente_modulo' ,
$layout_data [ 'id_agente_modulo' ]
);
if ( $delete_pending_module == 1 || $disabled_module == 1 ) {
continue ;
}
}
if (( $dif_height === 0 ) && ( $dif_width === 0 )) {
$proportion = null ;
} else {
$proportion = [
'dif_height' => $dif_height ,
'dif_width' => $dif_width ,
'proportion_height' => $proportion_height ,
'proportion_width' => $proportion_width ,
];
}
$layout_data [ 'label' ] = visual_map_macro ( $layout_data [ 'label' ], $layout_data [ 'id_agente_modulo' ]);
switch ( $layout_data [ 'type' ]) {
case LINE_ITEM :
visual_map_print_user_lines ( $layout_data , $proportion );
break ;
default :
visual_map_print_item (
'read' ,
$layout_data ,
$proportion ,
$show_links ,
$isExternalLink ,
$graph_javascript
);
break ;
}
}
// End main div
echo '</div></div>' ;
if ( defined ( 'METACONSOLE' )) {
echo '</div>' ;
}
}
2013-06-25 11:34:12 +02:00
2008-06-26 Esteban Sanchez <estebans@artica.es>
* ajax.php: Sed id_user in config array.
* godmode/menu.php, general/header.php, operation/menu.php: Replaced
lang_label with lang_string().
* general/logon_ok.php: Reduced one indentation level.
* godmode/agentes/agent_manager.php: Replaced lang_label with
lang_string(). Use pandora functions.
* include/functions_html.php, godmode/agentes/configurar_agente.php:
Tab and blankspaces style correction.
* godmode/reporting/map_builder.php: Complete rewritten to provide an
intuitive way of build the maps. It's cool, useful and very simple.
* godmode/reporting/reporting_builder.php: Deleted an output debug.
* godmode/setup/setup.php: Rewritten to use pandora functions. Added a
colorpicker for color settings.
* include/config.php: Reset pandora password. We must solve things
with this file...
* include/functions.php: Check if input is an array on safe_input().
Use filename as id in array returned by list_files().
* include/functions_db.php: Renamed return_coordinate_* functions.
Style correction.
* include/javascript/jquery.js: Updated to 1.2.6.
* include/javascript/jquery.ui.datepicker.js: Code minimized.
* include/javascript/pandora.js: Style correction.
* include/javascript/wz_jsgraphics.js: Added a class to the elements
of a line, so it can be modified using javascript.
* /include/styles/pandora.css: Added style to some tables dropdowns.
Added new styles relative to visual map editor.
* operation/reporting/reporting_viewer.php: Style correction. Added
jQuery UI.
* operation/visual_console/index.php: Use Pandora functions.
* operation/visual_console/render_view.php: Drawing the map is now on
functions_visual_map.php. Added a countdown if a refresh time is set.
Use pandora functions. Style correction.
* reporting/fgraph.php: Style correction. Use graphic_error() if
there's no data on grafico_modulo_sparse().
* images/trash.png: Added to repository. Image used on trash area on
visual map editor.
* images/console/background/africa.jpg,
images/console/background/asia.jpg,
images/console/background/europe.jpg,
images/console/background/north_america.jpg,
images/console/background/oceania.jpg,
images/console/background/shouth_america.jpg,
images/console/background/world.jpg: Added to repository. Useful and
cool map backgrounds.
* include/functions_visual_map.php: Added to repository. Implements
visual map functions like drawing the map.
* include/javascript/jquery.colorpicker.js: Added to repository.
Implements a color picker widget.
* /include/javascript/jquery.countdown.js: Added to repository.
Implements a countdown widget.
* include/javascript/jquery.ui.core.js: Added to repository. jQuery UI
core.
* include/javascript/jquery.ui.draggable.js: Added to repository.
jQuery draggable plugin.
* include/javascript/jquery.ui.droppable.js: Added to repository.
jQuery droppable plugin.
* include/javascript/pandora_visual_console.js: Added to repository.
Function useful to visual map interface.
* include/languages/countdown_*.js: Added to repository. Countdown
localization.
* include/languages/date_es_la.js, include/languages/date_gl.js,
include/languages/time_es_la.js, include/languages/time_gl.js: Added
to repository. Missing localizations.
* include/styles/color-picker.css: Added to repository. Colorpicker
style sheet.
* include/styles/countdown.css: Added to repository. Countdown style
sheet.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@899 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-26 15:26:48 +02:00
2019-01-30 16:18:44 +01:00
// End function
// Start function
2009-02-23 14:41:40 +01:00
/**
* Get a list with the layouts for a user .
*
* @ param int User id .
* @ param bool Wheter to return all the fields or only the name ( to use in
2011-04-27 15:43:31 +02:00
* html_print_select () directly )
2009-02-23 14:41:40 +01:00
* @ param array Additional filters to filter the layouts .
2011-02-16 19:39:28 +01:00
* @ param bool Whether to return All group or not .
2009-02-23 14:41:40 +01:00
*
* @ return array A list of layouts the user can see .
*/
2019-01-30 16:18:44 +01:00
function visual_map_get_user_layouts (
$id_user = 0 ,
$only_names = false ,
$filter = false ,
$returnAllGroup = true ,
$favourite = false
) {
if ( ! is_array ( $filter )) {
$filter = [];
} else {
if ( ! empty ( $filter [ 'name' ])) {
$where .= sprintf (
" name LIKE '%%%s%%' " ,
db_escape_string_sql ( io_safe_output ( $filter [ 'name' ]))
);
unset ( $filter [ 'name' ]);
}
}
if ( $favourite ) {
if ( empty ( $where )) {
$where = '' ;
}
if ( $where != '' ) {
$where .= ' AND ' ;
}
$where .= 'is_favourite = 1' ;
}
if ( $returnAllGroup ) {
$groups = users_get_groups ( $id_user , 'VR' , true , true );
} else {
if ( ! empty ( $filter [ 'group' ])) {
$permissions_group = users_get_groups ( $id_user , 'VR' , false , true );
if ( empty ( $permissions_group )) {
$permissions_group = users_get_groups ( $id_user , 'VM' , false , true );
}
$groups = array_intersect_key ( $filter [ 'group' ], $permissions_group );
} else {
$groups = users_get_groups ( $id_user , 'VR' , true , true );
if ( empty ( $groups )) {
$groups = users_get_groups ( $id_user , 'VM' , true , true );
}
}
unset ( $filter [ 'group' ]);
}
if ( ! empty ( $groups )) {
if ( empty ( $where )) {
$where = '' ;
}
if ( $where != '' ) {
$where .= ' AND ' ;
}
$where .= sprintf ( 'id_group IN (%s)' , implode ( ',' , array_keys ( $groups )));
}
$where .= db_format_array_where_clause_sql ( $filter );
if ( $where == '' ) {
$where = [];
}
$layouts = db_get_all_rows_filter ( 'tlayout' , $where );
if ( $layouts == false ) {
return [];
}
$retval = [];
foreach ( $layouts as $layout ) {
if ( $only_names ) {
$retval [ $layout [ 'id' ]] = $layout [ 'name' ];
} else {
$retval [ $layout [ 'id' ]] = $layout ;
}
// add_perms
if ( isset ( $groups [ $layout [ 'id_group' ]][ 'vconsole_view' ])) {
$retval [ $layout [ 'id' ]][ 'vr' ] = $groups [ $layout [ 'id_group' ]][ 'vconsole_view' ];
}
if ( isset ( $groups [ $layout [ 'id_group' ]][ 'vconsole_edit' ])) {
$retval [ $layout [ 'id' ]][ 'vw' ] = $groups [ $layout [ 'id_group' ]][ 'vconsole_edit' ];
}
if ( isset ( $groups [ $layout [ 'id_group' ]][ 'vconsole_management' ])) {
$retval [ $layout [ 'id' ]][ 'vm' ] = $groups [ $layout [ 'id_group' ]][ 'vconsole_management' ];
}
}
return $retval ;
2009-02-23 14:41:40 +01:00
}
2019-01-30 16:18:44 +01:00
function visual_map_translate_agent_status ( $agent_status )
{
switch ( $agent_status ) {
case AGENT_STATUS_NORMAL :
2019-02-12 13:54:52 +01:00
case AGENT_MODULE_STATUS_NORMAL_ALERT :
2019-01-30 16:18:44 +01:00
default :
return VISUAL_MAP_STATUS_NORMAL ;
case AGENT_STATUS_CRITICAL :
2019-02-12 13:54:52 +01:00
case AGENT_MODULE_STATUS_CRITICAL_ALERT :
2019-01-30 16:18:44 +01:00
return VISUAL_MAP_STATUS_CRITICAL_BAD ;
case AGENT_STATUS_WARNING :
2019-02-12 13:54:52 +01:00
case AGENT_MODULE_STATUS_WARNING_ALERT :
2019-01-30 16:18:44 +01:00
return VISUAL_MAP_STATUS_WARNING ;
case AGENT_STATUS_NOT_INIT :
case AGENT_STATUS_UNKNOWN :
case - 1 :
return VISUAL_MAP_STATUS_UNKNOWN ;
case AGENT_STATUS_ALERT_FIRED :
return VISUAL_MAP_STATUS_CRITICAL_ALERT ;
}
2018-09-04 17:23:42 +02:00
}
2019-01-30 16:18:44 +01:00
function visual_map_translate_module_status ( $module_status )
{
switch ( $module_status ) {
case AGENT_MODULE_STATUS_NORMAL :
case AGENT_MODULE_STATUS_NORMAL_ALERT :
default :
return VISUAL_MAP_STATUS_NORMAL ;
case AGENT_MODULE_STATUS_CRITICAL_BAD :
return VISUAL_MAP_STATUS_CRITICAL_BAD ;
case AGENT_MODULE_STATUS_WARNING :
return VISUAL_MAP_STATUS_WARNING ;
case AGENT_MODULE_STATUS_UNKNOWN :
case AGENT_MODULE_STATUS_NOT_INIT :
case AGENT_MODULE_STATUS_NO_DATA :
case - 1 :
return VISUAL_MAP_STATUS_UNKNOWN ;
case AGENT_MODULE_STATUS_CRITICAL_ALERT :
return VISUAL_MAP_STATUS_CRITICAL_ALERT ;
case AGENT_MODULE_STATUS_WARNING_ALERT :
return VISUAL_MAP_STATUS_WARNING_ALERT ;
}
2018-09-04 17:23:42 +02:00
}
2013-06-24 12:39:47 +02:00
2019-01-30 16:18:44 +01:00
/**
2009-02-23 14:41:40 +01:00
* Get the status of a layout .
*
* It gets all the data of the contained elements ( including nested
* layouts ), and makes an AND operation to be sure that all the items
* are OK . If any of them is down , then result is down ( 0 )
2019-01-30 16:18:44 +01:00
*
2009-02-23 14:41:40 +01:00
* @ param int Id of the layout
2018-09-04 17:23:42 +02:00
* @ param array Information about the status calculation of the item
2010-02-01 20:22:34 +01:00
* @ param int Depth ( for recursion control )
2019-01-30 16:18:44 +01:00
*
* @ return boolean The status of the given layout . True if it ' s OK , false if not .
2009-02-23 14:41:40 +01:00
*/
2019-01-30 16:18:44 +01:00
function visual_map_get_layout_status ( $layout_id , $status_data = [], $depth = 0 )
{
global $config ;
// TODO: Implement this limit into the setup
if ( $depth > 10 ) {
return VISUAL_MAP_STATUS_UNKNOWN ;
}
$layout_items = db_get_all_rows_filter ( 'tlayout_data' , [ 'id_layout' => $layout_id ]);
if ( $layout_items === false ) {
return VISUAL_MAP_STATUS_UNKNOWN ;
}
// Check for valid items to retrieve the status for
$valid_layout_items = [];
foreach ( $layout_items as $layout_item_data ) {
if (( $layout_item_data [ 'type' ] == GROUP_ITEM
&& ! empty ( $layout_item_data [ 'id_group' ])
&& check_acl ( $config [ 'id_user' ], $layout_item_data [ 'id_group' ], 'VR' )
&& check_acl ( $config [ 'id_user' ], $layout_item_data [ 'element_group' ], 'VR' ))
|| (( ! empty ( $layout_item_data [ 'id_layout_linked' ])
|| ! empty ( $layout_item_data [ 'id_agente_modulo' ])
|| ! empty ( $layout_item_data [ 'id_agent' ]))
&& check_acl ( $config [ 'id_user' ], $layout_item_data [ 'element_group' ], 'VR' ))
) {
$valid_layout_items [] = $layout_item_data ;
}
}
if ( empty ( $valid_layout_items )) {
return VISUAL_MAP_STATUS_UNKNOWN ;
}
// Sort by node id to reduce the number of connections
if ( is_metaconsole ()) {
sort_by_column ( $valid_layout_items , 'id_metaconsole' );
}
$num_elements_by_status = [];
$meta_connected_to = null ;
foreach ( $valid_layout_items as $layout_item_data ) {
$node_id = null ;
if ( is_metaconsole ()) {
$node_id = (
! empty ( $layout_item_data [ 'id_layout_linked' ]) &&
! empty ( $layout_item_data [ 'linked_layout_node_id' ])
) ? $layout_item_data [ 'linked_layout_node_id' ] : $layout_item_data [ 'id_metaconsole' ];
if ( empty ( $node_id ) && $meta_connected_to ) {
metaconsole_restore_db ();
// Restore db connection
$meta_connected_to = null ;
} else if ( ! empty ( $node_id ) && ( empty ( $meta_connected_to )
|| $meta_connected_to != $node_id )
) {
if ( ! empty ( $meta_connected_to )) {
metaconsole_restore_db ();
// Restore db connection
}
$connection = metaconsole_get_connection_by_id ( $node_id );
if ( metaconsole_load_external_db ( $connection ) != NOERR ) {
continue ;
}
$meta_connected_to = $node_id ;
}
}
$status = VISUAL_MAP_STATUS_NORMAL ;
$ent_element_status = enterprise_hook ( 'enterprise_visual_map_get_status_element' , [ $layoutData ]);
if ( $ent_element_status === ENTERPRISE_NOT_HOOK ) {
$ent_element_status = false ;
}
// Enterprise element
if ( $ent_element_status !== false ) {
$status = $ent_element_status ;
}
// Other
else {
switch ( $layout_item_data [ 'type' ]) {
case STATIC_GRAPH :
case PERCENTILE_BAR :
case PERCENTILE_BUBBLE :
case CIRCULAR_PROGRESS_BAR :
case CIRCULAR_INTERIOR_PROGRESS_BAR :
// Linked layout
if ( ! empty ( $layout_item_data [ 'id_layout_linked' ])) {
$status = visual_map_get_layout_status ( $layout_item_data [ 'id_layout_linked' ], $layout_item_data , ( $depth + 1 ));
}
// Module
else if ( ! empty ( $layout_item_data [ 'id_agente_modulo' ])) {
$module_status = modules_get_agentmodule_status ( $layout_item_data [ 'id_agente_modulo' ]);
$status = visual_map_translate_module_status ( $module_status );
}
// Agent
else if ( ! empty ( $layout_item_data [ 'id_agent' ])) {
$agent_status = agents_get_status ( $layout_item_data [ 'id_agent' ], true );
$status = visual_map_translate_agent_status ( $agent_status );
}
// Unknown
else {
$status = VISUAL_MAP_STATUS_UNKNOWN ;
}
break ;
case GROUP_ITEM :
$group_status = groups_get_status ( $layout_item_data [ 'id_group' ]);
$status = visual_map_translate_agent_status ( $group_status );
break ;
default :
// If it's a graph, a progress bar or a data tag, ALWAYS report status OK
// (=0) to avoid confussions here.
$status = VISUAL_MAP_STATUS_NORMAL ;
break ;
}
}
// When the status calculation type is 'default', only one critical element is required to
// set the layout status as critical, so we can return the critical status right now.
if ( $status_data [ 'linked_layout_status_type' ] === 'default' && ( $status == VISUAL_MAP_STATUS_CRITICAL_BAD
|| $status == VISUAL_MAP_STATUS_CRITICAL_ALERT )
) {
if ( is_metaconsole () && $meta_connected_to ) {
metaconsole_restore_db ();
// Restore db connection
}
return $status ;
} else {
if ( ! isset ( $num_elements_by_status [ $status ])) {
$num_elements_by_status [ $status ] = 0 ;
}
$num_elements_by_status [ $status ] ++ ;
}
}
if ( is_metaconsole () && $meta_connected_to ) {
metaconsole_restore_db ();
// Restore db connection
}
// Status calculation
switch ( $status_data [ 'linked_layout_status_type' ]) {
default :
case 'default' :
$num_items_critical_alert = $num_elements_by_status [ VISUAL_MAP_STATUS_CRITICAL_ALERT ];
$num_items_critical = $num_elements_by_status [ VISUAL_MAP_STATUS_CRITICAL_BAD ];
$num_items_warning = $num_elements_by_status [ VISUAL_MAP_STATUS_WARNING ];
$num_items_unknown = $num_elements_by_status [ VISUAL_MAP_STATUS_UNKNOWN ];
if ( $num_items_critical_alert > 0 ) {
return VISUAL_MAP_STATUS_CRITICAL_ALERT ;
} else if ( $num_items_critical > 0 ) {
return VISUAL_MAP_STATUS_CRITICAL_BAD ;
} else if ( $num_items_warning > 0 ) {
return VISUAL_MAP_STATUS_WARNING ;
} else if ( $num_items_unknown > 0 ) {
return VISUAL_MAP_STATUS_UNKNOWN ;
} else {
return VISUAL_MAP_STATUS_NORMAL ;
}
break ;
case 'weight' :
$weight = $status_data [ 'id_layout_linked_weight' ];
$num_items = count ( $valid_layout_items );
$num_items_critical_alert = $num_elements_by_status [ VISUAL_MAP_STATUS_CRITICAL_ALERT ];
$num_items_critical = $num_elements_by_status [ VISUAL_MAP_STATUS_CRITICAL_BAD ];
$num_items_warning = $num_elements_by_status [ VISUAL_MAP_STATUS_WARNING ];
$num_items_unknown = $num_elements_by_status [ VISUAL_MAP_STATUS_UNKNOWN ];
if ( $num_items_critical > 0
&& ((( $num_items_critical_alert + $num_items_critical ) * 100 ) / $num_items ) >= $weight
) {
return $num_items_critical_alert > 0 ? VISUAL_MAP_STATUS_CRITICAL_ALERT : VISUAL_MAP_STATUS_CRITICAL_BAD ;
} else if ( $num_items_warning > 0
&& (( $num_items_warning * 100 ) / $num_items ) >= $weight
) {
return VISUAL_MAP_STATUS_WARNING ;
} else if ( $num_items_unknown > 0
&& (( $num_items_unknown * 100 ) / $num_items ) >= $weight
) {
return VISUAL_MAP_STATUS_UNKNOWN ;
} else {
return VISUAL_MAP_STATUS_NORMAL ;
}
break ;
case 'service' :
$num_items_critical = ( $num_elements_by_status [ VISUAL_MAP_STATUS_CRITICAL_BAD ] + $num_elements_by_status [ VISUAL_MAP_STATUS_CRITICAL_ALERT ]);
$critical_percentage = (( $num_items_critical * 100 ) / count ( $valid_layout_items ));
if ( $critical_percentage >= $status_data [ 'linked_layout_status_as_service_critical' ]) {
return VISUAL_MAP_STATUS_CRITICAL_BAD ;
} else if ( $critical_percentage >= $status_data [ 'linked_layout_status_as_service_warning' ]) {
return VISUAL_MAP_STATUS_WARNING ;
} else {
return VISUAL_MAP_STATUS_NORMAL ;
}
break ;
}
2009-02-23 14:41:40 +01:00
}
2011-02-16 16:37:55 +01:00
2019-01-30 16:18:44 +01:00
2011-02-16 16:37:55 +01:00
/**
* Make a text for the parent select , when the label is not empty put this for
* the return text . Instead for the empty labels make the text with next form
2019-01-30 16:18:44 +01:00
* ( < Type > ) - < name_image > ( < agent_name > - < module_name > ) ( < id item > )
*
* @ param string $label The label of item in visual map .
* @ param string $type The label of type in visual map .
* @ param string $image The image of item in visual map .
* @ param string $agent The agent name of item in visual map .
* @ param string $id_module The module name of item in visual map .
* @ param integer $idData The id of item in visual map .
*
2011-02-16 16:37:55 +01:00
* @ return string The text for the parent .
*/
2019-01-30 16:18:44 +01:00
function visual_map_create_internal_name_item ( $label = null , $type , $image , $agent = null , $id_module , $idData )
{
$text = '' ;
if ( empty ( $label )) {
switch ( $type ) {
case 'box_item' :
case BOX_ITEM :
$text = __ ( 'Box' );
break ;
case 'module_graph' :
case MODULE_GRAPH :
$text = __ ( 'Module graph' );
break ;
case 'clock' :
case CLOCK :
$text = __ ( 'Clock' );
break ;
case 'bars_graph' :
case BARS_GRAPH :
$text = __ ( 'Bars graph' );
break ;
case 'auto_sla_graph' :
case AUTO_SLA_GRAPH :
$text = __ ( 'Auto SLA Graph' );
break ;
case 'percentile_bar' :
case PERCENTILE_BAR :
$text = __ ( 'Percentile bar' );
break ;
case 'circular_progress_bar' :
case CIRCULAR_PROGRESS_BAR :
$text = __ ( 'Circular progress bar' );
break ;
case 'interior_circular_progress_bar' :
case CIRCULAR_INTERIOR_PROGRESS_BAR :
$text = __ ( 'Circular progress bar (interior)' );
break ;
case 'static_graph' :
case STATIC_GRAPH :
$text = __ ( 'Static graph' ) . ' - ' . $image ;
break ;
case 'simple_value' :
case SIMPLE_VALUE :
$text = __ ( 'Simple Value' );
break ;
case 'label' :
case LABEL :
$text = __ ( 'Label' );
break ;
case GROUP_ITEM :
case 'group_item' :
$text = __ ( 'Group' ) . ' - ' ;
break ;
case COLOR_CLOUD :
case 'color_cloud' :
$text = __ ( 'Color cloud' ) . ' - ' ;
break ;
case 'icon' :
case ICON :
$text = __ ( 'Icon' ) . ' - ' . $image ;
break ;
}
if ( ! empty ( $agent )) {
$text .= ' (' . ui_print_truncate_text ( $agent , 'agent_small' , false );
$moduleName = io_safe_output ( db_get_value ( 'nombre' , 'tagente_modulo' , 'id_agente_modulo' , $id_module ));
if ( ! empty ( $moduleName )) {
$text .= ' - ' . ui_print_truncate_text ( $moduleName , 'module_small' , false );
}
$text .= ')' ;
}
$text .= ' (' . $idData . ')' ;
} else {
$text = $label ;
}
return io_safe_output ( $text );
2011-02-16 16:37:55 +01:00
}
2019-01-30 16:18:44 +01:00
function visual_map_get_items_parents ( $idVisual )
{
// Avoid the sort by 'label' in the query cause oracle cannot sort by columns with CLOB type
$items = db_get_all_rows_filter ( 'tlayout_data' , [ 'id_layout' => $idVisual ]);
if ( $items == false ) {
$items = [];
} else {
// Sort by label
sort_by_column ( $items , 'label' );
}
$return = [];
foreach ( $items as $item ) {
$agent = null ;
if ( $item [ 'id_agent' ] != 0 ) {
$agent = io_safe_output ( agents_get_alias ( $item [ 'id_agent' ]));
}
$return [ $item [ 'id' ]] = visual_map_create_internal_name_item (
$item [ 'label' ],
$item [ 'type' ],
$item [ 'image' ],
$agent ,
$item [ 'id_agente_modulo' ],
$item [ 'id' ]
);
}
return $return ;
2011-02-16 16:37:55 +01: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
2019-01-30 16:18:44 +01: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
/**
* Get the X axis coordinate of a layout item
*
* @ param int Id of the layout to get .
*
2019-01-30 16:18:44 +01:00
* @ return integer The X axis coordinate value .
* 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
*/
2019-01-30 16:18:44 +01:00
function visual_map_get_layoutdata_x ( $id_layoutdata )
{
return ( float ) db_get_value ( 'pos_x' , 'tlayout_data' , 'id' , ( int ) $id_layoutdata );
* 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
}
2019-01-30 16:18:44 +01: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
/**
* Get the Y axis coordinate of a layout item
*
* @ param int Id of the layout to get .
*
2019-01-30 16:18:44 +01:00
* @ return integer The Y axis coordinate value .
* 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
*/
2019-01-30 16:18:44 +01:00
function visual_map_get_layoutdata_y ( $id_layoutdata )
{
return ( float ) db_get_value (
'pos_y' ,
'tlayout_data' ,
'id' ,
( int ) $id_layoutdata
);
* 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
}
2014-11-19 16:29:36 +01:00
2019-01-30 16:18:44 +01:00
function visual_map_type_in_js ( $type )
{
switch ( $type ) {
case STATIC_GRAPH :
return 'static_graph' ;
break ;
case PERCENTILE_BAR :
return 'percentile_item' ;
break ;
case CIRCULAR_PROGRESS_BAR :
return 'percentile_item' ;
break ;
case CIRCULAR_INTERIOR_PROGRESS_BAR :
return 'percentile_item' ;
break ;
case MODULE_GRAPH :
return 'module_graph' ;
break ;
case BARS_GRAPH :
return 'bars_graph' ;
break ;
case AUTO_SLA_GRAPH :
return 'auto_sla_graph' ;
break ;
case SIMPLE_VALUE :
return 'simple_value' ;
break ;
case LABEL :
return 'label' ;
break ;
case ICON :
return 'icon' ;
break ;
case CLOCK :
return 'clock' ;
break ;
case SIMPLE_VALUE_MAX :
return 'simple_value' ;
break ;
case SIMPLE_VALUE_MIN :
return 'simple_value' ;
break ;
case SIMPLE_VALUE_AVG :
return 'simple_value' ;
break ;
case PERCENTILE_BUBBLE :
return 'percentile_item' ;
break ;
case SERVICE :
return 'service' ;
break ;
case GROUP_ITEM :
return 'group_item' ;
break ;
case BOX_ITEM :
return 'box_item' ;
break ;
case LINE_ITEM :
return 'line_item' ;
case COLOR_CLOUD :
return 'color_cloud' ;
break ;
}
2017-08-24 12:50:55 +02:00
}
2019-01-30 16:18:44 +01:00
function visual_map_macro ( $label , $module )
{
$label = str_replace ( '_date_' , strftime ( '%x' ), $label );
$label = str_replace ( '_time_' , strftime ( '%T' ), $label );
$label = str_replace ( '_agent_' , agents_get_alias ( modules_get_agentmodule_agent ( $module )), $label );
$label = str_replace ( '_module_' , modules_get_agentmodule_name ( $module ), $label );
$label = str_replace ( '_agentdescription_' , agents_get_description ( modules_get_agentmodule_agent ( $module )), $label );
$label = str_replace ( '_address_' , agents_get_address ( modules_get_agentmodule_agent ( $module )), $label );
$label = str_replace ( '_moduledescription_' , modules_get_agentmodule_descripcion ( $module ), $label );
return $label ;
2018-12-11 19:14:14 +01:00
}
2018-08-01 12:54:08 +02:00
2019-01-30 16:18:44 +01:00
function visual_map_get_color_cloud_element ( $data )
{
$id = ( int ) $data [ 'id' ];
$diameter = ( int ) $data [ 'width' ];
$dynamic_fields = [];
try {
// Yes, the dynamic fields object is stored into the label field. ¯\_(ツ)_/¯
if ( ! empty ( $data [ 'label' ])) {
$dynamic_fields = json_decode ( $data [ 'label' ], true );
}
} catch ( Exception $ex ) {
}
$default_color = ! empty ( $dynamic_fields [ 'default_color' ]) ? $dynamic_fields [ 'default_color' ] : '#FFFFFF' ;
$color = $default_color ;
// The svg gradient needs a unique identifier
$gradient_id = 'grad_' . $id ;
// Color ranges
if ( ! empty ( $dynamic_fields [ 'color_ranges' ])
&& ! empty ( $data [ 'id_agente_modulo' ])
) {
$node_id = null ;
$node_connected = false ;
// Connect to node
if ( is_metaconsole () && ! empty ( $data [ 'id_metaconsole' ])) {
$node_id = ( int ) $data [ 'id_metaconsole' ];
if ( metaconsole_connect ( null , $node_id ) === NOERR ) {
$node_connected = true ;
}
}
// Fetch module value
$value = ( ! $node_id || ( $node_id && $node_connected )) ? modules_get_last_value ( $data [ 'id_agente_modulo' ]) : false ;
// Restore connection
if ( $node_connected ) {
metaconsole_restore_db ();
}
if ( $value !== false ) {
/*
TODO : It would be ok to give support to string values in the future ?
* It can be done by matching the range value with the value if it is a
* string . I think the function to retrieve the value only supports
* numeric values .
*/
$value = ( float ) $value ;
foreach ( $dynamic_fields [ 'color_ranges' ] as $range ) {
if ( $range [ 'from_value' ] <= $value && $range [ 'to_value' ] >= $value ) {
$color = $range [ 'color' ];
break ;
}
}
}
}
ob_start ();
?>
< svg height = " <?php echo $diameter ; ?> " width = " <?php echo $diameter ; ?> " >
< defs >
< radialGradient id = " <?php echo $gradient_id ; ?> " cx = " 50% " cy = " 50% " r = " 50% " fx = " 50% " fy = " 50% " >
< stop offset = " 0% " style = " stop-color:<?php echo $color ; ?>;stop-opacity:0.9 " />
<!-- < stop offset = " 50% " style = " stop-color:<?php echo $color ; ?>;stop-opacity:0.6 " /> -->
< stop offset = " 100% " style = " stop-color:<?php echo $color ; ?>;stop-opacity:0 " />
</ radialGradient >
</ defs >
< circle cx = " 50% " cy = " 50% " r = " 50% " fill = " url(#<?php echo $gradient_id ; ?>) " />
</ svg >
< ? php
return ob_get_clean ();
}
2019-04-12 12:43:23 +02:00
/**
* Load the Visual Console Client files ( js & css ) .
*
* @ return void
*/
function visual_map_load_client_resources ()
{
global $config ;
$baseUrl = ui_get_full_url ( false , false , false , false );
$vcClientPath = 'include/visual-console-client' ;
$dir = $config [ 'homedir' ] . '/' . $vcClientPath ;
if ( is_dir ( $dir )) {
$dh = opendir ( $dir );
if ( $dh ) {
while (( $file = readdir ( $dh )) !== false ) {
if ( $file === '.' || $file === '..' ) {
continue ;
}
preg_match ( '/.*.js$/' , $file , $match , PREG_OFFSET_CAPTURE );
if ( empty ( $match ) === false ) {
$url = $baseUrl . $vcClientPath . '/' . $match [ 0 ][ 0 ];
echo '<script type="text/javascript" src="' . $url . '"></script>' ;
continue ;
}
preg_match ( '/.*.css$/' , $file , $match , PREG_OFFSET_CAPTURE );
if ( empty ( $match ) === false ) {
$url = $baseUrl . $vcClientPath . '/' . $match [ 0 ][ 0 ];
echo '<link type="text/css" rel="stylesheet" href="' . $url . '" />' ;
}
}
closedir ( $dh );
}
}
}