diff --git a/pandora_console/godmode/reporting/visual_console_builder.editor.js b/pandora_console/godmode/reporting/visual_console_builder.editor.js
index f49ea8e58b..889d1d461b 100755
--- a/pandora_console/godmode/reporting/visual_console_builder.editor.js
+++ b/pandora_console/godmode/reporting/visual_console_builder.editor.js
@@ -1817,7 +1817,6 @@ function setEventsBar(id_data, values) {
type: "POST",
dataType: 'json',
success: function (data) {
- console.log(data);
if (data['no_data'] == true) {
$("#" + id_data + " img").attr('src', url_hack_metaconsole + 'images/console/signes/module_graph.png');
}
diff --git a/pandora_console/include/ajax/visual_console_builder.ajax.php b/pandora_console/include/ajax/visual_console_builder.ajax.php
index 33f36b8c7a..e7f423732f 100755
--- a/pandora_console/include/ajax/visual_console_builder.ajax.php
+++ b/pandora_console/include/ajax/visual_console_builder.ajax.php
@@ -151,7 +151,6 @@ switch ($action) {
'id_agentmodule' => $id_module,
'utimestamp > ' . $datelimit,
'utimestamp < ' . $date), 'criticity, utimestamp');
- html_debug($events, true);
$return = array();
if (!$events) {
diff --git a/pandora_console/include/functions_graph.php b/pandora_console/include/functions_graph.php
index d3845a51eb..ec3b2d7477 100644
--- a/pandora_console/include/functions_graph.php
+++ b/pandora_console/include/functions_graph.php
@@ -3565,7 +3565,7 @@ function graph_custom_sql_graph ($id, $width, $height,
* @param string homeurl
* @param bool return or echo the result
*/
-function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $homeurl, $return = false) {
+function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $homeurl, $return = false, $id_module = 0) {
global $config;
global $graphic_type;
@@ -3605,10 +3605,19 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
$full_legend[$cont] = $name;
$top = $datelimit + ($periodtime * ($i + 1));
- $event = db_get_row_filter ('tevento',
- array ('id_agente' => $id_agent,
- 'utimestamp > '.$bottom,
- 'utimestamp < '.$top), 'criticity, utimestamp');
+ if ($id_module != 0) {
+ $event = db_get_row_filter ('tevento',
+ array ('id_agente' => $id_agent,
+ 'utimestamp > '.$bottom,
+ 'utimestamp < '.$top), 'criticity, utimestamp');
+ }
+ else {
+ $event = db_get_row_filter ('tevento',
+ array ('id_agente' => $id_agent,
+ 'id_agentmodule' => $id_module,
+ 'utimestamp > '.$bottom,
+ 'utimestamp < '.$top), 'criticity, utimestamp');
+ }
if (!empty($event['utimestamp'])) {
$data[$cont]['utimestamp'] = $periodtime;
diff --git a/pandora_console/include/functions_visual_map.php b/pandora_console/include/functions_visual_map.php
index a92ce3f731..fd81e15d6d 100755
--- a/pandora_console/include/functions_visual_map.php
+++ b/pandora_console/include/functions_visual_map.php
@@ -376,6 +376,9 @@ function visual_map_print_item($mode = "read", $layoutData,
$link = true;
}
+ break;
+ case AUTO_SLA_GRAPH:
+ $link = true;
break;
default:
if (!empty($element_enterprise)) {
@@ -391,7 +394,6 @@ function visual_map_print_item($mode = "read", $layoutData,
$is_a_service = false;
$is_a_link_to_other_visualconsole = false;
-
if (enterprise_installed()) {
$id_service = services_service_from_module
($layoutData['id_agente_modulo']);
@@ -404,9 +406,6 @@ function visual_map_print_item($mode = "read", $layoutData,
$is_a_link_to_other_visualconsole = true;
}
-
-
-
if ($is_a_service) {
if (empty($layoutData['id_metaconsole'])) {
$url = $config['homeurl'] .
@@ -458,6 +457,36 @@ function visual_map_print_item($mode = "read", $layoutData,
}
+ break;
+ case AUTO_SLA_GRAPH:
+ $e_period = $layoutData['period'];
+ $date = get_system_time ();
+ $datelimit = $date - $e_period;
+
+ $time_format = "Y/m/d H:i:s";
+
+ $timestamp_init = date($time_format, $datelimit);
+ $timestamp_end = date($time_format, $date);
+
+ $timestamp_init_aux = explode(" ", $timestamp_init);
+ $timestamp_end_aux = explode(" ", $timestamp_end);
+
+ $date_from = $timestamp_init_aux[0];
+ $time_from = $timestamp_init_aux[1];
+
+ $date_to = $timestamp_end_aux[0];
+ $time_to = $timestamp_end_aux[1];
+
+ if (empty($layout_data['id_metaconsole'])) {
+ $url = $config['homeurl'] . "index.php?sec=eventos&sec2=operation/events/events&id_agent=" . $layoutData['id_agent'] .
+ "&module_search_hidden=" . $layoutData['id_agente_modulo'] . "&date_from=" . $date_from . "&time_from=" . $time_from .
+ "&date_to=" . $date_to . "&time_to=" . $time_to . "&status=-1";
+ }
+ else {
+ $url = "index.php?sec=eventos&sec2=operation/events/events&id_agent=" . $layoutData['id_agent'] .
+ "&module_search_hidden=" . $layoutData['id_agente_modulo'] . "&date_from=" . $date_from . "&time_from=" . $time_from .
+ "&date_to=" . $date_to . "&time_to=" . $time_to . "&status=-1";
+ }
break;
case GROUP_ITEM:
$is_a_link_to_other_visualconsole = false;
@@ -1046,13 +1075,51 @@ function visual_map_print_item($mode = "read", $layoutData,
case BOX_ITEM:
$z_index = 1;
break;
+ case AUTO_SLA_GRAPH:
+ if ((get_parameter('action') == 'edit') || (get_parameter('operation') == 'edit_visualmap')) {
+ if($width == 0 || $height == 0){
+ if ($layoutData['id_metaconsole'] != 0) {
+ $img = '
';
+ }
+ else{
+ $img = '
';
+ }
+ }
+ else{
+ if ($layoutData['id_metaconsole'] != 0) {
+ $img = '
';
+ }
+ else{
+ $img = '
';
+ }
+ }
+ }
+ else {
+ if ($width == 0 || $height == 0) {
+ $img = graph_graphic_agentevents ($layoutData['id_agent'], 500, 50, $layoutData['period'], '', true, $layoutData['id_agente_modulo']);
+ }
+ else{
+ $img = graph_graphic_agentevents ($layoutData['id_agent'], $width, $height, $layoutData['period'], '', true, $layoutData['id_agente_modulo']);
+ }
+ }
+
+ //Restore db connection
+ if ($layoutData['id_metaconsole'] != 0) {
+ metaconsole_restore_db();
+ }
+
+ $z_index = 2 + 1;
+ break;
}
-
+ html_debug(get_parameter('action'), true);
$class = "item ";
switch ($type) {
case STATIC_GRAPH:
$class .= "static_graph";
break;
+ case AUTO_SLA_GRAPH:
+ $class .= "auto_sla_graph";
+ break;
case GROUP_ITEM:
$class .= "group_item";
break;
@@ -1386,6 +1453,9 @@ function visual_map_print_item($mode = "read", $layoutData,
echo io_safe_output($text);
}
break;
+ case AUTO_SLA_GRAPH:
+ echo $img;
+ break;
case SIMPLE_VALUE:
case SIMPLE_VALUE_MAX:
case SIMPLE_VALUE_MIN: