2019-01-30 16:18:44 +01:00
|
|
|
<?php
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2009-06-08 20:21:21 +02:00
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
2010-03-02 18:19:44 +01:00
|
|
|
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
|
2009-06-08 20:21:21 +02:00
|
|
|
// Please see http://pandorafms.org for full contribution list
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation for version 2.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
// Load global vars
|
2010-03-02 Sancho Lerena <slerena@artica.es>
* include/functions_reporting.php: Solved issue with several undefined
vars.
* include/functions_servers.php: Solved issue with several undefined
vars.
* include/functions_config.php: Added metaconsola witch to readconfig.
* include/config_process.php: Update build.. is YYMMDD !
* include/functions_ui.php: Removed deprecated call to split and replaced
by preg_split.
* index.php: Activated developer mode.
* operation/agentes/estado_monitores.php: Solved small problem with modules
without history, filling missing column in table. Added headers
* godmode/alerts/configure_alert_compound.php,
operation/agentes/status_monitor.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_commands.php,
godmode/modules/manage_network_templates.php,
godmode/modules/module_list.php,
godmode/modules/manage_network_components.php,
godmode/modules/manage_nc_groups.php: Removed deprecated call to include
config.php and in some cases, added new header style.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2444 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-03-02 15:13:00 +01:00
|
|
|
global $config;
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
require_once $config['homedir'].'/include/functions_alerts.php';
|
|
|
|
require_once $config['homedir'].'/include/functions_users.php';
|
|
|
|
enterprise_include_once('meta/include/functions_alerts_meta.php');
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
check_login();
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2015-03-06 12:28:05 +01:00
|
|
|
enterprise_hook('open_meta_frame');
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (! check_acl($config['id_user'], 0, 'LM')) {
|
|
|
|
db_pandora_audit(
|
|
|
|
'ACL Violation',
|
|
|
|
'Trying to access Alert Management'
|
|
|
|
);
|
|
|
|
include 'general/noaccess.php';
|
|
|
|
exit;
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
}
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$id = (int) get_parameter('id');
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$al_action = alerts_get_alert_action($id);
|
2012-12-12 20:37:35 +01:00
|
|
|
$pure = get_parameter('pure', 0);
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
$sec = 'advanced';
|
|
|
|
} else {
|
|
|
|
$sec = 'galertas';
|
|
|
|
}
|
2011-02-15 14:17:26 +01:00
|
|
|
|
2013-06-04 18:06:58 +02:00
|
|
|
if ($al_action !== false) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$own_info = get_user_info($config['id_user']);
|
|
|
|
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
|
|
|
|
$own_groups = array_keys(users_get_groups($config['id_user'], 'LM'));
|
|
|
|
} else {
|
|
|
|
$own_groups = array_keys(users_get_groups($config['id_user'], 'LM', false));
|
|
|
|
}
|
|
|
|
|
|
|
|
$is_in_group = in_array($al_action['id_group'], $own_groups);
|
|
|
|
|
2020-05-29 11:37:06 +02:00
|
|
|
// Header.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
alerts_meta_print_header();
|
|
|
|
} else {
|
|
|
|
ui_print_page_header(
|
|
|
|
__('Alerts').' » '.__('Configure alert action'),
|
|
|
|
'images/gm_alerts.png',
|
|
|
|
false,
|
2020-08-07 09:36:43 +02:00
|
|
|
'alert_config',
|
2019-01-30 16:18:44 +01:00
|
|
|
true
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} else {
|
2020-05-29 11:37:06 +02:00
|
|
|
// Header.
|
2019-01-30 16:18:44 +01:00
|
|
|
if (defined('METACONSOLE')) {
|
|
|
|
alerts_meta_print_header();
|
|
|
|
} else {
|
|
|
|
ui_print_page_header(
|
|
|
|
__('Alerts').' » '.__('Configure alert action'),
|
|
|
|
'images/gm_alerts.png',
|
|
|
|
false,
|
2020-08-07 09:36:43 +02:00
|
|
|
'alert_config',
|
2019-01-30 16:18:44 +01:00
|
|
|
true
|
|
|
|
);
|
|
|
|
}
|
2012-12-12 20:37:35 +01:00
|
|
|
}
|
2011-02-15 14:17:26 +01:00
|
|
|
|
2013-05-20 10:42:02 +02:00
|
|
|
|
2020-07-13 12:23:46 +02:00
|
|
|
$is_central_policies_on_node = is_central_policies_on_node();
|
|
|
|
|
|
|
|
if ($is_central_policies_on_node === true) {
|
|
|
|
ui_print_warning_message(
|
|
|
|
__('This node is configured with centralized mode. All alerts templates information is read only. Go to metaconsole to manage it.')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
$name = '';
|
|
|
|
$id_command = '';
|
2019-01-30 16:18:44 +01:00
|
|
|
$group = 0;
|
|
|
|
$action_threshold = 0;
|
2020-07-13 12:23:46 +02:00
|
|
|
// All group is 0.
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
if ($id) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$action = alerts_get_alert_action($id);
|
|
|
|
$name = $action['name'];
|
|
|
|
$id_command = $action['id_alert_command'];
|
|
|
|
|
|
|
|
$group = $action['id_group'];
|
|
|
|
$action_threshold = $action['action_threshold'];
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
}
|
|
|
|
|
2020-07-13 12:23:46 +02:00
|
|
|
// Hidden div with help hint to fill with javascript.
|
2015-03-10 15:36:23 +01:00
|
|
|
html_print_div(
|
2019-01-30 16:18:44 +01:00
|
|
|
[
|
|
|
|
'id' => 'help_alert_macros_hint',
|
|
|
|
'content' => ui_print_help_icon('alert_macros', true),
|
|
|
|
'hidden' => true,
|
|
|
|
]
|
|
|
|
);
|
2013-03-06 13:43:20 +01:00
|
|
|
|
2015-06-25 10:07:53 +02:00
|
|
|
$table = new stdClass();
|
2013-04-10 09:57:54 +02:00
|
|
|
$table->id = 'table_macros';
|
2015-06-16 16:09:50 +02:00
|
|
|
$table->width = '100%';
|
|
|
|
$table->class = 'databox filters';
|
|
|
|
|
2015-03-10 15:36:23 +01:00
|
|
|
if (defined('METACONSOLE')) {
|
2019-01-30 16:18:44 +01:00
|
|
|
if ($id) {
|
|
|
|
$table->head[0] = __('Update Action');
|
|
|
|
} else {
|
|
|
|
$table->head[0] = __('Create Action');
|
|
|
|
}
|
|
|
|
|
|
|
|
$table->head_colspan[0] = 4;
|
|
|
|
$table->headstyle[0] = 'text-align: center';
|
2015-03-06 12:28:05 +01:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
$table->style = [];
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
$table->style[0] = 'font-weight: bold';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->size = [];
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
$table->size[0] = '20%';
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data = [];
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
$table->data[0][0] = __('Name');
|
2020-07-13 12:23:46 +02:00
|
|
|
$table->data[0][1] = html_print_input_text(
|
|
|
|
'name',
|
|
|
|
$name,
|
|
|
|
'',
|
|
|
|
35,
|
|
|
|
255,
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
false,
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
$is_central_policies_on_node
|
|
|
|
);
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
if (io_safe_output($name) == 'Monitoring Event') {
|
|
|
|
$table->data[0][1] .= ' '.ui_print_help_tip(
|
|
|
|
__('This action may stop working, if you change its name.'),
|
|
|
|
true,
|
|
|
|
'images/header_yellow.png'
|
|
|
|
);
|
2018-05-24 11:37:26 +02:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
|
2014-03-05 12:34:05 +01:00
|
|
|
$table->colspan[0][1] = 2;
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2010-02-25 20:17:59 +01:00
|
|
|
$table->data[1][0] = __('Group');
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$own_info = get_user_info($config['id_user']);
|
|
|
|
|
2020-09-28 18:04:46 +02:00
|
|
|
$table->data[1][1] = '<div class="w250px inline">'.html_print_select_groups(
|
2020-07-13 12:23:46 +02:00
|
|
|
false,
|
|
|
|
'LW',
|
|
|
|
true,
|
|
|
|
'group',
|
|
|
|
$group,
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
0,
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
true,
|
|
|
|
'',
|
|
|
|
$is_central_policies_on_node
|
2020-09-28 18:04:46 +02:00
|
|
|
).'</div>';
|
2014-03-05 12:34:05 +01:00
|
|
|
$table->colspan[1][1] = 2;
|
2010-02-25 20:17:59 +01:00
|
|
|
|
|
|
|
$table->data[2][0] = __('Command');
|
2018-10-23 10:53:09 +02:00
|
|
|
$commands_sql = db_get_all_rows_filter(
|
2019-01-30 16:18:44 +01:00
|
|
|
'talert_commands',
|
|
|
|
['id_group' => array_keys(users_get_groups(false, 'LW'))],
|
|
|
|
[
|
|
|
|
'id',
|
|
|
|
'name',
|
|
|
|
],
|
|
|
|
'AND',
|
|
|
|
false,
|
|
|
|
true
|
2018-10-23 10:53:09 +02:00
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[2][1] = html_print_select_from_sql(
|
|
|
|
$commands_sql,
|
|
|
|
'id_command',
|
|
|
|
$id_command,
|
|
|
|
'',
|
|
|
|
__('None'),
|
|
|
|
0,
|
2020-07-13 12:23:46 +02:00
|
|
|
true,
|
|
|
|
false,
|
|
|
|
false,
|
|
|
|
$is_central_policies_on_node
|
2018-10-23 10:53:09 +02:00
|
|
|
);
|
2010-07-18 13:13:38 +02:00
|
|
|
$table->data[2][1] .= ' ';
|
2020-07-13 12:23:46 +02:00
|
|
|
if ($is_central_policies_on_node === false
|
|
|
|
&& check_acl($config['id_user'], 0, 'PM')
|
|
|
|
) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[2][1] .= __('Create Command');
|
2019-12-05 16:43:26 +01:00
|
|
|
$table->data[2][1] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
|
|
|
|
$table->data[2][1] .= html_print_image('images/add.png', true);
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[2][1] .= '</a>';
|
2011-02-16 19:39:28 +01:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
|
2012-05-21 12:28:35 +02:00
|
|
|
$table->data[2][1] .= '<div id="command_description" style=""></div>';
|
2014-03-05 12:34:05 +01:00
|
|
|
$table->colspan[2][1] = 2;
|
|
|
|
|
2011-02-15 17:40:23 +01:00
|
|
|
$table->data[3][0] = __('Threshold');
|
2020-01-16 13:50:39 +01:00
|
|
|
$table->data[3][1] = html_print_extended_select_for_time(
|
|
|
|
'action_threshold',
|
|
|
|
$action_threshold,
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
'',
|
|
|
|
false,
|
|
|
|
true,
|
|
|
|
false,
|
|
|
|
true,
|
|
|
|
'',
|
2020-07-13 12:23:46 +02:00
|
|
|
$is_central_policies_on_node,
|
2020-01-16 13:50:39 +01:00
|
|
|
false,
|
|
|
|
'',
|
|
|
|
false,
|
|
|
|
true
|
|
|
|
);
|
2014-03-05 12:34:05 +01:00
|
|
|
$table->colspan[3][1] = 2;
|
|
|
|
|
|
|
|
$table->data[4][0] = '';
|
|
|
|
$table->data[4][1] = __('Firing');
|
|
|
|
$table->data[4][2] = __('Recovery');
|
|
|
|
$table->cellstyle[4][1] = 'font-weight: bold;';
|
|
|
|
$table->cellstyle[4][2] = 'font-weight: bold;';
|
|
|
|
|
|
|
|
$table->data[5][0] = __('Command preview');
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data[5][1] = html_print_textarea(
|
|
|
|
'command_preview',
|
|
|
|
5,
|
|
|
|
30,
|
|
|
|
'',
|
|
|
|
'disabled="disabled"',
|
|
|
|
true
|
|
|
|
);
|
|
|
|
$table->data[5][2] = html_print_textarea(
|
|
|
|
'command_recovery_preview',
|
|
|
|
5,
|
|
|
|
30,
|
|
|
|
'',
|
|
|
|
'disabled="disabled"',
|
|
|
|
true
|
|
|
|
);
|
2014-03-05 12:34:05 +01:00
|
|
|
|
2017-02-07 10:41:48 +01:00
|
|
|
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
2019-01-30 16:18:44 +01:00
|
|
|
$table->data['field'.$i][0] = html_print_image(
|
|
|
|
'images/spinner.gif',
|
|
|
|
true
|
|
|
|
);
|
|
|
|
$table->data['field'.$i][1] = html_print_image(
|
|
|
|
'images/spinner.gif',
|
|
|
|
true
|
|
|
|
);
|
|
|
|
$table->data['field'.$i][2] = html_print_image(
|
|
|
|
'images/spinner.gif',
|
|
|
|
true
|
|
|
|
);
|
|
|
|
|
|
|
|
// Store the value in a hidden to keep it on first execution
|
|
|
|
$table->data['field'.$i][1] .= html_print_input_hidden(
|
|
|
|
'field'.$i.'_value',
|
2020-07-06 14:35:22 +02:00
|
|
|
(!empty($action['field'.$i]) || $action['field'.$i] == 0) ? $action['field'.$i] : '',
|
2019-01-30 16:18:44 +01:00
|
|
|
true
|
|
|
|
);
|
|
|
|
$table->data['field'.$i][2] .= html_print_input_hidden(
|
|
|
|
'field'.$i.'_recovery_value',
|
2020-07-06 14:35:22 +02:00
|
|
|
(!empty($action['field'.$i.'_recovery']) || $action['field'.$i] == 0) ? $action['field'.$i.'_recovery'] : '',
|
2019-01-30 16:18:44 +01:00
|
|
|
true
|
|
|
|
);
|
2012-10-29 09:45:06 +01:00
|
|
|
}
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
|
2018-03-22 13:34:15 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
echo '<form method="post" action="'.'index.php?sec='.$sec.'&'.'sec2=godmode/alerts/alert_actions&'.'pure='.$pure.'">';
|
|
|
|
$table_html = html_print_table($table, true);
|
2014-08-26 Miguel de Dios <miguel.dedios@artica.es>
* godmode/alerts/configure_alert_action.php,
include/help/clippy/godmode_agentes_modificar_agente.php,
include/help/clippy/homepage.php,
include/help/clippy/module_unknow.php,
include/help/clippy/godmode_agentes_configurar_agente.php,
include/help/clippy/godmode_alerts_alert_actions.php,
include/help/clippy/operation_agentes_ver_agente.php,
include/help/clippy/godmode_alerts_configure_alert_action.php,
include/help/clippy/operation_agentes_status_monitor.php,
include/help/en/help_context_pandora_server_email.php,
include/functions_clippy.php, operation/menu.php,
operation/agentes/status_monitor.php: some changes suggested by
Carla.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10457 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2014-08-26 13:22:06 +02:00
|
|
|
|
|
|
|
echo $table_html;
|
2020-07-13 12:23:46 +02:00
|
|
|
if ($is_central_policies_on_node === false) {
|
|
|
|
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
|
|
|
if ($id) {
|
|
|
|
html_print_input_hidden('id', $id);
|
|
|
|
if ($al_action['id_group'] == 0) {
|
|
|
|
// Then must have "PM" access privileges.
|
|
|
|
if (check_acl($config['id_user'], 0, 'PM')) {
|
|
|
|
html_print_input_hidden('update_action', 1);
|
|
|
|
html_print_submit_button(
|
|
|
|
__('Update'),
|
|
|
|
'create',
|
|
|
|
false,
|
|
|
|
'class="sub upd"'
|
|
|
|
);
|
|
|
|
}
|
|
|
|
} else {
|
2019-01-30 16:18:44 +01:00
|
|
|
html_print_input_hidden('update_action', 1);
|
2020-07-13 12:23:46 +02:00
|
|
|
html_print_submit_button(
|
|
|
|
__('Update'),
|
|
|
|
'create',
|
|
|
|
false,
|
|
|
|
'class="sub upd"'
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
|
|
|
} else {
|
2020-07-13 12:23:46 +02:00
|
|
|
html_print_input_hidden('create_action', 1);
|
|
|
|
html_print_submit_button(
|
|
|
|
__('Create'),
|
|
|
|
'create',
|
|
|
|
false,
|
|
|
|
'class="sub wand"'
|
|
|
|
);
|
2019-01-30 16:18:44 +01:00
|
|
|
}
|
2020-07-13 12:23:46 +02:00
|
|
|
|
|
|
|
echo '</div>';
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
echo '</form>';
|
2009-03-04 16:59:00 +01:00
|
|
|
|
2013-05-20 10:42:02 +02:00
|
|
|
enterprise_hook('close_meta_frame');
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
ui_require_javascript_file('pandora_alerts');
|
2015-02-04 16:52:20 +01:00
|
|
|
ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
?>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready (function () {
|
2019-02-01 09:55:29 +01:00
|
|
|
var original_command;
|
|
|
|
var origicommand_descriptionnal_command;
|
|
|
|
|
|
|
|
if (<?php echo (int) $id_command; ?>) {
|
2020-03-18 12:25:29 +01:00
|
|
|
original_command = "<?php echo str_replace("\r\n", '<br>', addslashes(io_safe_output(alerts_get_alert_command_command($id_command)))); ?>";
|
2019-02-01 09:55:29 +01:00
|
|
|
render_command_preview(original_command);
|
2019-01-30 16:18:44 +01:00
|
|
|
command_description = "<?php echo str_replace("\r\n", '<br>', addslashes(io_safe_output(alerts_get_alert_command_description($id_command)))); ?>";
|
|
|
|
|
|
|
|
render_command_description(command_description);
|
|
|
|
}
|
2019-02-01 09:55:29 +01:00
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
$("#id_command").change (function () {
|
|
|
|
values = Array ();
|
|
|
|
values.push({
|
|
|
|
name: "page",
|
|
|
|
value: "godmode/alerts/alert_commands"});
|
|
|
|
values.push({
|
|
|
|
name: "get_alert_command",
|
|
|
|
value: "1"});
|
|
|
|
values.push({
|
|
|
|
name: "id",
|
|
|
|
value: this.value});
|
|
|
|
|
|
|
|
jQuery.post (<?php echo "'".ui_get_full_url('ajax.php', false, false, false)."'"; ?>,
|
|
|
|
values,
|
|
|
|
function (data, status) {
|
2019-04-01 17:57:22 +02:00
|
|
|
original_command = data["command"];
|
2019-01-30 16:18:44 +01:00
|
|
|
render_command_preview (original_command);
|
2019-04-01 17:57:22 +02:00
|
|
|
command_description = data["description"];
|
2019-12-05 16:43:26 +01:00
|
|
|
if (command_description != undefined) {
|
|
|
|
render_command_description(command_description);
|
|
|
|
} else {
|
|
|
|
render_command_description('');
|
|
|
|
|
|
|
|
}
|
2019-01-30 16:18:44 +01:00
|
|
|
|
|
|
|
var max_fields = parseInt('<?php echo $config['max_macro_fields']; ?>');
|
|
|
|
|
|
|
|
// Change the selected group
|
|
|
|
$("#group option").each(function(index, value) {
|
|
|
|
var current_group = $(value).val();
|
|
|
|
});
|
|
|
|
if (data.id_group != 0 && $("#group").val() != data.id_group) {
|
|
|
|
$("#group").val(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 1; i <= max_fields; i++) {
|
|
|
|
var old_value = '';
|
|
|
|
var old_recovery_value = '';
|
|
|
|
var field_row = data["fields_rows"][i];
|
|
|
|
var $table_macros_field = $('#table_macros-field' + i);
|
|
|
|
|
|
|
|
// If the row is empty, hide it
|
|
|
|
if (field_row == '') {
|
|
|
|
$table_macros_field.hide();
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
old_value = '';
|
|
|
|
old_recovery_value = '';
|
|
|
|
// Only keep the value if is provided from hidden (first time)
|
|
|
|
if (($("[name=field" + i + "_value]").attr('id'))
|
|
|
|
== ("hidden-field" + i + "_value")) {
|
|
|
|
|
|
|
|
old_value = $("[name=field" + i + "_value]").val();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (($("[name=field" + i + "_recovery_value]").attr('id'))
|
|
|
|
== ("hidden-field" + i + "_recovery_value")) {
|
|
|
|
|
|
|
|
old_recovery_value =
|
|
|
|
$("[name=field" + i + "_recovery_value]").val();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Replace the old column with the new
|
|
|
|
$table_macros_field.replaceWith(field_row);
|
|
|
|
if (old_value != '' || old_recovery_value != '') {
|
|
|
|
var inputType = $("[name=field" + i + "_value]").attr('type')
|
|
|
|
if (inputType == 'radio') {
|
|
|
|
if(old_value == 'text/plain'){
|
|
|
|
if ($("[name=field" + i + "_value]").val() == 'text/plain') {
|
|
|
|
$("[name=field" + i + "_value]").attr('checked','checked');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
if($("[name=field" + i + "_value]").val() == 'text/html') {
|
|
|
|
$("[name=field" + i + "_value]").attr('checked','checked');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(old_recovery_value == 'text/plain'){
|
|
|
|
if ($("[name=field" + i + "_recovery_value]").val() == 'text/plain') {
|
|
|
|
$("[name=field" + i + "_recovery_value]").attr('checked','checked');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
if ($("[name=field" + i + "_recovery_value]").val() == 'text/html') {
|
|
|
|
$("[name=field" + i + "_recovery_value]").attr('checked','checked');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$("[name=field" + i + "_value]").val(old_value);
|
|
|
|
$("[name=field" + i + "_recovery_value]").val(old_recovery_value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ($("[name=field" + i + "_value]").val() != 'text/plain') {
|
|
|
|
$("[name=field" + i + "_value]")
|
|
|
|
.val($("[name=field" + i + "_value]")
|
|
|
|
.val());
|
|
|
|
$("[name=field" + i + "_recovery_value]")
|
|
|
|
.val($("[name=field" + i + "_recovery_value]")
|
|
|
|
.val());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Add help hint only in first field
|
|
|
|
if (i == 1) {
|
|
|
|
var td_content = $table_macros_field.find('td').eq(0);
|
|
|
|
|
|
|
|
$(td_content)
|
|
|
|
.html(
|
|
|
|
$(td_content).html() +
|
|
|
|
$('#help_alert_macros_hint').html());
|
|
|
|
}
|
|
|
|
|
|
|
|
$table_macros_field.show();
|
|
|
|
}
|
|
|
|
|
2019-11-26 13:19:28 +01:00
|
|
|
var added_config = {
|
|
|
|
"selector": "textarea.tiny-mce-editor",
|
|
|
|
"plugins": "preview, print, table, searchreplace, nonbreaking, xhtmlxtras, noneditable",
|
|
|
|
"theme_advanced_buttons1": "bold,italic,underline,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect",
|
|
|
|
"theme_advanced_buttons2": "search,replace,|,bullist,numlist,|,undo,redo,|,link,unlink,image,|,cleanup,code,preview,|,forecolor,backcolor",
|
|
|
|
"valid_children": "+body[style]",
|
|
|
|
"width": "90%",
|
|
|
|
}
|
|
|
|
defineTinyMCE(added_config);
|
|
|
|
|
2019-01-30 16:18:44 +01:00
|
|
|
render_command_preview(original_command);
|
|
|
|
render_command_recovery_preview(original_command);
|
|
|
|
|
|
|
|
$(".fields").keyup(function() {
|
|
|
|
render_command_preview(original_command);
|
|
|
|
});
|
|
|
|
$(".fields_recovery").keyup(function() {
|
|
|
|
render_command_recovery_preview(original_command);
|
|
|
|
});
|
|
|
|
$("select.fields").change(function() {
|
|
|
|
render_command_preview(original_command);
|
|
|
|
});
|
|
|
|
$("select.fields_recovery").change(function() {
|
|
|
|
render_command_recovery_preview(original_command);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
"json"
|
|
|
|
);
|
|
|
|
}).change();
|
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
|
|
|
});
|
2012-10-30 17:52:56 +01:00
|
|
|
|
2012-10-29 09:45:06 +01:00
|
|
|
</script>
|