2013-01-09 Miguel de Dios <miguel.dedios@artica.es>

* godmode/reporting/reporting_builder.php,
	godmode/reporting/reporting_builder.item_editor.php,
	godmode/agentes/agent_manager.php, include/functions_events.php,
	include/functions_reporting.php: added the option "no validaded" in
	the items for events.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7403 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-01-09 16:19:20 +00:00
parent 328c3167ef
commit 03893f6723
6 changed files with 80 additions and 30 deletions

View File

@ -1,3 +1,11 @@
2013-01-09 Miguel de Dios <miguel.dedios@artica.es>
* godmode/reporting/reporting_builder.php,
godmode/reporting/reporting_builder.item_editor.php,
godmode/agentes/agent_manager.php, include/functions_events.php,
include/functions_reporting.php: added the option "no validaded" in
the items for events.
2013-01-09 Miguel de Dios <miguel.dedios@artica.es>
* include/constants.php: added the default weight for unknown status

View File

@ -67,7 +67,7 @@ if (is_ajax ()) {
foreach ($idSNMP as $id) {
foreach ($snmp[$id] as $key => $value){
// Check if it has "ifXXXX" syntax and skip it
// Check if it has "ifXXXX" syntax and skip it
if (! preg_match ( "/if/", $key)) {
continue;
}
@ -120,7 +120,7 @@ if (!$new_agent) {
$agent_md5 = md5 ($nombre_agente, false);
$filename['md5'] = $config["remote_config"]."/md5/".$agent_md5.".md5";
$filename['conf'] = $config["remote_config"]."/conf/".$agent_md5.".conf";
}
}
$disk_conf = (bool) get_parameter ('disk_conf');
@ -148,9 +148,9 @@ $table->style = array ();
$table->style[0] = 'font-weight: bold; width: 150px;';
$table->data = array ();
$table->data[0][0] = __('Agent name') .
$table->data[0][0] = __('Agent name') .
ui_print_help_tip (__("The agent's name must be the same as the one defined at the console"), true);
$table->data[0][1] = html_print_input_text ('agente', $nombre_agente, '', 50, 100,true);
$table->data[0][1] = html_print_input_text ('agente', $nombre_agente, '', 50, 100,true);
if ($id_agente) {
$table->data[0][1] .= "&nbsp;<b>".__("ID")."</b>&nbsp; $id_agente &nbsp;";
@ -182,7 +182,7 @@ if ($id_agente) {
$ip_all = agents_get_addresses ($id_agente);
$table->data[1][1] .= html_print_select ($ip_all, "address_list", $direccion_agente, '', '', 0, true);
$table->data[1][1] .= "&nbsp;". html_print_checkbox ("delete_ip", 1, false, true).__('Delete selected');
$table->data[1][1] .= "&nbsp;". html_print_checkbox ("delete_ip", 1, false, true).__('Delete selected');
}
$groups = users_get_groups ($config["id_user"], "AR",false);
@ -214,6 +214,10 @@ $table->data[5][1] .= '</span>';
// Network server
$table->data[6][0] = __('Server');
if ($new_agent) {
//Set first server by default.
$server_name = reset(array_keys(servers_get_names()));
}
$table->data[6][1] = html_print_select (servers_get_names (),
'server_name', $server_name, '', __('None'), 0, true);

View File

@ -81,6 +81,7 @@ $date = null;
//Added for events items
$filter_event_validated = false;
$filter_event_no_validated = false;
$filter_event_critical = false;
$filter_event_warning = false;
@ -328,6 +329,7 @@ switch ($action) {
$period = $item['period'];
//Added for events items
$filter_event_no_validated = $style['filter_event_no_validated'];
$filter_event_validated = $style['filter_event_validated'];
$filter_event_critical = $style['filter_event_critical'];
$filter_event_warning = $style['filter_event_warning'];
@ -343,6 +345,7 @@ switch ($action) {
$group = $item['id_group'];
//Added for events items
$filter_event_no_validated = $style['filter_event_no_validated'];
$filter_event_validated = $style['filter_event_validated'];
$filter_event_critical = $style['filter_event_critical'];
$filter_event_warning = $style['filter_event_warning'];
@ -904,6 +907,8 @@ html_print_input_hidden('id_item', $idItem);
<td><?php echo __('Event filter'); ?></td>
<td>
<?php
echo __('No Validated');
html_print_checkbox ('filter_event_no_validated', true, $filter_event_no_validated);
echo __('Validated');
html_print_checkbox ('filter_event_validated', true, $filter_event_validated);
echo __('Critical');

View File

@ -712,6 +712,7 @@ switch ($action) {
break;
}
$filter_event_validated = get_parameter('filter_event_validated', 0);
$filter_event_no_validated = get_parameter('filter_event_no_validated', 0);
$filter_event_critical = get_parameter('filter_event_critical', 0);
$filter_event_warning = get_parameter('filter_event_warning', 0);
@ -777,6 +778,7 @@ switch ($action) {
case 'event_report_agent':
case 'event_report_group':
//Added for events items
$style['filter_event_no_validated'] = $filter_event_no_validated;
$style['filter_event_validated'] = $filter_event_validated;
$style['filter_event_critical'] = $filter_event_critical;
$style['filter_event_warning'] = $filter_event_warning;
@ -967,6 +969,7 @@ switch ($action) {
switch ($values['type']) {
case 'event_report_agent':
case 'event_report_group':
$filter_event_no_validated = get_parameter('filter_event_no_validated', 0);
$filter_event_validated = get_parameter('filter_event_validated', 0);
$filter_event_critical = get_parameter('filter_event_critical', 0);
$filter_event_warning = get_parameter('filter_event_warning', 0);
@ -976,6 +979,7 @@ switch ($action) {
$event_graph_by_criticity = get_parameter('event_graph_by_criticity', 0);
$event_graph_validated_vs_unvalidated = get_parameter('event_graph_validated_vs_unvalidated', 0);
//Added for events items
$style['filter_event_no_validated'] = $filter_event_no_validated;
$style['filter_event_validated'] = $filter_event_validated;
$style['filter_event_critical'] = $filter_event_critical;
$style['filter_event_warning'] = $filter_event_warning;

View File

@ -1055,7 +1055,7 @@ function events_print_type_description ($type, $return = false) {
*/
function events_get_group_events ($id_group, $period, $date,
$filter_event_validated = false, $filter_event_critical = false,
$filter_event_warning = false) {
$filter_event_warning = false, $filter_event_no_validated = false) {
global $config;
$id_group = groups_safe_acl ($config["id_user"], $id_group, "ER");
@ -1077,6 +1077,9 @@ function events_get_group_events ($id_group, $period, $date,
if ($filter_event_validated) {
$sql_where .= ' AND estado = 1 ';
}
if ($filter_event_no_validated) {
$sql_where .= ' AND estado = 0 ';
}
$sql = sprintf ('SELECT *,
@ -1108,7 +1111,7 @@ function events_get_group_events ($id_group, $period, $date,
*/
function events_get_agent ($id_agent, $period, $date = 0,
$filter_event_validated = false, $filter_event_critical = false,
$filter_event_warning = false) {
$filter_event_warning = false, $filter_event_no_validated = false) {
if (!is_numeric ($date)) {
$date = strtotime ($date);
@ -1129,6 +1132,9 @@ function events_get_agent ($id_agent, $period, $date = 0,
if ($filter_event_validated) {
$sql_where .= ' AND estado = 1 ';
}
if ($filter_event_no_validated) {
$sql_where .= ' AND estado = 0 ';
}
$sql = sprintf ('SELECT id_usuario,
(SELECT t2.fullname
@ -2103,7 +2109,7 @@ function events_clean_tags ($tags) {
*/
function events_get_count_events_by_agent ($id_group, $period, $date,
$filter_event_validated = false, $filter_event_critical = false,
$filter_event_warning = false) {
$filter_event_warning = false, $filter_event_no_validated = false) {
global $config;
$id_group = groups_safe_acl ($config["id_user"], $id_group, "AR");
@ -2125,6 +2131,9 @@ function events_get_count_events_by_agent ($id_group, $period, $date,
if ($filter_event_validated) {
$sql_where .= ' AND estado = 1 ';
}
if ($filter_event_no_validated) {
$sql_where .= ' AND estado = 0 ';
}
$sql = sprintf ('SELECT id_agente,
(SELECT t2.nombre
@ -2167,7 +2176,7 @@ function events_get_count_events_by_agent ($id_group, $period, $date,
*/
function events_get_count_events_validated_by_user ($filter, $period, $date,
$filter_event_validated = false, $filter_event_critical = false,
$filter_event_warning = false) {
$filter_event_warning = false, $filter_event_no_validated = false) {
global $config;
$sql_filter = ' AND 1=1 ';
@ -2199,6 +2208,9 @@ function events_get_count_events_validated_by_user ($filter, $period, $date,
if ($filter_event_validated) {
$sql_where .= ' AND estado = 1 ';
}
if ($filter_event_no_validated) {
$sql_where .= ' AND estado = 0 ';
}
$sql = sprintf ('SELECT id_usuario,
(SELECT t2.fullname
@ -2241,7 +2253,7 @@ function events_get_count_events_validated_by_user ($filter, $period, $date,
*/
function events_get_count_events_by_criticity ($filter, $period, $date,
$filter_event_validated = false, $filter_event_critical = false,
$filter_event_warning = false) {
$filter_event_warning = false, $filter_event_no_validated = false) {
global $config;
$sql_filter = ' AND 1=1 ';
@ -2273,6 +2285,9 @@ function events_get_count_events_by_criticity ($filter, $period, $date,
if ($filter_event_validated) {
$sql_where .= ' AND estado = 1 ';
}
if ($filter_event_no_validated) {
$sql_where .= ' AND estado = 0 ';
}
$sql = sprintf ('SELECT criticity,
COUNT(*) AS count
@ -2308,7 +2323,7 @@ function events_get_count_events_by_criticity ($filter, $period, $date,
*/
function events_get_count_events_validated ($filter, $period, $date,
$filter_event_validated = false, $filter_event_critical = false,
$filter_event_warning = false) {
$filter_event_warning = false, $filter_event_no_validated = false) {
global $config;
$sql_filter = ' AND 1=1 ';
@ -2340,6 +2355,9 @@ function events_get_count_events_validated ($filter, $period, $date,
if ($filter_event_validated) {
$sql_where .= ' AND estado = 1 ';
}
if ($filter_event_no_validated) {
$sql_where .= ' AND estado = 0 ';
}
$sql = sprintf ('SELECT estado,
COUNT(*) AS count

View File

@ -2066,7 +2066,7 @@ function reporting_get_agents_detailed_event ($id_agents, $period = 0,
function reporting_get_group_detailed_event ($id_group, $period = 0,
$date = 0, $return = false, $html = true,
$filter_event_validated = false, $filter_event_critical = false,
$filter_event_warning = false) {
$filter_event_warning = false, $filter_event_no_validated = false) {
if (!is_numeric ($date)) {
$date = strtotime ($date);
@ -2098,7 +2098,7 @@ function reporting_get_group_detailed_event ($id_group, $period = 0,
$events = events_get_group_events($id_group, $period, $date,
$filter_event_validated, $filter_event_critical,
$filter_event_warning);
$filter_event_warning, $filter_event_no_validated);
if ($events) {
foreach ($events as $event) {
@ -3155,6 +3155,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$style = json_decode(io_safe_output($content['style']), true);
$filter_event_no_validated = $style['filter_event_no_validated'];
$filter_event_validated = $style['filter_event_validated'];
$filter_event_critical = $style['filter_event_critical'];
$filter_event_warning = $style['filter_event_warning'];
@ -3179,7 +3180,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$report["datetime"], true,
$filter_event_validated,
$filter_event_critical,
$filter_event_warning);
$filter_event_warning,
$filter_event_no_validated);
array_push ($table->data, $data);
@ -3190,7 +3192,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$report["datetime"],
$filter_event_validated,
$filter_event_critical,
$filter_event_warning);
$filter_event_warning,
$filter_event_no_validated);
$table_event_graph = null;
$table_event_graph->head[0] = __('Events validated by user');
@ -3212,7 +3215,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$report["datetime"],
$filter_event_validated,
$filter_event_critical,
$filter_event_warning);
$filter_event_warning,
$filter_event_no_validated);
$table_event_graph = null;
$table_event_graph->head[0] = __('Events by criticity');
@ -3234,7 +3238,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$report["datetime"],
$filter_event_validated,
$filter_event_critical,
$filter_event_warning);
$filter_event_warning,
$filter_event_no_validated);
$table_event_graph = null;
$table_event_graph->head[0] = __('Amount events validated');
@ -3384,6 +3389,7 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$style = json_decode(io_safe_output($content['style']), true);
$filter_event_no_validated = $style['filter_event_no_validated'];
$filter_event_validated = $style['filter_event_validated'];
$filter_event_critical = $style['filter_event_critical'];
$filter_event_warning = $style['filter_event_warning'];
@ -3398,7 +3404,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$report["datetime"], true, true,
$filter_event_validated,
$filter_event_critical,
$filter_event_warning);
$filter_event_warning,
$filter_event_no_validated);
array_push ($table->data, $data);
if ($event_graph_by_agent) {
@ -3407,7 +3414,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$report["datetime"],
$filter_event_validated,
$filter_event_critical,
$filter_event_warning);
$filter_event_warning,
$filter_event_no_validated);
$table_event_graph = null;
$table_event_graph->head[0] = __('Events by agent');
@ -3429,7 +3437,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$report["datetime"],
$filter_event_validated,
$filter_event_critical,
$filter_event_warning);
$filter_event_warning,
$filter_event_no_validated);
$table_event_graph = null;
$table_event_graph->head[0] = __('Events validated by user');
@ -3451,7 +3460,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$report["datetime"],
$filter_event_validated,
$filter_event_critical,
$filter_event_warning);
$filter_event_warning,
$filter_event_no_validated);
$table_event_graph = null;
$table_event_graph->head[0] = __('Events by criticity');
@ -3473,7 +3483,8 @@ function reporting_render_report_html_item ($content, $table, $report, $mini = f
$report["datetime"],
$filter_event_validated,
$filter_event_critical,
$filter_event_warning);
$filter_event_warning,
$filter_event_no_validated);
$table_event_graph = null;
$table_event_graph->head[0] = __('Amount events validated');
@ -5928,7 +5939,7 @@ function reporting_template_graphs_get_user ($id_user = 0, $only_names = false,
function reporting_get_count_events_by_agent ($id_group, $period = 0,
$date = 0,
$filter_event_validated = false, $filter_event_critical = false,
$filter_event_warning = false) {
$filter_event_warning = false, $filter_event_no_validated = false) {
if (!is_numeric ($date)) {
$date = strtotime ($date);
@ -5944,7 +5955,7 @@ function reporting_get_count_events_by_agent ($id_group, $period = 0,
return events_get_count_events_by_agent($id_group, $period, $date,
$filter_event_validated, $filter_event_critical,
$filter_event_warning);
$filter_event_warning, $filter_event_no_validated);
}
/**
@ -5961,7 +5972,7 @@ function reporting_get_count_events_by_agent ($id_group, $period = 0,
function reporting_get_count_events_validated_by_user ($filter, $period = 0,
$date = 0,
$filter_event_validated = false, $filter_event_critical = false,
$filter_event_warning = false) {
$filter_event_warning = false, $filter_event_no_validated = false) {
if (!is_numeric ($date)) {
$date = strtotime ($date);
@ -5977,7 +5988,7 @@ function reporting_get_count_events_validated_by_user ($filter, $period = 0,
return events_get_count_events_validated_by_user($filter, $period, $date,
$filter_event_validated, $filter_event_critical,
$filter_event_warning);
$filter_event_warning, $filter_event_no_validated);
}
/**
@ -5994,7 +6005,7 @@ function reporting_get_count_events_validated_by_user ($filter, $period = 0,
function reporting_get_count_events_by_criticity ($filter, $period = 0,
$date = 0,
$filter_event_validated = false, $filter_event_critical = false,
$filter_event_warning = false) {
$filter_event_warning = false, $filter_event_no_validated = false) {
if (!is_numeric ($date)) {
$date = strtotime ($date);
@ -6010,7 +6021,7 @@ function reporting_get_count_events_by_criticity ($filter, $period = 0,
return events_get_count_events_by_criticity($filter, $period, $date,
$filter_event_validated, $filter_event_critical,
$filter_event_warning);
$filter_event_warning, $filter_event_no_validated);
}
/**
@ -6027,7 +6038,7 @@ function reporting_get_count_events_by_criticity ($filter, $period = 0,
function reporting_get_count_events_validated ($filter, $period = 0,
$date = 0,
$filter_event_validated = false, $filter_event_critical = false,
$filter_event_warning = false) {
$filter_event_warning = false, $filter_event_no_validated = false) {
if (!is_numeric ($date)) {
$date = strtotime ($date);
@ -6043,6 +6054,6 @@ function reporting_get_count_events_validated ($filter, $period = 0,
return events_get_count_events_validated($filter, $period, $date,
$filter_event_validated, $filter_event_critical,
$filter_event_warning);
$filter_event_warning, $filter_event_no_validated);
}
?>