2006-03-27 05:37:27 +02:00
|
|
|
<?php
|
2006-07-19 20:29:12 +02:00
|
|
|
|
2008-07-30 20:39:40 +02:00
|
|
|
// Pandora FMS - the Flexible Monitoring System
|
|
|
|
// ============================================
|
2008-08-22 20:07:32 +02:00
|
|
|
// Copyright (c) 2008 Artica Soluciones Tecnologicas, http://www.artica.es
|
2008-07-30 20:39:40 +02:00
|
|
|
// Please see http://pandora.sourceforge.net for full contribution list
|
|
|
|
|
2006-06-29 21:31:53 +02:00
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
2008-08-22 20:07:32 +02:00
|
|
|
// as published by the Free Software Foundation for version 2.
|
2006-06-29 21:31:53 +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.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2006-03-27 05:37:27 +02:00
|
|
|
|
2006-07-19 20:29:12 +02:00
|
|
|
// Load global vars
|
2008-07-16 23:04:31 +02:00
|
|
|
check_login ();
|
2008-06-16 20:09:56 +02:00
|
|
|
|
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.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_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.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_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
|
|
|
if (! give_acl ($config['id_user'], 0, "LM")) {
|
|
|
|
audit_db ($config['id_user'], $REMOTE_ADDR, "ACL Violation",
|
|
|
|
"Trying to access Agent Config Management Admin section");
|
|
|
|
require ("general/noaccess.php");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-02-16 13:18:42 +01:00
|
|
|
require_once ('include/functions_agents.php');
|
|
|
|
require_once ('include/functions_alerts.php');
|
|
|
|
require_once ('include/functions_modules.php');
|
2008-08-11 Esteban Sanchez <estebans@artica.es>
* include/functions_db.php: Added __ as an alias of lang_string().
* include/functions_reporting_pdf.php,
include/functions_reporting.php, include/functions.php,
include/functions_visual_map.php, index.php,
operation/incidents/incident.php,
operation/incidents/incident_detail.php,
operation/incidents/incident_note.php,
operation/incidents/incident_search.php,
operation/incidents/incident_statistics.php,
operation/snmpconsole/snmp_alert.php,
operation/snmpconsole/snmp_view.php, operation/users/user.php,
operation/users/user_edit.php, operation/users/user_statistics.php,
operation/events/event_statistics.php, operation/events/events.php,
operation/visual_console/render_view.php,
operation/visual_console/index.php, operation/extensions.php,
operation/agentes/estado_alertas.php,
operation/agentes/status_monitor.php,
operation/agentes/estado_grupo.php, operation/agentes/export_csv.php,
operation/agentes/datos_agente.php,
operation/agentes/estado_ultimopaquete.php,
operation/agentes/estado_generalagente.php,
operation/agentes/estado_agente.php, operation/agentes/bulbs.php,
operation/agentes/status_events.php, operation/agentes/sla_view.php,
operation/agentes/exportdata.php,
operation/agentes/estado_monitores.php,
operation/agentes/ver_agente.php, operation/agentes/estadisticas.php,
operation/agentes/tactical.php, operation/agentes/networkmap.php,
operation/messages/message.php,
operation/reporting/reporting_viewer.php,
operation/reporting/graph_viewer.php,
operation/reporting/custom_reporting.php,
operation/servers/view_server.php,
operation/servers/view_server_detail.php, operation/menu.php,
reporting/fgraph.php, reporting/stat_win.php, ajax.php,
general/logoff.php, general/pandora_help.php, general/footer.php,
general/noaccess.php, general/logon_failed.php,
general/links_menu.php, general/login_page.php, general/logon_ok.php,
general/header.php, general/main_menu.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/setup/news.php, godmode/setup/links.php,
godmode/setup/setup.php, godmode/users/user_list.php,
godmode/users/configure_user.php, godmode/profiles/profile_list.php,
godmode/admin_access_logs.php, godmode/db/db_info_data.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_network.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/alert_manager.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/alert_manager_editor.php,
godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor_data.php,
godmode/agentes/module_manager.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/configurar_agente.php,
godmode/agentes/agent_disk_conf_editor.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php,
godmode/agentes/agent_manager.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_templates_form.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php,
godmode/reporting/reporting_builder.php,
godmode/reporting/map_builder.php,
godmode/reporting/graph_builder.php, godmode/servers/plugin.php,
godmode/servers/manage_recontask.php,
godmode/servers/modificar_server.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/modify_alert.php, godmode/alerts/configure_alert.php,
godmode/menu.php: Replaced $id_user with $config['id_user']. Use __a
instead of $lang_label to future use of gettext. Style
corrections.
* godmode/agentes/planned_downtime.php: Rewritten to use Pandora
functions and adopt the UI style. Replaced lang_string with __().
* pandoradb.sql: Fields in tplanned_downtime renamed to fit
guidelines.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1005 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-08-11 12:59:07 +02:00
|
|
|
|
2009-03-17 10:22:02 +01:00
|
|
|
echo '<h3>'.__('Configuration Management').'</h3>';
|
2008-06-16 20:09:56 +02:00
|
|
|
|
2009-02-16 13:18:42 +01:00
|
|
|
$source_id_group = (int) get_parameter ('source_id_group');
|
|
|
|
$source_id_agent = (int) get_parameter ('source_id_agent');
|
|
|
|
$destiny_id_group = (int) get_parameter ('destiny_id_group');
|
|
|
|
$destiny_id_agents = (array) get_parameter ('destiny_id_agent', array ());
|
2008-10-14 17:07:53 +02:00
|
|
|
|
2009-02-16 13:18:42 +01:00
|
|
|
$do_operation = (bool) get_parameter ('do_operation');
|
2008-10-14 17:07:53 +02:00
|
|
|
|
2009-02-16 13:18:42 +01:00
|
|
|
if ($do_operation) {
|
|
|
|
process_manage_config ($source_id_agent, $destiny_id_agents);
|
2008-10-14 17:07:53 +02:00
|
|
|
}
|
|
|
|
|
2009-02-16 13:18:42 +01:00
|
|
|
$groups = get_user_groups ();
|
|
|
|
|
|
|
|
$table->class = 'databox';
|
|
|
|
$table->width = '95%';
|
|
|
|
$table->data = array ();
|
|
|
|
$table->style = array ();
|
|
|
|
$table->style[0] = 'font-weight: bold; vertical-align:top';
|
|
|
|
$table->style[2] = 'font-weight: bold';
|
|
|
|
$table->size = array ();
|
2009-02-16 17:23:30 +01:00
|
|
|
$table->size[0] = '15%';
|
|
|
|
$table->size[1] = '35%';
|
|
|
|
$table->size[2] = '15%';
|
|
|
|
$table->size[3] = '35%';
|
2009-02-16 13:18:42 +01:00
|
|
|
|
|
|
|
/* Source selection */
|
|
|
|
$table->id = 'source_table';
|
|
|
|
$table->data[0][0] = __('Group');
|
|
|
|
$table->data[0][1] = print_select ($groups, 'source_id_group', $source_id_group,
|
|
|
|
false, '', '', true);
|
|
|
|
$table->data[0][2] = __('Agent');
|
2009-02-16 17:23:30 +01:00
|
|
|
$table->data[0][2] .= ' <span id="source_agent_loading" class="invisible">';
|
2009-02-24 17:31:02 +01:00
|
|
|
$table->data[0][2] .= print_image ("images/spinner.gif", true);
|
2009-02-16 17:23:30 +01:00
|
|
|
$table->data[0][2] .= '</span>';
|
2009-02-16 13:18:42 +01:00
|
|
|
$table->data[0][3] = print_select (get_group_agents ($source_id_group, false, "none"),
|
|
|
|
'source_id_agent', $source_id_agent, false, __('Select'), 0, true);
|
|
|
|
|
2009-03-17 10:22:02 +01:00
|
|
|
echo '<form id="manage_config_form" method="post">';
|
2009-02-16 13:18:42 +01:00
|
|
|
|
|
|
|
echo '<fieldset id="fieldset_source">';
|
|
|
|
echo '<legend><span>'.__('Source');
|
2009-03-24 Esteban Sanchez <estebans@artica.es>
* general/pandora_help.php: Added support for enterprise help files.
* include/javascript/pandora.js: Renamed pandora_help() to
open_help().
* include/functions_ui.php: Renamed event function on
print_help_icon(). Removed deprecated pandora_help().
* godmode/agentes/module_manager.php: Added enterprise hooks.
* godmode/agentes/module_manager_editor.php: Added categories
construction here. Added enterprise hooks.
* godmode/agentes/module_manager_editor_common.php: Replaced
deprecated pandora_help() with print_help_icon(). Moved categories
construction to module_manager_editor.
* include/config_process.php: Updated build version.
* include/styles/pandora.css: Fixed textarea height.
* godmode/agentes/manage_config_remote.php,
godmode/agentes/massive_config.php,
godmode/agentes/massive_edit_modules.php,
godmode/agentes/module_manager_editor_network.php,
godmode/agentes/module_manager_editor_plugin.php,
godmode/agentes/module_manager_editor_prediction.php,
godmode/agentes/module_manager_editor_wmi.php,
godmode/agentes/planned_downtime.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/modules/manage_network_components_form_network.php,
godmode/modules/manage_network_components_form_wmi.php,
godmode/reporting/map_builder.php,
godmode/servers/manage_export_form.php,
godmode/servers/manage_recontask_form.php, godmode/servers/plugin.php,
godmode/setup/setup.php, operation/agentes/alerts_status.php,
operation/agentes/tactical.php,
godmode/agentes/agent_manager.php: Replaced deprecated pandora_help()
with print_help_icon().
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1557 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-03-24 16:38:54 +01:00
|
|
|
print_help_icon ('manageconfig');
|
2009-02-16 13:18:42 +01:00
|
|
|
echo '</span></legend>';
|
|
|
|
print_table ($table);
|
|
|
|
echo '</fieldset>';
|
2008-10-14 17:07:53 +02:00
|
|
|
|
2009-02-16 13:18:42 +01:00
|
|
|
/* Target selection */
|
|
|
|
$table->id = 'target_table';
|
|
|
|
$table->data = array ();
|
2008-10-14 17:07:53 +02:00
|
|
|
|
2009-02-16 13:18:42 +01:00
|
|
|
$modules = array ();
|
|
|
|
if ($source_id_agent)
|
|
|
|
$modules = get_agent_modules ($source_id_agent, 'nombre');
|
|
|
|
|
|
|
|
$table->data['operations'][0] = __('Operations');
|
2009-02-24 17:31:02 +01:00
|
|
|
$table->data['operations'][1] = '<span class="with_modules'.(empty ($modules) ? ' invisible': '').'">';
|
2009-02-16 13:18:42 +01:00
|
|
|
$table->data['operations'][1] .= print_checkbox ('copy_modules', 1, true, true);
|
|
|
|
$table->data['operations'][1] .= print_label (__('Copy modules'), 'checkbox-copy_modules', true);
|
|
|
|
$table->data['operations'][1] .= '</span><br />';
|
|
|
|
|
2009-02-24 17:31:02 +01:00
|
|
|
$table->data['operations'][1] .= '<span class="with_alerts'.(empty ($alerts) ? ' invisible': '').'">';
|
2009-02-16 13:18:42 +01:00
|
|
|
$table->data['operations'][1] .= print_checkbox ('copy_alerts', 1, true, true);
|
|
|
|
$table->data['operations'][1] .= print_label (__('Copy alerts'), 'checkbox-copy_alerts', true);
|
|
|
|
$table->data['operations'][1] .= '</span>';
|
|
|
|
|
|
|
|
$table->data[1][0] = __('Modules');
|
2009-02-24 17:31:02 +01:00
|
|
|
$table->data[1][1] = '<span class="with_modules'.(empty ($modules) ? ' invisible': '').'">';
|
2009-02-16 13:18:42 +01:00
|
|
|
$table->data[1][1] .= print_select ($modules,
|
|
|
|
'target_modules[]', 0, false, '', '', true, true);
|
|
|
|
$table->data[1][1] .= '</span>';
|
2009-02-24 17:31:02 +01:00
|
|
|
$table->data[1][1] .= '<span class="without_modules'.(! empty ($modules) ? ' invisible': '').'">';
|
2009-02-16 13:18:42 +01:00
|
|
|
$table->data[1][1] .= '<em>'.__('No modules for this agent').'</em>';
|
|
|
|
$table->data[1][1] .= '</span>';
|
|
|
|
|
|
|
|
$table->data[2][0] = __('Alerts');
|
|
|
|
|
|
|
|
$agent_alerts = array ();
|
|
|
|
if ($source_id_agent)
|
|
|
|
$agent_alerts = get_agent_alerts_simple ($source_id_agent);
|
|
|
|
$alerts = array ();
|
|
|
|
foreach ($agent_alerts as $alert) {
|
|
|
|
$name = get_alert_template_name ($alert['id_alert_template']);
|
|
|
|
$name .= ' (<em>'.$modules[$alert['id_agent_module']].'</em>)';
|
|
|
|
$alerts[$alert['id']] = $name;
|
2008-10-14 17:07:53 +02:00
|
|
|
}
|
2009-02-24 17:31:02 +01:00
|
|
|
$table->data[2][1] = '<span class="with_alerts'.(empty ($alerts) ? ' invisible': '').'">';
|
2009-02-16 13:18:42 +01:00
|
|
|
$table->data[2][1] .= print_select ($alerts,
|
|
|
|
'target_alerts[]', 0, false, '', '', true, true);
|
|
|
|
$table->data[2][1] .= '</span>';
|
2009-02-24 17:31:02 +01:00
|
|
|
$table->data[2][1] .= '<span class="without_alerts'.(! empty ($modules) ? ' invisible': '').'">';
|
2009-02-16 13:18:42 +01:00
|
|
|
$table->data[2][1] .= '<em>'.__('No alerts for this agent').'</em>';
|
|
|
|
$table->data[2][1] .= '</span>';
|
|
|
|
|
|
|
|
echo '<div id="modules_loading" class="loading invisible">';
|
2009-02-24 17:31:02 +01:00
|
|
|
print_image ("images/spinner.gif");
|
2009-02-16 13:18:42 +01:00
|
|
|
echo __('Loading').'…';
|
|
|
|
echo '</div>';
|
|
|
|
|
|
|
|
echo '<fieldset id="fieldset_targets"'.($source_id_agent ? '' : ' class="invisible"').'>';
|
|
|
|
echo '<legend><span>'.__('Targets').'</span></legend>';
|
|
|
|
print_table ($table);
|
|
|
|
echo '</fieldset>';
|
|
|
|
|
|
|
|
/* Destiny selection */
|
|
|
|
$table->id = 'destiny_table';
|
|
|
|
$table->data = array ();
|
|
|
|
$table->data[0][0] = __('Group');
|
|
|
|
$table->data[0][1] = print_select ($groups, 'destiny_id_group', $destiny_id_group,
|
|
|
|
false, '', '', true);
|
|
|
|
|
|
|
|
$table->data[1][0] = __('Agent');
|
2009-02-16 17:23:30 +01:00
|
|
|
$table->data[1][0] .= '<span id="destiny_agent_loading" class="invisible">';
|
2009-02-24 17:31:02 +01:00
|
|
|
$table->data[1][0] .= print_image ("images/spinner.gif", true);
|
2009-02-16 17:23:30 +01:00
|
|
|
$table->data[1][0] .= '</span>';
|
2009-02-16 13:18:42 +01:00
|
|
|
$table->data[1][1] = print_select (get_group_agents ($destiny_id_group, false, "none"),
|
|
|
|
'destiny_id_agent[]', 0, false, '', '', true, true);
|
|
|
|
|
|
|
|
echo '<fieldset id="fieldset_destiny"'.($source_id_agent ? '' : ' class="invisible"').'>';
|
|
|
|
echo '<legend><span>'.__('To agent(s)').'</span></legend>';
|
|
|
|
print_table ($table);
|
|
|
|
echo '</fieldset>';
|
|
|
|
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
2009-02-16 13:18:42 +01:00
|
|
|
print_input_hidden ('do_operation', 1);
|
|
|
|
print_submit_button (__('Go'), 'go', false, 'class="sub next"');
|
|
|
|
echo '</div>';
|
|
|
|
echo '</form>';
|
|
|
|
|
2009-02-24 17:31:02 +01:00
|
|
|
echo '<h3 class="error invisible" id="message"> </h3>';
|
2009-02-16 13:18:42 +01:00
|
|
|
|
2009-02-19 Esteban Sanchez <estebans@artica.es>
* include/functions_ui.php: Added require_css_file(),
require_javascript_file() and require_jquery_file() to add CSS,
javascript and jQuery files to the header easily without changing
config object. A path parameter is addded to allow the use on
enterprise code.
* include/functions_db.php: Added
get_db_value_filter(), get_db_all_rows_filter() and
process_sql_delete(). Fixed delete_agent() style and use these
functions. Added process_page_head() from functions_ui.php and changed
a bit the config javascript object part.
* include/functions_custom_graphs.php: Get results indexed by id on
get_user_custom_graphs().
* include/functions.php: Moved process_page_head to functions_ui.php.
* godmode/agentes/manage_delete.php: New interface to perform massive
agents deletion.
* godmode/menu.php: Added new option to massive agents deletion.
* general/main_menu.php, godmode/agentes/manage_config.php,
godmode/agentes/module_manager_editor.php,
godmode/agentes/planned_downtime.php,
godmode/alerts/alert_compounds.php, godmode/alerts/alert_list.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/configure_alert_template.php,
godmode/reporting/map_builder.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
operation/visual_console/render_view.php: Use new functions in include
CSS and javascript files.
* index.php: Bit of style when printing the header so the HTML can be
readed easily in a editor.
* include/javascript/pandora.js: Added a variable to determine the
enterprise directory.
* include/styles/pandora.css: Added style for manage_delete.php
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1467 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-02-19 17:10:04 +01:00
|
|
|
require_jquery_file ('form');
|
|
|
|
require_jquery_file ('pandora.controls');
|
2009-02-16 13:18:42 +01:00
|
|
|
?>
|
|
|
|
<script type="text/javascript">
|
2009-02-24 17:31:02 +01:00
|
|
|
/* <![CDATA[ */
|
2009-03-17 10:22:02 +01:00
|
|
|
var module_alerts;
|
2009-02-16 13:18:42 +01:00
|
|
|
$(document).ready (function () {
|
2009-02-16 17:23:30 +01:00
|
|
|
$("#source_id_group").pandoraSelectGroup ({
|
2009-02-23 17:23:58 +01:00
|
|
|
agentSelect: "select#source_id_agent",
|
|
|
|
loading: "#source_agent_loading"
|
2009-02-16 17:23:30 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$("#destiny_id_group").pandoraSelectGroup ({
|
2009-02-24 17:31:02 +01:00
|
|
|
agentSelect: "select#destiny_id_agent",
|
2009-02-23 17:23:58 +01:00
|
|
|
loading: "#destiny_agent_loading",
|
2009-02-16 17:23:30 +01:00
|
|
|
callbackPost: function (id, value, option) {
|
|
|
|
if ($("#source_id_agent").fieldValue ().in_array (id)) {
|
|
|
|
/* Hide source agent */
|
|
|
|
$(option).hide ();
|
|
|
|
}
|
|
|
|
}
|
2009-02-16 13:18:42 +01:00
|
|
|
});
|
2008-10-14 17:07:53 +02:00
|
|
|
|
2009-02-16 13:18:42 +01:00
|
|
|
$("#source_id_agent").change (function () {
|
|
|
|
var id_agent = this.value;
|
|
|
|
if (id_agent == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
$("#modules_loading").show ();
|
2009-02-24 17:31:02 +01:00
|
|
|
$("#target_modules option, #target_alerts option").remove ();
|
|
|
|
$("#target_modules, #target_alerts").disable ();
|
|
|
|
$("#destiny_id_agent option").show ();
|
|
|
|
$("#destiny_id_agent option[value="+id_agent+"]").hide ();
|
2009-02-16 13:18:42 +01:00
|
|
|
var no_modules;
|
|
|
|
var no_alerts;
|
|
|
|
/* Get modules */
|
|
|
|
jQuery.post ("ajax.php",
|
|
|
|
{"page" : "operation/agentes/ver_agente",
|
|
|
|
"get_agent_modules_json" : 1,
|
|
|
|
"id_agent" : this.value,
|
2009-03-17 16:15:55 +01:00
|
|
|
"filter" : "disabled = 0",
|
|
|
|
"fields" : "id_agente_modulo,nombre"
|
2009-02-16 13:18:42 +01:00
|
|
|
},
|
|
|
|
function (data, status) {
|
|
|
|
if (data.length == 0) {
|
|
|
|
no_modules = true;
|
|
|
|
} else {
|
|
|
|
jQuery.each (data, function (i, val) {
|
|
|
|
option = $("<option></option>")
|
|
|
|
.attr ("value", val["id_agente_modulo"])
|
|
|
|
.append (val["nombre"]);
|
2009-02-24 17:31:02 +01:00
|
|
|
$("#target_modules").append (option);
|
2009-02-16 13:18:42 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
no_modules = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Get alerts */
|
|
|
|
jQuery.post ("ajax.php",
|
2009-02-18 13:29:30 +01:00
|
|
|
{"page" : "godmode/alerts/alert_list",
|
2009-02-16 13:18:42 +01:00
|
|
|
"get_agent_alerts_simple" : 1,
|
|
|
|
"id_agent" : id_agent
|
|
|
|
},
|
|
|
|
function (data, status) {
|
2009-03-17 10:22:02 +01:00
|
|
|
module_alerts = Array ();
|
2009-02-16 13:18:42 +01:00
|
|
|
if (! data) {
|
|
|
|
no_alerts = true;
|
|
|
|
} else {
|
|
|
|
jQuery.each (data, function (i, val) {
|
|
|
|
module_name = $("<em></em>").append (val["module_name"]);
|
|
|
|
option = $("<option></option>")
|
|
|
|
.attr ("value", val["id"])
|
|
|
|
.append (val["template"]["name"])
|
|
|
|
.append (" (")
|
|
|
|
.append (module_name)
|
|
|
|
.append (")");
|
2009-02-24 17:31:02 +01:00
|
|
|
$("#target_alerts").append (option);
|
2009-03-17 10:22:02 +01:00
|
|
|
module_alerts[val["id"]] = val["id_agent_module"];
|
2009-02-16 13:18:42 +01:00
|
|
|
});
|
|
|
|
no_alerts = false;
|
|
|
|
}
|
|
|
|
$("#modules_loading").hide ();
|
|
|
|
|
|
|
|
if (no_modules && no_alerts) {
|
|
|
|
/* Nothing to export from selected agent */
|
|
|
|
$("#fieldset_destiny").hide ();
|
|
|
|
|
|
|
|
$("span.without_modules, span.without_alerts").show ();
|
|
|
|
$("span.with_modules, span.with_alerts, #target_table-operations").hide ();
|
|
|
|
} else {
|
|
|
|
if (no_modules) {
|
|
|
|
$("span.without_modules").show ();
|
|
|
|
$("span.with_modules").hide ();
|
|
|
|
$("#checkbox-copy_modules").uncheck ();
|
|
|
|
} else {
|
|
|
|
$("span.without_modules").hide ();
|
|
|
|
$("span.with_modules").show ();
|
|
|
|
$("#checkbox-copy_modules").check ();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (no_alerts) {
|
|
|
|
$("span.without_alerts").show ();
|
|
|
|
$("span.with_alerts").hide ();
|
|
|
|
$("#checkbox-copy_alerts").uncheck ();
|
|
|
|
} else {
|
|
|
|
$("span.without_alerts").hide ();
|
|
|
|
$("span.with_alerts").show ();
|
|
|
|
$("#checkbox-copy_alerts").check ();
|
|
|
|
}
|
|
|
|
$("#fieldset_destiny, #target_table-operations").show ();
|
|
|
|
}
|
|
|
|
$("#fieldset_targets").show ();
|
2009-02-24 17:31:02 +01:00
|
|
|
$("#target_modules, #target_alerts").enable ();
|
2009-02-16 13:18:42 +01:00
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2009-03-17 10:22:02 +01:00
|
|
|
$("#target_alerts").change (function () {
|
|
|
|
jQuery.each ($(this).fieldValue (), function () {
|
|
|
|
if (module_alerts[this] != undefined)
|
|
|
|
$("#target_modules option[value="+module_alerts[this]+"]")
|
|
|
|
.attr ("selected", "selected");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2009-02-16 13:18:42 +01:00
|
|
|
$("#manage_config_form").submit (function () {
|
|
|
|
$("h3:not([id=message])").remove ();
|
|
|
|
if ($("#source_id_agent").attr ("value") == 0) {
|
|
|
|
$("#message").showMessage ("<?php echo __('No source agent to copy') ?>");
|
|
|
|
return false;
|
|
|
|
}
|
2008-06-16 20:09:56 +02:00
|
|
|
|
2009-02-16 13:18:42 +01:00
|
|
|
copy_modules = $("#checkbox-copy_modules");
|
|
|
|
copy_alerts = $("#checkbox-copy_alerts");
|
2008-10-10 17:08:31 +02:00
|
|
|
|
2009-02-16 13:18:42 +01:00
|
|
|
if (! $(copy_modules).attr ("checked") && ! $(copy_alerts).attr ("checked")) {
|
|
|
|
$("#message").showMessage ("<?php echo __('No operation selected') ?>");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-03-04 16:59:00 +01:00
|
|
|
if ($(copy_modules).attr ("checked") && $("#target_modules").fieldValue ().length == 0) {
|
2009-02-16 13:18:42 +01:00
|
|
|
$("#message").showMessage ("<?php echo __('No modules have been selected') ?>");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2009-02-24 17:31:02 +01:00
|
|
|
if ($("#destiny_id_agent").fieldValue ().length == 0) {
|
2009-02-16 13:18:42 +01:00
|
|
|
$("#message").showMessage ("<?php echo __('No destiny agent(s) to copy') ?>");
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
$("#message").hide ();
|
|
|
|
return true;
|
|
|
|
});
|
|
|
|
});
|
2009-02-24 17:31:02 +01:00
|
|
|
/* ]]> */
|
2009-02-16 13:18:42 +01:00
|
|
|
</script>
|