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');
|
2011-04-15 12:57:43 +02:00
|
|
|
alerts_agent_module_force_execution ($id_alert);
|
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
|
|
|
}
|
|
|
|
|
|
|
|
function validateAlert() {
|
|
|
|
$ids = (array) get_parameter_post ("validate", array ());
|
|
|
|
|
2013-01-29 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/reporting_builder.php,
godmode/agentes/configurar_agente.php, godmode/menu.php,
include/functions_ui.php, include/functions_agents.php,
include/functions_alerts.php, include/functions_menu.php,
include/functions_networkmap.php,
include/help/en/help_alert_type.php,
include/help/es/help_alert_type.php,
include/functions_reporting.php,
operation/agentes/alerts_status.functions.php,
operation/agentes/alerts_status.php: erased the ocurrences about
the deprecated alert compounds.
Fixes: #3602487
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7543 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-29 15:42:55 +01:00
|
|
|
if (!empty($ids)) {
|
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
|
|
|
require_once ("include/functions_alerts.php");
|
2013-01-29 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/visual_console_builder.wizard.php,
godmode/reporting/reporting_builder.php,
godmode/agentes/configurar_agente.php, godmode/menu.php,
include/functions_ui.php, include/functions_agents.php,
include/functions_alerts.php, include/functions_menu.php,
include/functions_networkmap.php,
include/help/en/help_alert_type.php,
include/help/es/help_alert_type.php,
include/functions_reporting.php,
operation/agentes/alerts_status.functions.php,
operation/agentes/alerts_status.php: erased the ocurrences about
the deprecated alert compounds.
Fixes: #3602487
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7543 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2013-01-29 15:42:55 +01:00
|
|
|
$result = alerts_validate_alert_agent_module ($ids);
|
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
|
|
|
|
2011-04-13 18:11:02 +02:00
|
|
|
ui_print_result_message ($result,
|
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
|
|
|
__('Alert(s) validated'),
|
|
|
|
__('Error processing alert(s)'));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-08 18:11:26 +01:00
|
|
|
function printFormFilterAlert($id_group, $filter, $free_search, $url, $filter_standby = false, $tag_filter = false, $return = false, $strict_user = false) {
|
|
|
|
|
|
|
|
global $config;
|
|
|
|
require_once ($config['homedir'] . "/include/functions_tags.php");
|
|
|
|
|
2013-05-28 17:18:41 +02:00
|
|
|
$table->width = '100%';
|
2015-04-10 09:43:44 +02:00
|
|
|
$table->class = 'databox filters';
|
2015-03-06 12:28:05 +01:00
|
|
|
if(defined('METACONSOLE')){
|
|
|
|
$table->class = 'databox_filters';
|
2015-03-11 11:31:46 +01:00
|
|
|
$table->width = '96%';
|
|
|
|
$table->cellpadding = '0';
|
|
|
|
$table->cellspacing = '0';
|
2015-03-06 12:28:05 +01:00
|
|
|
}
|
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->data = array ();
|
|
|
|
$table->style = array ();
|
2015-04-10 09:43:44 +02:00
|
|
|
$table->style[0] = 'font-weight: bold;';
|
|
|
|
$table->style[1] = 'font-weight: bold;';
|
|
|
|
$table->style[2] = 'font-weight: bold;';
|
|
|
|
$table->style[3] = 'font-weight: bold;';
|
|
|
|
$table->style[4] = 'font-weight: bold;';
|
2015-03-11 11:31:46 +01:00
|
|
|
if(defined('METACONSOLE')){
|
|
|
|
$table->style[0] = 'vertical-align:middle; font-weight: bold;';
|
|
|
|
$table->style[1] = 'vertical-align:middle; font-weight: bold;';
|
|
|
|
$table->style[2] = 'vertical-align:middle; font-weight: bold;';
|
|
|
|
$table->style[3] = 'vertical-align:middle; font-weight: bold;';
|
|
|
|
$table->style[4] = 'vertical-align:middle; font-weight: bold;';
|
|
|
|
}
|
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->data[0][0] = __('Group');
|
2015-01-08 18:11:26 +01:00
|
|
|
$table->data[0][1] = html_print_select_groups($config['id_user'], "AR", true, "ag_group", $id_group, '', '', '', true, false, false, '', false, '', false, false, 'id_grupo', $strict_user);
|
2013-03-20 18:41:35 +01:00
|
|
|
|
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
|
|
|
$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');
|
2013-03-20 18:41:35 +01:00
|
|
|
$alert_status_filter['disabled'] = __('Disabled');
|
2010-09-17 14:34:11 +02:00
|
|
|
|
|
|
|
$alert_standby = array();
|
|
|
|
$alert_standby['all'] = __('All');
|
|
|
|
$alert_standby['standby_on'] = __('Standby on');
|
|
|
|
$alert_standby['standby_off'] = __('Standby off');
|
2013-03-20 18:41:35 +01:00
|
|
|
|
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->data[0][2] = __('Status');
|
2011-07-27 11:07:37 +02:00
|
|
|
$table->data[0][3] = html_print_select ($alert_status_filter, "filter", $filter, '', '', '', true);
|
2015-01-08 18:11:26 +01:00
|
|
|
|
|
|
|
$table->data[0][4] = __('Tags') . ui_print_help_tip(__('Only it is show tags in use.'), true);
|
|
|
|
|
|
|
|
$tags = tags_get_user_tags();
|
|
|
|
|
|
|
|
if (empty($tags)) {
|
2015-03-13 10:52:49 +01:00
|
|
|
$table->data[0][4] .= html_print_input_text('tags', __('No tags'), '', 20, 40, true,true);
|
2015-01-08 18:11:26 +01:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
$table->data[0][4] .= html_print_select ($tags, "tag_filter", $tag_filter, '', __('All'), '', true, false, true, '', false, 'width: 150px;');
|
|
|
|
}
|
|
|
|
|
2013-05-23 13:00:55 +02:00
|
|
|
$table->data[1][0] = __('Free text for search') .
|
|
|
|
ui_print_help_tip(
|
|
|
|
__("Filter by agent name, module name, template name or action name"),
|
|
|
|
true);
|
2011-04-27 15:43:31 +02:00
|
|
|
$table->data[1][1] = html_print_input_text('free_search', $free_search, '', 20, 40, true);
|
2010-09-17 14:34:11 +02:00
|
|
|
$table->data[1][2] = __('Standby');
|
2011-07-26 14:04:28 +02:00
|
|
|
$table->data[1][3] = html_print_select ($alert_standby, "filter_standby", $filter_standby, '', '', '', true);
|
2010-09-17 14:34:11 +02:00
|
|
|
|
2015-03-06 12:28:05 +01:00
|
|
|
if(defined('METACONSOLE')){
|
2015-03-11 11:31:46 +01:00
|
|
|
$table->data[0][7] = html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub filter"', true);
|
|
|
|
$table->rowspan[0][7] = 2;
|
2015-03-06 12:28:05 +01:00
|
|
|
$data = '<form style="background-color: #ECECEC;" method="post" action="'.$url.'">';
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$table->data[1][4] = html_print_submit_button(__('Filter'), 'filter_button', false, 'class="sub filter"', true);
|
|
|
|
$data = '<form method="post" action="'.$url.'">';
|
|
|
|
}
|
2011-04-27 15:43:31 +02:00
|
|
|
$data .= html_print_table ($table, true);
|
2010-09-17 14:34:11 +02:00
|
|
|
$data .= '</form>';
|
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
|
|
|
|
2013-03-20 18:41:35 +01:00
|
|
|
if ($return) {
|
2010-09-17 14:34:11 +02:00
|
|
|
return $data;
|
2012-02-28 13:17:57 +01:00
|
|
|
}
|
|
|
|
else {
|
2010-09-17 14:34:11 +02:00
|
|
|
echo $data;
|
|
|
|
}
|
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
|
|
|
}
|
2010-05-03 11:02:18 +02:00
|
|
|
?>
|