diff --git a/pandora_console/include/functions_events.php b/pandora_console/include/functions_events.php
index 26ded59964..03d30bbc95 100644
--- a/pandora_console/include/functions_events.php
+++ b/pandora_console/include/functions_events.php
@@ -93,7 +93,7 @@ function events_get_events ($filter = false, $fields = false) {
*
* @return mixed False in case of error or invalid values passed. Event row otherwise
*/
-function events_get_event ($id, $fields = false) {
+function events_get_event ($id, $fields = false, $meta = false) {
if (empty ($id))
return false;
global $config;
@@ -103,7 +103,13 @@ function events_get_event ($id, $fields = false) {
$fields[] = 'id_grupo';
}
- $event = db_get_row ('tevento', 'id_evento', $id, $fields);
+ if($meta) {
+ $event = events_meta_get_event($id, array ('evento', 'id_agentmodule'), $history);
+ }
+ else {
+ $event = events_get_event ($id, array ('evento', 'id_agentmodule'));
+ }
+
if (! check_acl ($config['id_user'], $event['id_grupo'], 'ER'))
return false;
diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php
index 40232fd4d2..99102fcafb 100644
--- a/pandora_console/include/functions_reporting.php
+++ b/pandora_console/include/functions_reporting.php
@@ -159,22 +159,14 @@ function reporting_make_reporting_data($report = null, $id_report,
$content);
break;
case 'custom_graph':
+ case 'automatic_custom_graph':
$report['contents'][] =
reporting_custom_graph(
$report,
$content,
$type,
$force_width_chart,
- $force_height_chart, 'custom_graph');
- break;
- case 'automatic_graph':
- $report['contents'][] =
- reporting_custom_graph(
- $report,
- $content,
- $type,
- $force_width_chart,
- $force_height_chart, 'automatic_graph');
+ $force_height_chart);
break;
case 'text':
$report['contents'][] = reporting_text(
@@ -2631,8 +2623,8 @@ function reporting_alert_report_group($report, $content) {
$data_row['fired'] = array();
$firedTimes = get_module_alert_fired(
- $alert['id_agent_module'],
- $alert['id'],
+ $content['id_agent_module'],
+ $alert['id_alert_template'],
(int) $content['period'],
(int) $report["datetime"]);
@@ -2739,7 +2731,7 @@ function reporting_alert_report_agent($report, $content) {
$data_row['fired'] = array();
$firedTimes = get_module_alert_fired(
$alert['id_agent_module'],
- $alert['id'],
+ $alert['id_alert_template'],
(int) $content['period'],
(int) $report["datetime"]);
@@ -3183,14 +3175,6 @@ function reporting_prediction_date($report, $content) {
$return["date"] = reporting_get_date_text($report, $content);
$return['label'] = (isset($content['style']['label'])) ? $content['style']['label'] : '';
- $module_name = io_safe_output(
- modules_get_agentmodule_name($content['id_agent_module']));
- $agent_name = io_safe_output(
- modules_get_agentmodule_agent_name ($content['id_agent_module']));
-
- $return['agent_name'] = $agent_name;
- $return['module_name'] = $module_name;
-
set_time_limit(500);
$intervals_text = $content['text'];
@@ -3757,6 +3741,7 @@ function reporting_availability($report, $content) {
else {
$items = $content['subitems'];
}
+
@@ -4270,23 +4255,18 @@ function reporting_general($report, $content) {
}
function reporting_custom_graph($report, $content, $type = 'dinamic',
- $force_width_chart = null, $force_height_chart = null, $type_report = "custom_graph") {
+ $force_width_chart = null, $force_height_chart = null) {
global $config;
require_once ($config["homedir"] . '/include/functions_graph.php');
- if ($type_report == 'automatic_graph') {
- // Do none
- }
- else {
- if ($config['metaconsole']) {
- $id_meta = metaconsole_get_id_server($content["server_name"]);
-
-
- $server = metaconsole_get_connection_by_id ($id_meta);
- metaconsole_connect($server);
- }
+ if ($config['metaconsole']) {
+ $id_meta = metaconsole_get_id_server($content["server_name"]);
+
+
+ $server = metaconsole_get_connection_by_id ($id_meta);
+ metaconsole_connect($server);
}
$graph = db_get_row ("tgraph", "id_graph", $content['id_gs']);
@@ -4314,15 +4294,7 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
$labels = array();
foreach ($graphs as $graph_item) {
- if ($type_report == 'automatic_graph') {
- array_push ($modules, array(
- 'module' => $graph_item['id_agent_module'],
- 'server' => $graph_item['id_server']));
- }
- else {
- array_push ($modules, $graph_item['id_agent_module']);
- }
-
+ array_push ($modules, $graph_item['id_agent_module']);
array_push ($weights, $graph_item["weight"]);
if (in_array('label',$content['style'])) {
$item = array('type' => 'custom_graph',
@@ -4373,13 +4345,8 @@ function reporting_custom_graph($report, $content, $type = 'dinamic',
break;
}
- if ($type_report == 'automatic_graph') {
- // Do none
- }
- else {
- if ($config['metaconsole']) {
- metaconsole_restore_db();
- }
+ if ($config['metaconsole']) {
+ metaconsole_restore_db();
}
return reporting_check_structure_content($return);
@@ -5474,21 +5441,17 @@ function reporting_get_stats_alerts($data, $links = false) {
$table_al = html_get_predefined_table();
$tdata = array();
- $tdata[0] = html_print_image('images/bell.png', true, array('title' => __('Defined alerts')));
+ $tdata[0] = html_print_image('images/bell.png', true, array('title' => __('Defined alerts')), false, false, false, true);
$tdata[1] = $data["monitor_alerts"] <= 0 ? '-' : $data["monitor_alerts"];
$tdata[1] = '' . $tdata[1] . '';
- if($data["monitor_alerts"]>$data["total_agents"] && !enterprise_installed()){
- $tdata[2] = "

";
- }
-
- $tdata[3] = html_print_image('images/bell_error.png', true, array('title' => __('Fired alerts')));
- $tdata[4] = $data["monitor_alerts_fired"] <= 0 ? '-' : $data["monitor_alerts_fired"];
- $tdata[4] = '' . $tdata[4] . '';
+ $tdata[2] = html_print_image('images/bell_error.png', true, array('title' => __('Fired alerts')));
+ $tdata[3] = $data["monitor_alerts_fired"] <= 0 ? '-' : $data["monitor_alerts_fired"];
+ $tdata[3] = '' . $tdata[3] . '';
$table_al->rowclass[] = '';
$table_al->data[] = $tdata;
- if (!defined('METACONSOLE')) {
+ if (!is_metaconsole()) {
$output = '