2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// Pandora FMS - http://pandorafms.com
|
|
|
|
// ==================================================
|
|
|
|
// Copyright (c) 2005-2009 Artica Soluciones Tecnologicas
|
|
|
|
// Please see http://pandorafms.org for full contribution list
|
|
|
|
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation for version 2.
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
|
|
function forceExecution($id_group) {
|
|
|
|
global $config;
|
|
|
|
|
|
|
|
require_once ("include/functions_alerts.php");
|
|
|
|
$id_alert = (int) get_parameter ('id_alert');
|
|
|
|
set_alerts_agent_module_force_execution ($id_alert);
|
|
|
|
}
|
|
|
|
|
|
|
|
function validateAlert() {
|
|
|
|
$ids = (array) get_parameter_post ("validate", array ());
|
|
|
|
$compound_ids = (array) get_parameter_post ("validate_compound", array ());
|
|
|
|
|
|
|
|
if (! empty ($ids) || ! empty ($compound_ids)) {
|
|
|
|
require_once ("include/functions_alerts.php");
|
|
|
|
$result1 = validate_alert_agent_module ($ids);
|
|
|
|
$result2 = validate_alert_compound ($compound_ids);
|
2010-05-03 11:02:18 +02:00
|
|
|
$result = $result1 || $result2;
|
2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
|
|
|
|
print_result_message ($result,
|
|
|
|
__('Alert(s) validated'),
|
|
|
|
__('Error processing alert(s)'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-04-06 17:08:08 +02:00
|
|
|
function printFormFilterAlert($id_group, $filter, $free_search, $url) {
|
2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
$table->width = '90%';
|
|
|
|
$table->data = array ();
|
|
|
|
$table->style = array ();
|
|
|
|
|
|
|
|
$table->data[0][0] = __('Group');
|
2010-07-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_html.php: added the function "print_select_groups" to
print the field select box for groups with tree style.
* include/functions_db.php: in function "get_user_groups" added test to
false value in parameter $privilege for get all groups without ACL test.
Fixed in function "get_user_groups_tree" the call to "get_user_groups" with
the correct parameters.
* operation/incidents/incident.php, operation/incidents/incident_detail.php,
operation/events/events.php, operation/agentes/status_monitor.php,
operation/agentes/estado_agente.php,
operation/agentes/alerts_status.functions.php,
operation/agentes/exportdata.php, operation/agentes/networkmap.php,
operation/messages/message.php, general/ui/agents_list.php,
godmode/groups/configure_group.php, godmode/groups/group_list.php,
godmode/agentes/massive_add_alerts.php,
godmode/agentes/massive_delete_agents.php,
godmode/agentes/massive_config.php,
godmode/agentes/massive_delete_action_alerts.php,
godmode/agentes/massive_delete_alerts.php,
godmode/agentes/modificar_agente.php,
godmode/agentes/massive_delete_modules.php,
godmode/agentes/massive_add_action_alerts.php,
godmode/agentes/planned_downtime.php,
godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php,
godmode/servers/manage_recontask_form.php,
godmode/alerts/configure_alert_compound.php,
godmode/alerts/alert_compounds.php,
godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php, godmode/setup/gis_step_2.php,
godmode/users/configure_user.php, godmode/gis_maps/configure_gis_map.php,
godmode/reporting/graph_builder.main.php,
godmode/reporting/reporting_builder.main.php,
godmode/reporting/visual_console_builder.data.php: changed the fields select
box of group to tree style select box for groups.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3009 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-07-15 17:20:43 +02:00
|
|
|
$table->data[0][1] = print_select_groups(false, "AR", true, "ag_group", $id_group,
|
2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
'javascript:this.form.submit();', '', '', true);
|
|
|
|
|
|
|
|
$alert_status_filter = array();
|
|
|
|
$alert_status_filter['all_enabled'] = __('All (Enabled)');
|
|
|
|
$alert_status_filter['all'] = __('All');
|
|
|
|
$alert_status_filter['fired'] = __('Fired');
|
|
|
|
$alert_status_filter['notfired'] = __('Not fired');
|
|
|
|
$alert_status_filter['disabled'] = __('Disabled');
|
|
|
|
|
|
|
|
$table->data[0][2] = __('Status');
|
|
|
|
$table->data[0][3] = print_select ($alert_status_filter, "filter", $filter, 'javascript:this.form.submit();', '', '', true);
|
2010-04-06 17:08:08 +02:00
|
|
|
$table->data[1][0] = __('Free text for search')
|
|
|
|
. '<a href="#" class="tip"> <span>' . __("Filter by agent name, module name, template name or action name") . '</span></a>';
|
|
|
|
$table->data[1][1] = print_input_text('free_search', $free_search, '', 20, 40, true);
|
|
|
|
$table->colspan[1][2] = 2;
|
|
|
|
$table->data[1][2] = print_submit_button(__('Filter'), 'filter_button', false, 'class="sub search"', true);
|
2010-04-05 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_ui.php: changed some parts of source code in the
functions "format_alert_row" for show column modules in general view. In the
function "pagination" added the parameter $offset_name with default value
'offset' for to use several paginations in one page.
* include/functions_agents.php: added the parameters $limit, $idGroup,
$count in the function "get_agent_alerts_simple", and now you can limit the
rows, search by id group and return the count of rows (without limit). And
in the function "get_agent_alerts_compound" added the same parameters to
another function $idGroup, $limit, $count for similar uses.
* operation/agentes/alerts_status.php: cleaned more parts of source code,
fixed the mad array_merge of alerts, fixed SQL with the searchs IN
(large large list ids), fixed the pagination before loop all rows, now
only loop the block page rows.
* operation/agentes/alerts_status.functions.php: new file with the functions
"forceExecution", "validateAlert", and "printFormFilterAlert".
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2542 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-04-06 14:46:34 +02:00
|
|
|
|
|
|
|
echo '<form method="post" action="'.$url.'">';
|
|
|
|
print_table ($table);
|
|
|
|
echo '</form>';
|
|
|
|
}
|
2010-05-03 11:02:18 +02:00
|
|
|
?>
|